Loading res/layout/alarm_time.xml +8 −7 Original line number Diff line number Diff line Loading @@ -159,19 +159,19 @@ android:id="@+id/collapse_expand" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:contentDescription="@string/collapse_alarm"> android:layout_gravity="bottom"> <ImageButton android:id="@+id/delete" android:layout_width="wrap_content" android:layout_height="48dip" android:layout_width="@dimen/touch_target_min_size" android:layout_height="@dimen/touch_target_min_size" android:layout_gravity="center_vertical|start" android:layout_marginTop="@dimen/alarm_clock_vertical_margin" android:layout_marginBottom="@dimen/alarm_clock_vertical_margin" android:layout_marginStart="4dip" android:layout_gravity="start" android:background="?android:attr/selectableItemBackgroundBorderless" android:contentDescription="@string/delete_alarm" android:scaleType="center" android:src="@drawable/ic_delete_small" /> <View Loading Loading @@ -224,12 +224,13 @@ <ImageView android:id="@+id/arrow" android:layout_width="wrap_content" android:layout_height="48dip" android:layout_width="@dimen/touch_target_min_size" android:layout_height="@dimen/touch_target_min_size" android:layout_gravity="center_vertical|end" android:layout_marginTop="@dimen/alarm_clock_vertical_margin" android:layout_marginBottom="@dimen/alarm_clock_vertical_margin" android:contentDescription="@string/expand_alarm" android:scaleType="center" android:src="@drawable/ic_expand_down" /> </FrameLayout> </FrameLayout> Loading res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -174,4 +174,7 @@ <!-- Divider height --> <dimen name="hairline_height">1dip</dimen> <!-- The minimum height/width of any touch target --> <dimen name="touch_target_min_size">48dip</dimen> </resources> src/com/android/deskclock/AlarmClockFragment.java +19 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import android.transition.TransitionSet; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewTreeObserver; Loading Loading @@ -754,6 +753,21 @@ public class AlarmClockFragment extends DeskClockFragment implements itemHolder.hairLine.setVisibility(expanded ? View.GONE : View.VISIBLE); itemHolder.arrow.setRotation(expanded ? ROTATE_180_DEGREE : 0); // Add listener on the arrow to enable proper talkback functionality. // Avoid setting content description on the entire card. itemHolder.arrow.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (isAlarmExpanded(alarm)) { // Is expanded, make collapse call. collapseAlarm(itemHolder, true); } else { // Is collapsed, make expand call. expandAlarm(itemHolder, true); } } }); // Set the repeat text or leave it blank if it does not repeat. final String daysOfWeekStr = alarm.daysOfWeek.toString(AlarmClockFragment.this.getActivity(), false); Loading Loading @@ -1087,6 +1101,8 @@ public class AlarmClockFragment extends DeskClockFragment implements itemHolder.expandArea.setVisibility(View.VISIBLE); itemHolder.delete.setVisibility(View.VISIBLE); itemHolder.arrow.setContentDescription(getString(R.string.collapse_alarm)); if (!animate) { // Set the "end" layout and don't do the animation. itemHolder.arrow.setRotation(ROTATE_180_DEGREE); Loading Loading @@ -1199,6 +1215,8 @@ public class AlarmClockFragment extends DeskClockFragment implements setAlarmItemBackgroundAndElevation(itemHolder.alarmItem, false /* expanded */); itemHolder.expandArea.setVisibility(View.GONE); itemHolder.arrow.setContentDescription(getString(R.string.expand_alarm)); if (!animate) { // Set the "end" layout and don't do the animation. itemHolder.arrow.setRotation(0); Loading Loading
res/layout/alarm_time.xml +8 −7 Original line number Diff line number Diff line Loading @@ -159,19 +159,19 @@ android:id="@+id/collapse_expand" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:contentDescription="@string/collapse_alarm"> android:layout_gravity="bottom"> <ImageButton android:id="@+id/delete" android:layout_width="wrap_content" android:layout_height="48dip" android:layout_width="@dimen/touch_target_min_size" android:layout_height="@dimen/touch_target_min_size" android:layout_gravity="center_vertical|start" android:layout_marginTop="@dimen/alarm_clock_vertical_margin" android:layout_marginBottom="@dimen/alarm_clock_vertical_margin" android:layout_marginStart="4dip" android:layout_gravity="start" android:background="?android:attr/selectableItemBackgroundBorderless" android:contentDescription="@string/delete_alarm" android:scaleType="center" android:src="@drawable/ic_delete_small" /> <View Loading Loading @@ -224,12 +224,13 @@ <ImageView android:id="@+id/arrow" android:layout_width="wrap_content" android:layout_height="48dip" android:layout_width="@dimen/touch_target_min_size" android:layout_height="@dimen/touch_target_min_size" android:layout_gravity="center_vertical|end" android:layout_marginTop="@dimen/alarm_clock_vertical_margin" android:layout_marginBottom="@dimen/alarm_clock_vertical_margin" android:contentDescription="@string/expand_alarm" android:scaleType="center" android:src="@drawable/ic_expand_down" /> </FrameLayout> </FrameLayout> Loading
res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -174,4 +174,7 @@ <!-- Divider height --> <dimen name="hairline_height">1dip</dimen> <!-- The minimum height/width of any touch target --> <dimen name="touch_target_min_size">48dip</dimen> </resources>
src/com/android/deskclock/AlarmClockFragment.java +19 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ import android.transition.TransitionSet; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewTreeObserver; Loading Loading @@ -754,6 +753,21 @@ public class AlarmClockFragment extends DeskClockFragment implements itemHolder.hairLine.setVisibility(expanded ? View.GONE : View.VISIBLE); itemHolder.arrow.setRotation(expanded ? ROTATE_180_DEGREE : 0); // Add listener on the arrow to enable proper talkback functionality. // Avoid setting content description on the entire card. itemHolder.arrow.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (isAlarmExpanded(alarm)) { // Is expanded, make collapse call. collapseAlarm(itemHolder, true); } else { // Is collapsed, make expand call. expandAlarm(itemHolder, true); } } }); // Set the repeat text or leave it blank if it does not repeat. final String daysOfWeekStr = alarm.daysOfWeek.toString(AlarmClockFragment.this.getActivity(), false); Loading Loading @@ -1087,6 +1101,8 @@ public class AlarmClockFragment extends DeskClockFragment implements itemHolder.expandArea.setVisibility(View.VISIBLE); itemHolder.delete.setVisibility(View.VISIBLE); itemHolder.arrow.setContentDescription(getString(R.string.collapse_alarm)); if (!animate) { // Set the "end" layout and don't do the animation. itemHolder.arrow.setRotation(ROTATE_180_DEGREE); Loading Loading @@ -1199,6 +1215,8 @@ public class AlarmClockFragment extends DeskClockFragment implements setAlarmItemBackgroundAndElevation(itemHolder.alarmItem, false /* expanded */); itemHolder.expandArea.setVisibility(View.GONE); itemHolder.arrow.setContentDescription(getString(R.string.expand_alarm)); if (!animate) { // Set the "end" layout and don't do the animation. itemHolder.arrow.setRotation(0); Loading