Repository navigation
[Bug]: Android widget picker shows the app icon instead of a preview for Subscription usage #15158
Description
Activity
Note
Grok responding on behalf of Julius.
Triage
Thanks @tris203 for the screenshot and for tracing this to the provider XML. I confirmed it on current
main(18b21325): the Subscription usage entry shows the app icon on a 4×3 tile because the picker has no widget preview. This is separate from the open PR #15142, which is about the placed widget staying on "Loading widget".What happens
On Android 12+ the widget picker uses
previewLayout, and on older versions it usespreviewImage. With neither set, the launcher draws the app icon across the widget's cell span. The 4×3 span comes fromtargetCellWidth/targetCellHeighton the Subscription usage widget inapps/mobile/app.config.ts.expo-widgets58.0.11 (the version inapps/mobile/package.json) writesres/xml/subscription_usage_info.xmlfromcreateWidgetInfoXml. That element setsminWidth,minHeight, the target cells,updatePeriodMillis,initialLayout,description,resizeMode, andwidgetCategory, but notpreviewLayoutorpreviewImage, andWidgetConfig.androidhas no fields for them.ExpoWidgetsPeekWidgetonly overridessizeModeandprovideRoot, so there's no Android 15 generated preview either.android:initialLayoutis always@layout/expo_widgets_initial_layout, a centered "Loading widget" label shown as the first frame after placement. TheinitialLayoutpath in the app config (./src/widgets/SubscriptionUsage.android.tsx) is the JS layout the registry embeds so the real card can render before the app runs; it isn't copied ontopreviewLayout.This gap is Android-only: Agent Activity isn't an Android widget (
android: null), and the iOS gallery uses the SwiftUI layout. SinceminSdkVersionis 24,previewLayoutalone would still leave Android 7–11 showing the icon.Likely fix area
The three options in the report trade off differently:
previewImage: one static PNG that also covers pre-Android 12 launchers and needs no Glance changes, but it won't follow light/dark or Material You and softens at other cell sizes.previewLayout: a hand-written RemoteViews layout that scales and can be themed on Android 12+ (and serves as the fallback on 15+), but it's a separate copy of the look inSubscriptionUsage.android.tsx. Becauseexpo-widgetsrewrites the provider XML on every prebuild, a local config plugin would need to add the attribute after that write. Same-type mods run last-registered first, which is the ordering the comment abovewidgetsPlugininapp.config.tsalready relies on.- Generated previews: render the real widget with sample props, but the hook (
providePreviewon the Glance widget) lives insideexpo-widgets, it's Android 15+ only, and it still needs one of the above for older launchers.
A maintainer will decide on the fix direction. Thanks for offering your
previewLayoutprototype; it'll be useful once a direction is chosen.- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
on Oct 3, 2026
Before submitting
Area
Mobile
Steps to reproduce
Expected behavior
The picker shows what the widget looks like.
Actual behavior
The picker shows the app icon centred on a blank 4×3 tile.
expo-widgetsgenerates the<appwidget-provider>XML with nopreviewImageorpreviewLayout, so the launcher falls back to the icon.Impact
Cosmetic. Users can't tell what the widget shows before adding it.
Version or commit
main at 18b2132
Environment
Pixel emulator, Android 16,
expo-widgets58.0.11.Options
previewImage(a PNG)previewLayout(static XML)expo-widgets(it builds on Glance but doesn't implement the preview hook)I have a working
previewLayoutprototype and can open a PR if that direction is wanted.Screenshots, recordings, or supporting files
Widget picker today: