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

Commit f41e32c7 authored by Sam Blitzstein's avatar Sam Blitzstein
Browse files

Finishing touches on redlines.

 * make sure the alarm items' hairlines are correctly translated
   on rotation
 * use new timer icon for timer notifications
 * remove colon from alarm summary

Change-Id: Ia747f645483fb4f2770afb5da6821351b85bdb65
parent 5a6d8ef0
Loading
Loading
Loading
Loading
+356 B (1.35 KiB)
Loading image diff...
+232 B (1002 B)
Loading image diff...
+417 B (1.78 KiB)
Loading image diff...
+274 B (2.36 KiB)
Loading image diff...
+18 −7
Original line number Diff line number Diff line
@@ -136,7 +136,6 @@ public class AlarmClockFragment extends DeskClockFragment implements
        Bundle previousDayMap = null;
        if (savedState != null) {
            expandedIds = savedState.getLongArray(KEY_EXPANDED_IDS);
            Log.v("expanded: "+expandedIds);
            repeatCheckedIds = savedState.getLongArray(KEY_REPEAT_CHECKED_IDS);
            mRingtoneTitleCache = savedState.getBundle(KEY_RINGTONE_TITLE_CACHE);
            mDeletedAlarm = savedState.getParcelable(KEY_DELETED_ALARM);
@@ -683,7 +682,7 @@ public class AlarmClockFragment extends DeskClockFragment implements
            itemHolder.expandArea.setVisibility(expanded? View.VISIBLE : View.GONE);
            itemHolder.summary.setVisibility(expanded? View.GONE : View.VISIBLE);

            String colons = "";
            String labelSpace = "";
            // Set the repeat text or leave it blank if it does not repeat.
            final String daysOfWeekStr =
                    alarm.daysOfWeek.toString(AlarmClockFragment.this.getActivity(), false);
@@ -692,7 +691,7 @@ public class AlarmClockFragment extends DeskClockFragment implements
                itemHolder.daysOfWeek.setContentDescription(alarm.daysOfWeek.toAccessibilityString(
                        AlarmClockFragment.this.getActivity()));
                itemHolder.daysOfWeek.setVisibility(View.VISIBLE);
                colons = ": ";
                labelSpace = "  ";
                itemHolder.daysOfWeek.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
@@ -706,7 +705,7 @@ public class AlarmClockFragment extends DeskClockFragment implements
            }

            if (alarm.label != null && alarm.label.length() != 0) {
                itemHolder.label.setText(alarm.label + colons);
                itemHolder.label.setText(alarm.label + labelSpace);
                itemHolder.label.setVisibility(View.VISIBLE);
                itemHolder.label.setContentDescription(
                        mContext.getResources().getString(R.string.label_description) + " "
@@ -984,9 +983,21 @@ public class AlarmClockFragment extends DeskClockFragment implements
            if (!animate) {
                // Set the "end" layout and don't do the animation.
                itemHolder.arrow.setRotation(180);
                // We need to translate the hairline up, so the height of the collapseArea
                // needs to be measured to know how high to translate it.
                final ViewTreeObserver observer = mAlarmsList.getViewTreeObserver();
                observer.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
                    @Override
                    public boolean onPreDraw() {
                        // We don't want to continue getting called for every listview drawing.
                        observer.removeOnPreDrawListener(this);
                        int hairlineHeight = itemHolder.hairLine.getHeight();
                int collapseHeight = itemHolder.collapseExpandArea.getHeight() - hairlineHeight;
                        int collapseHeight =
                                itemHolder.collapseExpandArea.getHeight() - hairlineHeight;
                        itemHolder.hairLine.setTranslationY(-collapseHeight);
                        return true;
                    }
                });
                return;
            }