Testing and Previews (Android)
Voltra provides multiple ways to preview your Android widgets:
- In-App Previews - Preview layouts within your development app using
VoltraWidgetPreview - Widget Picker Previews - Customize what users see in the Android widget picker when adding your widget
This page covers in-app previews for development. For widget picker previews, see Plugin Configuration - Widget Picker Previews.
VoltraWidgetPreview
The VoltraWidgetPreview component renders Voltra Android JSX content at the exact dimensions of standard Android widget sizes.
Usage
Supported Families
Android widgets use responsive sizing. Voltra provides several standard families based on typical grid dimensions:
VoltraView (Android)
If you need more control or want to test custom dimensions, you can use the low-level VoltraView component.
Accuracy
The Android preview components use the actual native Glance renderers under the hood. When you provide JSX to VoltraWidgetPreview, it is converted to a native RemoteViews object and rendered using the same logic that Android uses on the home screen.
This ensures that:
- Layout constraints are respected.
- Styling (colors, fonts, spacing) is accurate.
- Component mapping is identical to the production widget.
While layout and styling are accurate, some home-screen specific behaviors (like actual widget resizing by the user) are not simulated by the preview component.
