# indraamani/zenlauncher architecture

> Architecture diagram of the GitHub repository indraamani/zenlauncher, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/indraamani/zenlauncher
- Repository: https://github.com/indraamani/zenlauncher

## Overview

#### 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: [`app/src/main/java/launcher/focux/ui/screen/SearchScreen.kt`](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/screen/SearchScreen.kt) (Launcher feature screens), [`app/src/main/java/launcher/focux/ui/screen/SettingScreen.kt`](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/screen/SettingScreen.kt) (Settings screen), [`app/src/main/java/launcher/focux/MainActivity.kt`](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/MainActivity.kt) (Main activity), [`app/src/main/java/launcher/focux/viewmodel/MainViewmodel.kt`](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/viewmodel/MainViewmodel.kt) (Main view model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android integration"]
  node_gradle["Android module build<br/>Gradle module<br/>[build.gradle.kts]"]
  node_manifest["Launcher manifest<br/>Android component declaration"]
  node_android_os{{"Android system<br/>platform boundary"}}
end

subgraph group_ui["Launcher UI"]
  node_main_activity["Main activity<br/>[MainActivity.kt]"]
  node_drawer_activity["Drawer activity<br/>[DrawerActivity.kt]"]
  node_setting_activity["Settings activity<br/>[SettingActivity.kt]"]
  node_launcher_screens["Launcher feature screens<br/>Compose screens<br/>[SearchScreen.kt]"]
  node_folder_component["Folder management<br/>UI component<br/>[Folder.kt]"]
end

subgraph group_state["Presentation state"]
  node_main_vm["Main view model<br/>[MainViewmodel.kt]"]
  node_drawer_vm["Drawer view model<br/>[DrawerViewmodel.kt]"]
  node_setting_vm["Settings view model"]
end

subgraph group_data["App data and customization"]
  node_application_repo[("Installed app repository<br/>app discovery repository<br/>[ApplicationRepo.kt]")]
  node_package_utils["Package utilities<br/>package model utilities<br/>[Packages.kt]"]
  node_customization_repos[("Customization repositories<br/>persistent user state<br/>[PreferenceRepo.kt]")]
end

subgraph group_settings["Settings and visual system"]
  node_settings_screen["Settings screen<br/>Compose screen<br/>[SettingScreen.kt]"]
  node_settings_navigation["Settings navigation<br/>navigation catalog"]
  node_theme["Theme system<br/>visual system<br/>[Theme.kt]"]
end

node_gradle -->|"builds"| node_manifest
node_manifest -->|"declares launcher entry"| node_main_activity
node_android_os -->|"launches"| node_main_activity
node_main_activity -->|"hosts"| node_launcher_screens
node_main_activity -->|"binds state"| node_main_vm
node_drawer_activity -->|"binds state"| node_drawer_vm
node_setting_activity -->|"hosts"| node_settings_screen
node_launcher_screens -->|"uses"| node_folder_component
node_launcher_screens -->|"sends actions / observes state"| node_main_vm
node_main_vm -->|"reads apps"| node_application_repo
node_main_vm -->|"updates customization"| node_customization_repos
node_drawer_vm -->|"reads apps"| node_application_repo
node_application_repo -->|"uses"| node_package_utils
node_application_repo -->|"queries packages"| node_android_os
node_settings_screen -->|"sends actions / observes state"| node_setting_vm
node_settings_screen -->|"routes through"| node_settings_navigation
node_setting_vm -->|"reads and writes"| node_customization_repos
node_settings_screen -->|"configures"| node_theme
node_theme -->|"styles"| node_launcher_screens
node_customization_repos -.->|"restores display choices"| node_launcher_screens

click node_gradle "https://github.com/indraamani/zenlauncher/blob/main/app/build.gradle.kts"
click node_manifest "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/AndroidManifest.xml"
click node_main_activity "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/MainActivity.kt"
click node_drawer_activity "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/activity/DrawerActivity.kt"
click node_setting_activity "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/activity/SettingActivity.kt"
click node_launcher_screens "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/screen/SearchScreen.kt"
click node_folder_component "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/component/Folder.kt"
click node_main_vm "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/viewmodel/MainViewmodel.kt"
click node_drawer_vm "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/viewmodel/DrawerViewmodel.kt"
click node_setting_vm "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/viewmodel/SettingViewmodel.kt"
click node_application_repo "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/datastore/app/ApplicationRepo.kt"
click node_package_utils "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/utils/Packages.kt"
click node_customization_repos "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/datastore/userpreference/PreferenceRepo.kt"
click node_settings_screen "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/screen/SettingScreen.kt"
click node_settings_navigation "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/navigation/setting/SettingNavigation.kt"
click node_theme "https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/theme/Theme.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gradle,node_manifest,node_android_os toneBlue
class node_main_activity,node_drawer_activity,node_setting_activity,node_launcher_screens,node_folder_component toneAmber
class node_main_vm,node_drawer_vm,node_setting_vm toneMint
class node_application_repo,node_package_utils,node_customization_repos toneRose
class node_settings_screen,node_settings_navigation,node_theme toneIndigo
```

## Components

### Android integration

- [Android module build](https://github.com/indraamani/zenlauncher/blob/main/app/build.gradle.kts): Gradle module · `app/build.gradle.kts`
- [Launcher manifest](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/AndroidManifest.xml): Android component declaration · Declares launcher integration and application components. · `app/src/main/AndroidManifest.xml`
- **Android system**: platform boundary · Supplies launcher intents and package management.

### Launcher UI

- [Main activity](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/MainActivity.kt): activity · Primary launcher process and UI entry point. · `app/src/main/java/launcher/focux/MainActivity.kt`
- [Drawer activity](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/activity/DrawerActivity.kt): activity · `app/src/main/java/launcher/focux/activity/DrawerActivity.kt`
- [Settings activity](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/activity/SettingActivity.kt): activity · `app/src/main/java/launcher/focux/activity/SettingActivity.kt`
- [Launcher feature screens](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/screen/SearchScreen.kt): Compose screens · Search and app-management surfaces render launcher interactions. · `app/src/main/java/launcher/focux/ui/screen/SearchScreen.kt`
- [Folder management](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/component/Folder.kt): UI component · Folder, popup, and sheet interactions organize apps. · `app/src/main/java/launcher/focux/ui/component/Folder.kt`

### Presentation state

- [Main view model](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/viewmodel/MainViewmodel.kt): view model · Owns primary launcher state and actions. · `app/src/main/java/launcher/focux/viewmodel/MainViewmodel.kt`
- [Drawer view model](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/viewmodel/DrawerViewmodel.kt): view model · `app/src/main/java/launcher/focux/viewmodel/DrawerViewmodel.kt`
- [Settings view model](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/viewmodel/SettingViewmodel.kt): view model · Owns preference-oriented settings state. · `app/src/main/java/launcher/focux/viewmodel/SettingViewmodel.kt`

### App data and customization

- [Installed app repository](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/datastore/app/ApplicationRepo.kt): app discovery repository · Enumerates and represents installed launchable apps. · `app/src/main/java/launcher/focux/datastore/app/ApplicationRepo.kt`
- [Package utilities](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/utils/Packages.kt): package model utilities · Supports package records, launch, ordering, and recents. · `app/src/main/java/launcher/focux/utils/Packages.kt`
- [Customization repositories](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/datastore/userpreference/PreferenceRepo.kt): persistent user state · Persists preferences plus locked and pinned app state. · `app/src/main/java/launcher/focux/datastore/userpreference/PreferenceRepo.kt`

### Settings and visual system

- [Settings screen](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/screen/SettingScreen.kt): Compose screen · `app/src/main/java/launcher/focux/ui/screen/SettingScreen.kt`
- [Settings navigation](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/navigation/setting/SettingNavigation.kt): navigation catalog · Routes settings screens through an explicit screen catalog. · `app/src/main/java/launcher/focux/navigation/setting/SettingNavigation.kt`
- [Theme system](https://github.com/indraamani/zenlauncher/blob/main/app/src/main/java/launcher/focux/ui/theme/Theme.kt): visual system · Provides app-wide colors, typography, and theme selection. · `app/src/main/java/launcher/focux/ui/theme/Theme.kt`

## Connections

- 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
