feat(android): add widget instance configuration#218
Open
V3RON wants to merge 6 commits into
Open
Conversation
Add per-instance Android widget configuration support, generated configuration trampolines, and example app wiring for configurable widgets.
Adds Android Dynamic Widget configuration schema validation for deep-link setup.
Rejects malformed configuration values before deepLink validation.
Adds bare React Native CLI config parity for Dynamic Widget configuration deep links.
…t-instance-config # Conflicts: # packages/cli/src/config/normalize.ts # packages/cli/src/config/types.ts # packages/cli/src/index.ts # packages/cli/test/cli.test.js
Resolve project-relative Dynamic Widget client source paths during Android placeholder prerendering and defer file-generation detection until Expo provides projectRoot.
Contributor
|
@V3RON :
When the user opens the app and requests a refresh for all widgets (for example, by clicking a button), both widgets should receive the new weather data and automatically update, displaying the latest information for their respective cities, just like system weather apps like Samsung Weather. Is this possible with the current code? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is this?
This PR adds per-instance configuration support for Android Dynamic Widgets. Apps can now route users into a widget-specific configuration flow, save values for a single placed widget, and keep type-level configuration as a fallback for existing behavior.
How does it work?
Dynamic Android widgets can declare configuration metadata, including a deep link used by the generated Android configuration trampoline. The plugin and CLI validate that this configuration is only used with Dynamic Widgets, generate the Android widget XML and manifest wiring, and add example app wiring for editing a specific widget instance.
At runtime, Android widget configuration is stored in layers: instance values override widget-type values, which override code defaults. The Android client exposes instance-aware configuration APIs and surfaces active widget instance ids so app screens can save values for the correct placed widget.
Why is this useful?
This lets multiple instances of the same Android Dynamic Widget show different user-selected data, such as different accounts, cities, lists, or filters. It also keeps older type-level configuration working while giving Dynamic Widgets a path toward Android-native placement and reconfiguration flows.