Feature: Home Widgets in UAC for Add Alarm (1x1) and Next Alarm (4x2) in Android #834
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Introduces two new Android home screen widgets:
NextAlarmHomeWidget
andAddAlarmHomeWidget
. As mentioned in the issue as well, they are required for easy accessibility to the next alarm's details and for adding an alarm. Tackled by using ahome_widget
package, and created two home widgets.For each widget below, the files added are:
HomeWidget.kt
xml
files fordefault
,v21
,night
,v21-night
)xml
files for home widget)strings.xml
andstyles/
if required)xml
files)In
MainActivity.kt
, fetched the latest alarm details and updated the changes of the latest alarmRings in __
using a 1 min loop, by calculating theRings in __
value. And added the MethodChannel for opening the add-or-update-alarm screen for the add alarm home widget.In
NextAlarmHomeWidget.kt
, updated the values of the layout design based on the values received. It looked better without an AddAlarm button, Currently I have commented that part as it was mentioned in the issue, so if required I will put that back, or remove it.Added all required icons in drawable, for showing them on the widget if enabled.
In
AddAlarmHomeWidget
, in the same way, add the intent for the add alarm button.Now, in the home_controller's
refreshingAlarm
method, I have added anupdateHomeWidgetData
where the latest alarm that is going to ring, its data will be sent to home widgets.Finally, in the splash screen controller, if the initial route from the expected method channel is
add-update-alarm
, then navigate the user to the AddUpdate alarm screen, via the home screen.Proposed Changes
The main changes proposed in the issue were:
A combination of both will be implemented if required, but as of now, the UI for that has to be discussed, as it looks very messy merging both.
Fixes #254
Screenshots
Demo Video Link: https://drive.google.com/file/d/1zqrbWTbXSzcAIzujpaNB5y9FRPTRKbI3/view?usp=sharing
Checklist