Skip to content

Feature: Home Widgets in UAC for Add Alarm (1x1) and Next Alarm (4x2) in Android #834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Gaurav-Kushwaha-1225
Copy link
Contributor

@Gaurav-Kushwaha-1225 Gaurav-Kushwaha-1225 commented Apr 27, 2025

Description

Introduces two new Android home screen widgets: NextAlarmHomeWidget and AddAlarmHomeWidget. 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 a home_widget package, and created two home widgets.

For each widget below, the files added are:

  • HomeWidget.kt
  • drawable (background UI xml files for default, v21, night, v21-night)
  • layout (layout design xml files for home widget)
  • values (strings.xml and styles/ if required)
  • xml (home widget info files, for adding resources in xml files)

In MainActivity.kt, fetched the latest alarm details and updated the changes of the latest alarm Rings in __ using a 1 min loop, by calculating the Rings 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 an updateHomeWidgetData 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 plus icon that leads directly to the add alarm screen. (1*1)
  • The tile that shows the next alarm that's been set. (4* 1 or 5*1)
  • A combination of both (4* 2,5*2).

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

Screenshot_2025-04-27-19-13-03-05_b783bf344239542886fee7b48fa4b892.jpg Screenshot_2025-04-27-19-13-11-80_b783bf344239542886fee7b48fa4b892.jpg
Screenshot_2025-04-27-19-15-59-19_b783bf344239542886fee7b48fa4b892.jpg Screenshot_2025-04-27-19-15-49-55_b783bf344239542886fee7b48fa4b892.jpg

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

@Gaurav-Kushwaha-1225 Gaurav-Kushwaha-1225 marked this pull request as draft April 27, 2025 12:32
@Gaurav-Kushwaha-1225 Gaurav-Kushwaha-1225 marked this pull request as ready for review April 27, 2025 14:23
@Gaurav-Kushwaha-1225
Copy link
Contributor Author

Hey @MarkisDev,
Could you please take a moment to review this PR regarding issue #254?

Let me know if any changes are needed.
Thanks you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Add home screen widgets to the app
2 participants