Rendering does not guarantee provider-intended behavior
Widget providers specify sizes and configuration behavior. On October 3, 2026, an ignored hide_from_picker declaration prompted a review of addition, configuration, movement, and resizing. We mapped 23 declaration fields in Android’s provider information, AppWidgetProviderInfo at compileSdk 37, into responsibilities handled by Android and by the launcher.
Using external components means respecting permitted interactions as well as rendering them. The table summarizes the main handling.
| Provider specification | Launcher behavior |
|---|---|
| Hidden from picker | Exclude from lists and search on API 28+. Treat existing display and pinning separately. |
| Reconfigurable | Allow on API 28+ only with a configuration screen and the required declaration. |
| Optional initial configuration | Use the declaration on API 31+. |
| Resize axes and minimum/maximum dimensions | Calculate from actual cells and recheck before saving. |
| Initial cell dimensions | Use positive values independently for each axis on API 31+. |
| Automatic content advancement | Advance only while the widget is visible and the screen is interactive. |
Do not rely only on the preview
Calculate initial size from the actual placement area and padding rather than a fixed cell dimension. Round minimum dimensions up and maximum dimensions down, and leave non-resizable axes unchanged.
Recheck the current area, overlap, and size restrictions immediately before saving because conditions can change during interaction. Do not shrink automatically when space is insufficient, and report measured sizes to the provider.
Do not apply a declaration beyond its scope
Hidden from picker affects selection. It does not remove an existing widget or prohibit provider-initiated pinning. Leave update scheduling and configuration-screen resolution to Android instead of duplicating those responsibilities.
Apply the same restrictions throughout interaction
Separate decisions in lists, previews, and saving can treat the same item differently. Sharing the restrictions across operations and at save time reduces omissions.
Test components with one size or configuration declaration at a time help trace how each rule affects interaction. Inventorying specifications and separating your responsibilities from the platform’s also helps with other integrations.
No comments:
Post a Comment