diff options
author | Michael W <baddaemon87@gmail.com> | 2022-03-07 22:24:25 +0100 |
---|---|---|
committer | Michael W <baddaemon87@gmail.com> | 2022-04-18 10:02:16 +0200 |
commit | fa5bf24dd40f89f9d0a38058a9979725f0ff6720 (patch) | |
tree | 225b79ee2d8a401d42d905e75beef8fc1991406f | |
parent | 8ac23932464461557c48b520fbc141efcd8a8ad5 (diff) |
DeskClock: Fix left button display
* When adding a new timer, the left FAB will change to a "delete" icon
* Switching to another tab and returning will not display it anymore,
resulting in the requirement to actually start a new timer to be able
to access already running ones
* Test:
- Default FAB visibility is GONE until a valid value is inserted
- Changing from and to tab will display it again if value was already
inserted
- Start timer
- Click "Add" (right button)
- Delete button will appear
- Delete button will be visible after swicthing tab and returning
Change-Id: I311faa96ea9e0320c630fa858227f2ad4625eb4e
-rw-r--r-- | src/com/android/deskclock/timer/TimerFragment.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/deskclock/timer/TimerFragment.java b/src/com/android/deskclock/timer/TimerFragment.java index e194891ef..165c359bd 100644 --- a/src/com/android/deskclock/timer/TimerFragment.java +++ b/src/com/android/deskclock/timer/TimerFragment.java @@ -238,15 +238,15 @@ public final class TimerFragment extends DeskClockFragment { @Override public int getFabTargetVisibility() { + final Timer timer = getTimer(); if (mCurrentView == mTimersView) { - final Timer timer = getTimer(); if (timer == null) { return INVISIBLE; } else { return VISIBLE; } } else if (mCurrentView == mCreateTimerView) { - if (mCreateTimerView.hasValidInput()) { + if (mCreateTimerView.hasValidInput() || timer != null) { return VISIBLE; } else { return INVISIBLE; |