Android App Widgets
Relevant source files
The following files were used as context for generating this wiki page:
Android App Widgets provide users with immediate access to Conduit's core features directly from their device home screen. These widgets allow users to initiate specific actions like starting a new chat, capturing photos, or accessing the clipboard without opening the full application first.
Sources: README.md:144-145, android/app/src/main/res/values/strings.xml:7-8
Widget Configuration and Metadata
The widget behavior and dimensions are defined in an XML provider configuration. This file specifies how the widget appears in the widget picker and how it behaves when placed on the home screen.
Technical Specifications
The widget is configured with the following properties:
- Minimum Dimensions: 250dp width and 110dp height.
- Grid Targeting: Targets a 3x2 cell area on the home screen.
- Resize Constraints: Users can resize the widget horizontally and vertically between 180dp x 110dp and 400dp x 200dp.
- Update Frequency: The update period is set to 0, indicating manual or event-driven updates rather than scheduled intervals.
- Features: The widget is marked as "reconfigurable," allowing users to adjust settings after placement.
Sources: android/app/src/main/res/xml/conduit_widget_info.xml:2-15
User Interface Elements
The widget includes localized strings for various shortcut actions.
| Action | Description | String Resource |
|---|---|---|
| Ask Conduit | Main text for starting a text-based chat | widget_ask_conduit |
| Camera | Shortcut to start a chat with a new photo | widget_camera |
| Photos | Shortcut to start a chat with existing gallery images | widget_photos |
| Clipboard | Shortcut to start a chat using current clipboard content | widget_clipboard |
| Voice | Shortcut to initiate a voice-based interaction | widget_mic |
Sources: android/app/src/main/res/values/strings.xml:9-14
Visual Design and Theming
The widget utilizes a Material 3 design system with adaptive color palettes that respond to system light and dark mode settings. It supports dynamic colors on Android 12+ while providing hardcoded fallback values for older versions.
Color Architecture Diagram
This diagram shows the relationship between system accent colors and widget components.
The widget components map to specific Material 3 tokens to ensure visual consistency with the Android OS.
Sources: android/app/src/main/res/values/colors.xml:4-18, android/app/src/main/res/values-night/colors.xml:4-22
Theme Fallbacks
For devices running versions prior to Android 12, the system defines specific hex codes to maintain the brand aesthetic.
- Light Fallback: Uses
#6750A4for primary actions and#FFFBFEfor surfaces. - Dark Fallback: Uses
#D0BCFFfor primary actions and#1C1B1Ffor surfaces.
Sources: android/app/src/main/res/values/colors.xml:20-27, android/app/src/main/res/values-night/colors.xml:24-31
Platform Integration
The widget system is integrated into the broader Flutter application via a dedicated HomeWidgetService. This service handles the communication between the native Android RemoteViews and the Flutter business logic.
Dependency Flow
The application maintains a strict UI allowlist to manage platform-specific UI components during its migration to a unified platform UI seam.
The HomeWidgetService is explicitly listed as a platform-integration component in the project's internal allowlist.
Sources: tool/platform_ui_allowlist.yaml:496-498
Summary
Android App Widgets in Conduit provide a high-performance entry point for mobile interactions. By utilizing native Android components and Material 3 theming, the widgets offer a seamless experience that integrates with system-level features like dark mode and dynamic colors. The architecture relies on a bridge between native XML configurations and a dedicated Flutter integration service to ensure that home screen actions correctly trigger application logic.
Sources: README.md:144-145, android/app/src/main/res/xml/conduit_widget_info.xml:13