How indraamani/zenlauncher works
Purpose and Runtime
Focux is a single-module Android launcher: a text-oriented, icon-minimal home experience with gesture-driven interaction, themes, widgets, search, and app organization. It runs as a native Kotlin Android application built with Gradle. The Android component declaration and launcher integration boundary are in app/src/main/AndroidManifest.xml; module dependencies/build behavior are in app/build.gradle.kts.
Application Entry and Activity Shells
MainActivity is the primary process/UI entry point and coordinates the launcher’s main surface. DrawerActivity provides a secondary drawer-oriented interaction surface, while SettingActivity hosts settings navigation.
• app/src/main/java/launcher/focux/MainActivity.kt
• app/src/main/java/launcher/focux/activity/DrawerActivity.kt
• app/src/main/java/launcher/focux/activity/SettingActivity.kt
UI Composition and Launcher Features
The UI is organized as Compose-style screens and reusable components. Main feature surfaces cover search, hidden/locked/pinned/renamed apps, settings, fonts, and configurable top/bottom widgets. Folder, popup, and bottom-sheet components implement app-management interactions rather than separate domain services.
• app/src/main/java/launcher/focux/ui/screen/SearchScreen.kt
• app/src/main/java/launcher/focux/ui/screen/SettingScreen.kt
• app/src/main/java/launcher/focux/ui/component/Folder.kt
State and Presentation Control
View models separate activity/screen rendering from launcher state and user actions. MainViewmodel governs primary launcher state; DrawerViewmodel supports drawer behavior; SettingViewmodel owns preference-oriented settings state. UI events flow into these models, which read/update repositories and expose state back to the screens.
• app/src/main/java/launcher/focux/viewmodel/MainViewmodel.kt
• app/src/main/java/launcher/focux/viewmodel/DrawerViewmodel.kt
• app/src/main/java/launcher/focux/viewmodel/SettingViewmodel.kt
Installed-App Discovery and Core Models
The launcher must cross the Android package-management boundary to enumerate and launch installed applications. Application records and package utilities form the internal representation used by display, search, ordering, and app-management features; recent-app logic is isolated alongside them.
• app/src/main/java/launcher/focux/datastore/app/ApplicationRepo.kt
• app/src/main/java/launcher/focux/datastore/app/InstalledPackage.kt
• app/src/main/java/launcher/focux/utils/Packages.kt
Persistent User Customization
Separate repository/model/serializer groups persist launcher-specific state: installed-app metadata, locked apps, pinned apps, and general preferences. This is the durability boundary between volatile view-model state and on-device user configuration, including choices such as widget/font/theme behavior and app visibility/organization.
• app/src/main/java/launcher/focux/datastore/userpreference/PreferenceRepo.kt
• app/src/main/java/launcher/focux/datastore/lockedapp/LockedAppRepo.kt
• app/src/main/java/launcher/focux/datastore/pinnedapp/PinnedAppRepo.kt
Settings Routing and Visual System
Settings uses an explicit screen catalog and navigation layer, allowing feature screens to remain independently composable. The theme package supplies app-wide color, typography, and theme selection; bundled font assets support the launcher’s text-first presentation.
• app/src/main/java/launcher/focux/navigation/setting/SettingNavigation.kt
• app/src/main/java/launcher/focux/navigation/setting/Screens.kt
• app/src/main/java/launcher/focux/ui/theme/Theme.kt
Main entry points: SearchScreen.kt Launcher feature screens · SettingScreen.kt Settings screen · MainActivity.kt Main activity · MainViewmodel.kt Main view model
Components 17
Android integration
- Android module build
app/build.gradle.kts - Launcher manifest · Declares launcher integration and application components.
app/src/main/AndroidManifest.xml - Android system · Supplies launcher intents and package management.
Launcher UI
- Main activity · Primary launcher process and UI entry point.
app/src/main/java/launcher/focux/MainActivity.kt - Drawer activity
app/src/main/java/launcher/focux/activity/DrawerActivity.kt - Settings activity
app/src/main/java/launcher/focux/activity/SettingActivity.kt - Launcher feature screens · Search and app-management surfaces render launcher interactions.
app/src/main/java/launcher/focux/ui/screen/SearchScreen.kt - Folder management · Folder, popup, and sheet interactions organize apps.
app/src/main/java/launcher/focux/ui/component/Folder.kt
Presentation state
- Main view model · Owns primary launcher state and actions.
app/src/main/java/launcher/focux/viewmodel/MainViewmodel.kt - Drawer view model
app/src/main/java/launcher/focux/viewmodel/DrawerViewmodel.kt - Settings view model · Owns preference-oriented settings state.
app/src/main/java/launcher/focux/viewmodel/SettingViewmodel.kt
App data and customization
- Installed app repository · Enumerates and represents installed launchable apps.
app/src/main/java/launcher/focux/datastore/app/ApplicationRepo.kt - Package utilities · Supports package records, launch, ordering, and recents.
app/src/main/java/launcher/focux/utils/Packages.kt - Customization repositories · Persists preferences plus locked and pinned app state.
app/src/main/java/launcher/focux/datastore/userpreference/PreferenceRepo.kt
Settings and visual system
- Settings screen
app/src/main/java/launcher/focux/ui/screen/SettingScreen.kt - Settings navigation · Routes settings screens through an explicit screen catalog.
app/src/main/java/launcher/focux/navigation/setting/SettingNavigation.kt - Theme system · Provides app-wide colors, typography, and theme selection.
app/src/main/java/launcher/focux/ui/theme/Theme.kt
Connections 20
- Android module build → Launcher manifest: builds
- Launcher manifest → Main activity: declares launcher entry
- Android system → Main activity: launches
- Main activity → Launcher feature screens: hosts
- Main activity → Main view model: binds state
- Drawer activity → Drawer view model: binds state
- Settings activity → Settings screen: hosts
- Launcher feature screens → Folder management: uses
- Launcher feature screens → Main view model: sends actions / observes state
- Main view model → Installed app repository: reads apps
- Main view model → Customization repositories: updates customization
- Drawer view model → Installed app repository: reads apps
- Installed app repository → Package utilities: uses
- Installed app repository → Android system: queries packages
- Settings screen → Settings view model: sends actions / observes state
- Settings screen → Settings navigation: routes through
- Settings view model → Customization repositories: reads and writes
- Settings screen → Theme system: configures
- Theme system → Launcher feature screens: styles
- Customization repositories → Launcher feature screens: restores display choices