summaryrefslogtreecommitdiff
path: root/src/com/android/deskclock/timer/TimerFragment.java
AgeCommit message (Collapse)Author
2022-04-18DeskClock: Material Me? No YOU!Michael W
* Since Android 12 introduced a new style, try to mimic it for this app * Due to AndroidX and the support libraries still being old, we have to, like Settings does with SettingsLib, create our own styles in the desired looks * Also adjust the color scheme to reflect Material You * We deviated from AOSP already quite a bit, so we don't need to really care about the change's footprint * Clean up behind us by removing (now unused) resources and includes in files that were modified anyways (and adjust order while on it) * Copy CollapsibleToolbarBaseActivity and required resources from SettingsLib - that way we can mimic the style easily without having to move this app to system_ext or using privileged_api * Since we always use dark layout, modify slightly so it works for us * Remove things we don't need so we don't have to copy too many files from SettingsLib Change-Id: I4c81e03c71f468a9e468426a8233ad96059cb05d
2022-04-18DeskClock: Fix left button displayMichael W
* 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
2020-12-08DeskClock: Fix FAB not being shown everytimeMichael W
* The getTimer() method returns null when we call getFabTargetVisibility() before the onCreateView method gets called, resulting in the FAB not being shown * A video how to reproduce the issue can be found on the bug report linked below * Fix: Always return the first timer (if one exists) so we can properly decide if the FAB needs to be shown Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/2250 Change-Id: Id16686c729ee41d14c890827dc441e81511c8405
2020-12-08DeskClock: Replace ViewPager with manual fragment handlingMichael W
Change-Id: Iaadfb417f0ca8638936875113ec2f39853f2a39c
2020-12-08DeskClock: Update drawablesLuK1337
* Copied from: frameworks/base/packages/overlays/IconPackCircularSettingsOverlay/res/drawable/ic_delete.xml frameworks/base/packages/SystemUI/res-keyguard/drawable/ic_backspace_black_24dp.xml https://materialdesignicons.com https://material.io Change-Id: I84de4bfb9e38a88de182586e849c4e47d8d59b69
2020-12-08AOSP/DeskClock - Update Fragment related code to use AndroidXColin Marsch
Kotlin AndroidX upgrades, as well as Java AndroidX upgrades to ensure both DeskClock and DeskClockJava targets pass the tests. Test: manual, tested the DeskClock UI. As well tests were ran as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClock $ adb install out/target/product/sargo/product/app/DeskClock/DeskClock.apk $ atest DeskClockTests $ make DeskClockJava $ adb install out/target/product/sargo/product/app/DeskClockJava/DeskClockJava.apk $ atest DeskClockTests BUG: 157255731 Change-Id: I4e038932e913a125265bcf5c0091f69e34ec16ce
2018-04-03Convert DeskClock to androidx.Aurimas Liutikas
Test: compile and open Bug: 76692459 Change-Id: Ibf8e95a917fbe3e364340ed1c5fba6e66f2d8afd
2017-11-17Handle ACTION_DISMISS_TIMER intentChristine Franks
Bug: 38475809 Test: adb shell am start -a android.intent.action.DISMISS_TIMER Change-Id: Ifa0b3caa9b021334d573f8d312acbb4236273e4e
2017-01-30Timer view alphas reset on animation endSean Stout
Bug: 34815224 Test: manual - check breaking case and non-breaking case. Confirm animations still work Change-Id: Ibe57a336e7d773b1398f6c8ec64589ad4e979eb2
2016-12-01Fix animation from timer setup to timer listJames Lemieux
The creation of the new timer cannot be delayed because the new timer component is necessary for the animations . Restore the apriori timer creation and avoid updating the fab in response to timers created via the UI. This avoids showing the "Cancel" button immediately before starting the animation and transitioning to the timer list. Change-Id: I68487b25f9dc2a599cbe6b38e1ba9a0bd02a172a
2016-11-30Animate fab and timer view change in parallelJames Lemieux
Bug: 32703589 These animations used to occur serially. To parallelize them, new UpdateTypes were added to only shrink and only expand the fab and buttons. This allows these animations to be synchronized with other animations that alter the view. Also, creating the new timer had to be delayed until after hiding the fab and buttons so that their state was consistent as they shrunk. This mirrors the delayed removal of timers that already existed. Change-Id: I381b86fd55d5d51c522138c2b51996594da7f85e
2016-11-23Inject FabContainer rather than casting parent ActivityJames Lemieux
Change-Id: I64347f6e348e0962532406c6ffa2537d467cda8e
2016-11-01Change timer translation distanceChristine Franks
Bug: 32447221 Test: manual - Start a timer (animating down), Delete the last timer (animating up), tapping "add timer" (animating down), and cancelling a timer addition (animate up). Change-Id: I943bab4f69460c70309080ffcae809376efa4aa9
2016-10-21Avoid IllegalStateException while editing labelJames Lemieux
Bug: 32333918 Bug: 32332232 It appears the IME can deliver events after the fragment has saved its state. Defensive code now stops listening for IME events when the fragment view is destroyed. It also calls dismissAllowingStateLoss() to be more resilient to this problem. Change-Id: I3139c7f56596e148e9179035562f80e9fc232cf4
2016-10-20Merge "Animation for creating and adding timers" into ub-deskclock-huddleChristine Franks
2016-10-19Animation for creating and adding timersChristine Franks
Bug: 31527793 Bug: 28139445 Test: manual -- create timers and add new timers, and ensure improved animation plays. Change-Id: I658eb33e4a8f0ffe2224806269e721ecaa9c5917
2016-10-18Play/Pause/Stop animated icons are now N+ only.Sean Stout
Bug: 32223930 Test: manual - Check N+ and M- Change-Id: I40548bcec9525acb0da3b0b80c10a4a65b1ee1e3
2016-10-06Adding play/pause animated icon for Timer and StopwatchSean Stout
Bug: 30810789 Test: Manually verified play/pause icon animates in timer/stopwatch. Change-Id: Ib81fba107c7299b4aaf7f9313ee68429b31e82ff
2016-10-05Replaced Timer and Stopwatch button images with text.Sean Stout
Bug: 31348653 Test: manual - Play and pause timer and stopwatch Timer and stopwatch left and right buttons now use text instead of images. Timer "add minute" and "reset" button now also uses text. Change-Id: Ie9e19cc7c4162c3fb4c77d92cb53517bf3af83f6
2016-09-09Remove IAE when switching TimerFragment viewsJustin Klaassen
am: 3337bd4fd1 Change-Id: I9131d4d5ae79ef685832be712d567e99eeac4dc3
2016-09-09Remove IAE when switching TimerFragment viewsJustin Klaassen
Bug: 31396356 Change-Id: I3b158ceb63781d3839b9839e29cf7b0cbda1d2c6
2016-09-08Timer right button won't go to create timer if already thereSean Stout
am: fd7f9681f5 Change-Id: Ife1c83dbdb1fb08fe2ea19668a377acfa5bc2aa0
2016-09-08Timer right button won't go to create timer if already thereSean Stout
Bug: 31068990 Test: manual - quickly tap "delete" and "add timer" in succession Change-Id: I15b6c06e06ed282cf8ec7d5f1aaea8bba4cdcd85
2016-09-01resolve merge conflicts of ab6a8e1 to ub-deskclock-huddleJustin Klaassen
Change-Id: I88f075b4c6fc95e54a92d11328e4258521c7054e
2016-08-31Adds a11y announcements to timer for user actions.Christine Franks
Bug: 30451287 Change-Id: I2355d8824bdfdd25a011c3b82f9b27708a445a36
2016-08-30Cleanup exported APIsJustin Klaassen
Bug: 30076796 - Removed preliminary support for deeplinks since Clock doesn't have a public content provider. - Removed unnecessarily exported intent actions since Intents specifying explicit components don't need to register specific actions. - Removed unused strings and resources. Change-Id: Ifbee006dbd752ecdcfe0125cabe19ffda40ea659
2016-06-14Stopwatches and timers continue to work after device reboot.Sean Stout
Bug: 8101723 Upon device shutdown and reboot, the stopwatch will resume state. If the stopwatch was running, it will continue to run as well as account for the time that the device was off. Additionally, all timers that are on the device will resume state. If the timer was running, it will continue to run on device reboot. If the timer was missed by less than 1 minute, the timer will still go off. If the timer was missed by more than 1 minute, the timer will go to a new "missed" state and give the user a notification that a timer has been missed. Change-Id: Ib7f199ef5be4714b831450933c574f39824d15dc Stopwatches and timers continue to work after device reboot. Bug: 8101723 Upon device shutdown and reboot, the stopwatch will resume state. If the stopwatch was running, it will continue to run as well as account for the time that the device was off. Additionally, all timers that are on the device will resume state. If the timer was running, it will continue to run on device reboot. If the timer was missed by less than 1 minute, the timer will still go off. If the timer was missed by more than 1 minute, the timer will go to a new "missed" state and give the user a notification that a timer has been missed. Change-Id: I831d7a5172a3cede595db1b62e503ecc8c4c55c2
2016-05-25Keyboard can now be used to create a timer.Sean Stout
Bug: 26055290 External keyboard number keys and backspace can now be used to create a timer. Change-Id: Idff9fac44d25f3e9e4cd6e84d64bce778e15ab7d
2016-05-13Adjust timer setup layout for multiwindowJames Lemieux
Bug: 26840878 Change-Id: I641090f90f2063964992a714b7f22f5ed3e19f92
2016-04-06Use avd for stopwatch lap to reset button transition.Fan Zhang
Bug: 28026276 Change-Id: I9d2f12d96bf1d32e66a6f6023f6bfb5d90b3eccc
2016-02-26Avoid showing timer creation inappropriatelyJames Lemieux
Bug: 27360981 When no timers exist the timer creation screen is displayed by default. If a new timer is created via an Intent (e.g. GSA), the timer creation state was sticking around. When TimerFragment was next onResume()d, the timer creation screen was incorrectly brought forward to honor the stale timer creation state. The stale state is now cleared each time the timer creation screen is torn down. Change-Id: I9122943c2f8521af040153bcc5ba647b35f0346f
2016-02-18Rename ic_cancel.png -> ic_close.pngJames Lemieux
So it matches the material name given to this icon. Change-Id: I781e6d877257f4dbadc2d984388046a830ec6abd
2015-12-11TimerSetupView now repurposes fab and buttonsJames Lemieux
TimerSetupView used to have its own fab and a custom button for the X icon that cancels timer creation. It now utilizes the application's fab and buttons. This ensures that fab/button locations and animations are uniform. Child fragments and views no longer have direct access to the fab and buttons outside of specific callbacks. This design attempts to remove past bugs where irrelevant views altered the state of the fab at inappropriate times. Change-Id: If8c69246e915f6357df80a6d8107f7b2b5a6172e
2015-11-30Remember the last selected tab between DeskClock launchesJames Lemieux
Bug: 24220917 DeskClock now permanently tracks the last selected tab using SharedPreferences and restores it on subsequent restarts. Along with this change came a large refactoring to the way tabs are modeled and stored within the application. In particular: - UiDataModel was created and answers questions about the tabs that exist, their order, their display order and which one is currently selected. - DeskClock activity captures the tab change, records it in UiDataModel and then reacts to tab changes from the UiDataModel - Consequently, any area of the application may now alter the selected tab programmatically by calling UiDataModel.getDataModel().setSelectedTab(aTab); Change-Id: I1c655d17c68c4c1cdf96bae1e9f2e3c4d9e2251a
2015-11-23Fix creation of first timer via voiceJames Lemieux
Bug: 25843144 Attempting to view a specific timer trumps the timer setup screen in all cases. onResume() now enforces that policy. The timer setup screen is still displayed in all other cases, including: - no timers exist - the intent indicates a new timer should be created - the last visible timer screen was the timer setup screen Change-Id: I28d147cadeb29055fa0c68a44da6648f6ad33238
2015-11-19Fix fab disappearing on rotation when no timers existJames Lemieux
Bug: 25779786 The issue here is that TimerSetupView actually customizes the fab. These customizations include setting it invisible. It was a poor design to share the fab with this view. So, the fix is that the view now holds its own fab-like button that it is free to manipulate without fear of altering the app-wide fab state unintentionally. Change-Id: Ie83b03c98db4f77e0be912b122b6f74c2c7e6c8a
2015-11-10Refactor Timers to use new unified DataModelJames Lemieux
Bug: 24816218 Bug: 25494722 This refactoring introduces a Timer domain object. Instances of these domain objects are fetched via a DataModel class that is the single point of reference for all timer data. This allows the data to be shared across the entire application. In particular, the timer notifications, TimerFragment and ExpiredTimersActivity all draw upon the same model to determine what the state of the timers are. IMPORTANT: The public intent com.android.deskclock.action.STOP_TIMER has been renamed to com.android.deskclock.action.PAUSE_TIMER to be more accurate. Change-Id: Ib904e80a25c6de1861de2b395bec27db16ff0e66
2015-10-16Add talkback announcements for alarm deletion/set and timerAnnie Chin
deletion/cancel. Bug: 24963071 Bug: 24929160 Change-Id: I3910eb0b6a0ec718b0fe7b9e5e81cbab327a7fbc
2015-08-20Move menuitem handling from DeskClock to its own component.Fan Zhang
Bug: 23351503 Change-Id: Ie31028eb827c7999d2eb8e522a222b17a1618188
2015-08-11Use design support library's FloatingActionButton in clock.Fan Zhang
Bug:22879012 Change-Id: I5fc59ca383860ced1fa12ecbca3a59133312466e
2015-07-31Give up the dream of supporting pre-KitkatJames Lemieux
All SDK version checks are now routed through readable cover methods on Utils. All code paths handling SDK versions that predate Kitkat have been removed. Change-Id: I876620ad34ab3d701789cb35904ccfe03c2d1e45
2015-07-10Scroll to the started timer when timer is started through API call.Annie Chin
Bug: 22224832 Previously defaulted to the first timer in the list due to the assumption that the started timer would be new. Change-Id: Ibb42b14e3d47f7e9ded9460722a509c75ab9cb1a
2015-07-09Enable HUN for Timer notifications.Annie Chin
Bug: 15470349 Bug: 22120450 When the app is open, hide the HUN. Clicking on the HUN opens TimerFullScreenAlert. This implementation also fixes the issue where the times-up notification is not dismissed when timer is dismissed from wear. Change-Id: Ic264cee5f381692d787a06db191af55a0aed37eb
2015-07-06Do not updateTimesUp for timer label changes.Annie Chin
Bug: 22181821 Label changes do not affect timer firing times, so eliminate the unnecessary update in that case. Change-Id: I61b46085c268f19342022b5e0a6a62aef4652093
2015-06-29am e3795f2b: TimerFragment should only adjust the fab when it is selectedJames Lemieux
* commit 'e3795f2b678dcd455e248f4ea43903f22d2387fd': TimerFragment should only adjust the fab when it is selected
2015-06-29TimerFragment should only adjust the fab when it is selectedJames Lemieux
TimerFragment has a vertical pager that presents a vertical list of all defined timers. If changes occur to that pager (as they do in TimerFragment.onResume()), it was possible for the TimerFragment to incorrectly adjust the fab icon when it was not the selected tab. Bug: 22159053 Change-Id: Ie62fbf0a2a7bee4dd69660422ff8741de6cb20c8
2015-06-23am 7cd60432: Handle timer fab button when timer state is STATE_DELETED.Annie Chin
* commit '7cd604327e8719da26a7d6735d8b0df94f0ac66a': Handle timer fab button when timer state is STATE_DELETED.
2015-06-22Handle timer fab button when timer state is STATE_DELETED.Annie Chin
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
2015-06-08Restore timer firing.James Lemieux
Change-Id: I95e3beb375d85e47a9a125d7c7ea8f0f2a017e4b
2015-05-27Added Voice Action IntentsDaria Evdokimova
Added Voice Action Intents for Alarms, Clocks, Timers, and Stopwatch. Fixed bugs that prevented the UI from going idle when a timer/stopwatch is running. Added Tests for intents from HandleVoiceApiCalls. Removed static imports in HandleApiCalls. Fixed a bug that didn't cancel a pending intent for an alarm after it was deleted. Integrated Intent Actions based on updates to AlarmClock.java MNC. Bug: 21337563 Bug: 21337557 Bug: 21336697 Change-Id: If82bfad6487989839defc81483dff603c53e7cb8