Settings App & Compose UI
Relevant source files
The following files were used as context for generating this wiki page:
- app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/HomeScreen.kt
- app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/about/AboutScreen.kt
- app/src/main/kotlin/dev/patrickgold/florisboard/app/ext/ExtensionEditScreen.kt
- app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/voxtral/VoxtralScreen.kt
- lib/compose/src/main/kotlin/org/florisboard/lib/compose/FlorisScreen.kt
The Settings App in Ownkey Keyboard provides a comprehensive user interface for configuring the Input Method Editor (IME), managing extensions, and setting up AI-powered features such as dictation and text rewrite. Built using Jetpack Compose, the UI follows a modular architecture where screens are constructed using standardized components to ensure consistency across the application.
The UI framework is designed to handle complex configuration tasks, including secure API key management for Mistral/Voxtral services, extension metadata editing, and system-level integration checks (e.g., verifying if the keyboard is enabled in Android settings).
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/HomeScreen.kt, README.md:14-18, AGENTS.md:20-25
UI Architecture and Components
The Settings App utilizes a custom wrapper around standard Compose components to provide a unified "Floris" look and feel. The primary structural unit is the FlorisScreen, which handles standard layout elements like titles, navigation icons, and content scrolling.
FlorisScreen Framework
FlorisScreen serves as the base composable for almost all settings screens. It provides properties to toggle the visibility of the navigation icon and a "preview field" (used to test keyboard settings directly within the app).
Key Navigation Nodes
The HomeScreen acts as the central hub for the settings application, routing users to specific sub-modules via a navigation controller.
| Icon | Category | Route Destination | Description |
|---|---|---|---|
Language | Localization | Routes.Settings.Localization | Configure languages, layouts, and subtypes. |
Palette | Theme | Routes.Settings.Theme | Select and edit visual keyboard themes. |
Keyboard | Keyboard | Routes.Settings.Keyboard | Adjust key spacing, long press delays, and row layouts. |
KeyboardVoice | AI (Voxtral) | Routes.Settings.Voxtral | Configure dictation and LLM rewrite providers. |
Info | About | Routes.Settings.About | Version info, changelog, and project licenses. |
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/HomeScreen.kt:97-147
AI Configuration (Voxtral Screen)
The AI settings screen is a critical component of Ownkey Keyboard, enabling the "Bring Your Own Key" (BYOK) model for AI services. It manages authentication and connection parameters for Mistral-compatible transcription and LLM endpoints.
Secure Key Management
API keys for dictation and rewrite services are handled with security in mind. The UI provides states for when a key is "set" versus "missing" and ensures that once a key is saved, it is stored encrypted and hidden from view.
Voxtral Configuration Parameters
| Parameter | Type | Default Value | Description |
|---|---|---|---|
| Endpoint URL | Text | Mistral API | Destination for transcription requests. |
| Model | Text | voxtral-mini-latest | The specific model used for ASR/Dictation. |
| Language Hint | Text | (Empty/Auto) | Optional ISO code (e.g., "en") to improve recognition. |
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/voxtral/VoxtralScreen.kt:100-130, README.md:40-42
Extension Management System
The app includes a sophisticated extension editor (ExtensionEditScreen) that allows users to create, modify, and export theme or keyboard extensions. This system uses a "Workspace" concept to manage temporary files and unsaved changes.
Extension Editor Workflow
The editor handles the lifecycle of an extension from unzipping the source archive to building the final manifest and re-zipping the package.
- Workspace Initialization: A
getOrCreateWorkspacecall unzips the extension into a cache directory. - Metadata Editing: Users can modify properties like
id,version,maintainers, andlicense. - Component Management: Specific to theme extensions, users can add or edit theme components and fine-tune stylesheets.
- Save/Export: The editor builds a new manifest, copies relevant files (fonts, images), and zips them into a
.flex(or similar) archive.
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/ext/ExtensionEditScreen.kt:96-125, app/src/main/kotlin/dev/patrickgold/florisboard/app/ext/ExtensionEditScreen.kt:208-258
Validation Logic
The UI implements strict validation for extension metadata to prevent corrupted packages.
Integration and Health Checks
The HomeScreen monitors the operational status of the keyboard within the Android system. If Ownkey Keyboard is not enabled in the system's "Languages & Input" or is not selected as the active IME, the UI displays actionable cards.
- FlorisErrorCard: Displayed if the IME is not enabled. Clicking it launches the system IME enabler activity.
- FlorisWarningCard: Displayed if the IME is enabled but not selected. Clicking it opens the Android input picker.
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/settings/HomeScreen.kt:53-68
Summary
The Settings App & Compose UI layer provides the bridge between complex underlying logic (like AI transcription and extension building) and the user. By utilizing standardized composables like FlorisScreen and a secure preference management system, the app ensures that sensitive data like API keys are protected while offering deep customization options for the keyboard's behavior and appearance. Significant focus is placed on system integration health, ensuring users can easily navigate Android's strict keyboard security requirements.