You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Android widget picker shows the app icon instead of a preview for Subscription usage #15158
bugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triagevouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
Mobile
Steps to reproduce
Install T3 Code on Android 12 or later.
Long-press the home screen, open Widgets, and find T3 Code.
Expand the Subscription usage entry.
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-widgets generates the <appwidget-provider> XML with no previewImage or previewLayout, so the launcher falls back to the icon.
Impact
Cosmetic. Users can't tell what the widget shows before adding it.
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 uses previewImage. With neither set, the launcher draws the app icon across the widget's cell span. The 4×3 span comes from targetCellWidth / targetCellHeight on the Subscription usage widget in apps/mobile/app.config.ts.
expo-widgets 58.0.11 (the version in apps/mobile/package.json) writes res/xml/subscription_usage_info.xml from createWidgetInfoXml. That element sets minWidth, minHeight, the target cells, updatePeriodMillis, initialLayout, description, resizeMode, and widgetCategory, but not previewLayout or previewImage, and WidgetConfig.android has no fields for them. ExpoWidgetsPeekWidget only overrides sizeMode and provideRoot, so there's no Android 15 generated preview either.
android:initialLayout is always @layout/expo_widgets_initial_layout, a centered "Loading widget" label shown as the first frame after placement. The initialLayout path 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 onto previewLayout.
This gap is Android-only: Agent Activity isn't an Android widget (android: null), and the iOS gallery uses the SwiftUI layout. Since minSdkVersion is 24, previewLayout alone 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 in SubscriptionUsage.android.tsx. Because expo-widgets rewrites 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 above widgetsPlugin in app.config.ts already relies on.
Generated previews: render the real widget with sample props, but the hook (providePreview on the Glance widget) lives inside expo-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 previewLayout prototype; it'll be useful once a direction is chosen.
bugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triagevouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Activity
juliusmarminge commentedon Oct 3, 2026
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.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.juliusmarminge commentedon Nov 19, 2026
This is how it is meant to work: .
Closing as not planned.