Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 710643b0 authored by Annie Chin's avatar Annie Chin
Browse files

Move description from framelayout to new clicklistener on arrow.

Bug:17988532
Change-Id: I2c9d25eb9f2d81714cb2116c100919a3a6148fb2
parent ed10d65c
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -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
@@ -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>
+3 −0
Original line number Diff line number Diff line
@@ -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>
+19 −1
Original line number Diff line number Diff line
@@ -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;
@@ -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);
@@ -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);
@@ -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);