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

Commit 7cd60432 authored by Annie Chin's avatar Annie Chin
Browse files

Handle timer fab button when timer state is STATE_DELETED.

Bug: 21391070

In earlier versions of Clock, Timers are set to STATE_DELETED when
stopped post-firing. In version 4.0.1+, timers are marked STATE_DELETED
when they are actually deleted.

This discrepancy causes the timer fab button not to be refreshed when
the on-screen timer is from an older version and in state STATE_DELETED.

Change-Id: I280a9befae623c501f274ffe99dd6f2628cdefee
parent d66bf509
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -364,6 +364,9 @@ public class TimerFragment extends DeskClockFragment implements OnSharedPreferen
                break;
            case TimerObj.STATE_STOPPED:
            case TimerObj.STATE_RESTART:
            // It is possible for a Timer from an older version of Clock to be in STATE_DELETED and
            // still exist in the list
            case TimerObj.STATE_DELETED:
                mFab.setVisibility(View.VISIBLE);
                mFab.setContentDescription(r.getString(R.string.timer_start));
                mFab.setImageResource(R.drawable.ic_fab_play);
@@ -477,6 +480,9 @@ public class TimerFragment extends DeskClockFragment implements OnSharedPreferen
                    break;
                case TimerObj.STATE_STOPPED:
                case TimerObj.STATE_RESTART:
                // It is possible for a Timer from an older version of Clock to be in STATE_DELETED and
                // still exist in the list
                case TimerObj.STATE_DELETED:
                    // Reset the remaining time and continue timer
                    t.setState(TimerObj.STATE_RUNNING);
                    t.mStartTime = Utils.getTimeNow() - (t.mOriginalLength - t.mTimeLeft);