Skip to content
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

feat: Add isManualUpdate flag to updateWidget #315

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

Conversation

tenhobi
Copy link
Contributor

@tenhobi tenhobi commented Nov 19, 2024

Fixes #314

Adds extra parameter so we can distinguish AppWidgetManager.EXTRA_APPWIDGET_IDS from system vs manual.

Checklist

  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation and added code (documentation) comments where necessary.
  • I have updated/added relevant examples in example or documentation.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Copy link

docs-page bot commented Nov 19, 2024

To view this pull requests documentation preview, visit the following URL:

docs.page/abausg/home_widget~315

Documentation is deployed and generated using docs.page.

@tenhobi tenhobi changed the title Add isManualUpdate flag to updateWidget feat: Add isManualUpdate flag to updateWidget Nov 19, 2024
Copy link
Owner

@ABausG ABausG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor notes.

@@ -109,6 +109,7 @@ class HomeWidgetPlugin :
AppWidgetManager.getInstance(context.applicationContext)
.getAppWidgetIds(ComponentName(context, javaClass))
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids)
intent.putExtra("isManualUpdate", true)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think manual is not really great wording here as it is not directly explaining everything

I would propose something like:
triggeredFromHomeWidget

Also it should use some constant defined on a HomeWidget scope so it can be reused also from a user's side without requiring a magic string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Fixed.

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.

Distinguish manual update vs system update of home screen widget
2 participants