# yunnijian/flymefreeform architecture

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

- Interactive diagram: https://gitdiagram.com/yunnijian/flymefreeform
- Repository: https://github.com/yunnijian/flymefreeform

## Overview

FlymeFreeform is an Android Xposed module that adds Flyme-style corner gestures and freeform-window shortcuts to ColorOS. The main flow is: System UI recognizes a configured corner swipe, the gesture coordinator presents a radial app chooser, and the chosen app opens using the platform’s existing freeform capability; “More” hands off to ColorOS’s all-apps sidebar panel. The app also configures settings, pinned apps, outside-tap close, and mini-window swipe behavior. Some subsystem links are documented in the README; unsampled implementations are represented only where their existence or relationship is supported by the index or README.

Main entry points: [`app/src/main/kotlin/io/github/mangi/flymefreeform/hook/SystemUiCornerInputMonitor.kt`](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/SystemUiCornerInputMonitor.kt) (Corner input monitor), [`app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformGestureCoordinator.kt`](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformGestureCoordinator.kt) (Gesture coordinator), [`app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModuleSettingsSnapshot.kt`](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModuleSettingsSnapshot.kt) (Settings snapshot), [`app/src/main/kotlin/io/github/mangi/flymefreeform/window/CornerRadialOverlayView.kt`](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/window/CornerRadialOverlayView.kt) (Radial overlay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_settings["Settings and configuration"]
  node_main["App entry<br/>[MainActivity.kt]"]
  node_screens["Control and pins UI<br/>[ControlScreen.kt]"]
  node_connection["Framework connection"]
  node_settingsdata["Settings snapshot"]
  node_preferences["Preference protocol"]
  node_outside_mode["Outside-tap mode"]
end

subgraph group_runtime["Gesture runtime"]
  node_coordinator["Gesture coordinator"]
  node_cornerengine["Corner gesture engine"]
  node_environment["Runtime environment"]
  node_configuration["Hook configuration"]
  node_inputmonitor["Corner input monitor"]
  node_outsidehook["Outside-tap hook"]
  node_outsidengine["Outside-tap classifier"]
  node_mini["Mini-window swipe hook"]
end

subgraph group_overlay["Overlay and app choice"]
  node_catalog["App catalog<br/>[AppCatalog.kt]"]
  node_apprepo["Launcher app repository"]
  node_radial["Radial overlay"]
end

subgraph group_platform["Platform integration"]
  node_platformroute["Platform routing<br/>[PlatformRouting.kt]"]
  node_coloros["ColorOS platform<br/>[ColorOsPlatform.kt]"]
  node_hyperos["HyperOS platform<br/>[HyperOsPlatform.kt]"]
  node_launcher["Freeform launcher"]
  node_sidebarclient["Sidebar client"]
  node_panelsession["More-panel session"]
end

node_user(("Device user"))
node_systemui["Android System UI"]
node_os["Android freeform system"]
node_sidebar["ColorOS sidebar"]

node_user -->|"configures"| node_screens
node_main -->|"hosts"| node_screens
node_screens -->|"updates settings"| node_connection
node_connection -->|"reads and writes"| node_settingsdata
node_settingsdata -->|"uses keys"| node_preferences
node_settingsdata -->|"decodes mode"| node_outside_mode
node_systemui -.->|"delivers touch"| node_inputmonitor
node_inputmonitor -->|"interprets gesture"| node_cornerengine
node_inputmonitor -->|"reads settings"| node_configuration
node_inputmonitor -->|"checks conditions"| node_environment
node_coordinator -->|"processes gesture"| node_cornerengine
node_coordinator -->|"shows overlay"| node_radial
node_coordinator -->|"loads app choices"| node_catalog
node_catalog -->|"queries apps"| node_apprepo
node_radial -->|"launches selection"| node_launcher
node_launcher -->|"opens freeform"| node_os
node_radial -->|"hands off More"| node_sidebarclient
node_sidebarclient -->|"tracks panel"| node_panelsession
node_sidebarclient -->|"requests all-apps panel"| node_sidebar
node_platformroute -->|"selects platform"| node_coloros
node_platformroute -->|"selects platform"| node_hyperos
node_outsidehook -->|"classifies taps"| node_outsidengine
node_outsidengine -->|"uses mode"| node_outside_mode
node_user -->|"taps outside"| node_outsidehook
node_user -->|"swipes handle"| node_mini
node_user -->|"swipes corner"| node_inputmonitor

click node_main "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/MainActivity.kt"
click node_screens "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/ui/ControlScreen.kt"
click node_connection "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/framework/FrameworkConnectionRepository.kt"
click node_settingsdata "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModuleSettingsSnapshot.kt"
click node_preferences "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModulePreferences.kt"
click node_outside_mode "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/config/OutsideTapCloseMode.kt"
click node_catalog "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/AppCatalog.kt"
click node_apprepo "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/apps/LauncherAppRepository.kt"
click node_coordinator "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformGestureCoordinator.kt"
click node_cornerengine "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/gesture/CornerGestureEngine.kt"
click node_environment "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/ModuleEnvironmentState.kt"
click node_configuration "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/ProcessConfiguration.kt"
click node_inputmonitor "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/SystemUiCornerInputMonitor.kt"
click node_outsidehook "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/OutsideTapCloseHookInstaller.kt"
click node_outsidengine "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/gesture/OutsideTapGestureEngine.kt"
click node_radial "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/window/CornerRadialOverlayView.kt"
click node_platformroute "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/PlatformRouting.kt"
click node_coloros "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/coloros/ColorOsPlatform.kt"
click node_hyperos "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/hyperos/HyperOsPlatform.kt"
click node_launcher "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformLauncher.kt"
click node_sidebarclient "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/coloros/ColorOsSidebarClient.kt"
click node_panelsession "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/window/MorePanelSession.kt"
click node_mini "https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/HandleSwipeUpHookInstaller.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_main,node_screens,node_connection,node_settingsdata,node_preferences,node_outside_mode,node_user,node_systemui toneBlue
class node_coordinator,node_cornerengine,node_environment,node_configuration,node_inputmonitor,node_outsidehook,node_outsidengine,node_mini toneAmber
class node_catalog,node_apprepo,node_radial toneMint
class node_platformroute,node_coloros,node_hyperos,node_launcher,node_sidebarclient,node_panelsession toneRose
class node_os,node_sidebar toneIndigo
```

## Components

### Settings and configuration

- [App entry](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/MainActivity.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/MainActivity.kt`
- [Control and pins UI](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/ui/ControlScreen.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/ui/ControlScreen.kt`
- [Framework connection](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/framework/FrameworkConnectionRepository.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/framework/FrameworkConnectionRepository.kt`
- [Settings snapshot](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModuleSettingsSnapshot.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModuleSettingsSnapshot.kt`
- [Preference protocol](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModulePreferences.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModulePreferences.kt`
- [Outside-tap mode](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/config/OutsideTapCloseMode.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/config/OutsideTapCloseMode.kt`

### Gesture runtime

- [Gesture coordinator](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformGestureCoordinator.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformGestureCoordinator.kt`
- [Corner gesture engine](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/gesture/CornerGestureEngine.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/gesture/CornerGestureEngine.kt`
- [Runtime environment](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/ModuleEnvironmentState.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/hook/ModuleEnvironmentState.kt`
- [Hook configuration](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/ProcessConfiguration.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/hook/ProcessConfiguration.kt`
- [Corner input monitor](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/SystemUiCornerInputMonitor.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/hook/SystemUiCornerInputMonitor.kt`
- [Outside-tap hook](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/OutsideTapCloseHookInstaller.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/hook/OutsideTapCloseHookInstaller.kt`
- [Outside-tap classifier](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/gesture/OutsideTapGestureEngine.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/gesture/OutsideTapGestureEngine.kt`
- [Mini-window swipe hook](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/hook/HandleSwipeUpHookInstaller.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/hook/HandleSwipeUpHookInstaller.kt`

### Overlay and app choice

- [App catalog](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/AppCatalog.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/AppCatalog.kt`
- [Launcher app repository](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/apps/LauncherAppRepository.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/apps/LauncherAppRepository.kt`
- [Radial overlay](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/window/CornerRadialOverlayView.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/window/CornerRadialOverlayView.kt`

### Platform integration

- [Platform routing](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/PlatformRouting.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/PlatformRouting.kt`
- [ColorOS platform](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/coloros/ColorOsPlatform.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/coloros/ColorOsPlatform.kt`
- [HyperOS platform](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/hyperos/HyperOsPlatform.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/hyperos/HyperOsPlatform.kt`
- [Freeform launcher](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformLauncher.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformLauncher.kt`
- [Sidebar client](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/platform/coloros/ColorOsSidebarClient.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/coloros/ColorOsSidebarClient.kt`
- [More-panel session](https://github.com/yunnijian/flymefreeform/blob/main/app/src/main/kotlin/io/github/mangi/flymefreeform/window/MorePanelSession.kt): `app/src/main/kotlin/io/github/mangi/flymefreeform/window/MorePanelSession.kt`

### Other components

- **Device user**
- **Android System UI**
- **Android freeform system**
- **ColorOS sidebar**

## Connections

- Device user → Control and pins UI: configures
- App entry → Control and pins UI: hosts (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/MainActivity.kt`)
- Control and pins UI → Framework connection: updates settings (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/ui/ControlScreen.kt`)
- Framework connection → Settings snapshot: reads and writes (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/framework/FrameworkConnectionRepository.kt`)
- Settings snapshot → Preference protocol: uses keys (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModuleSettingsSnapshot.kt`)
- Settings snapshot → Outside-tap mode: decodes mode (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/config/ModuleSettingsSnapshot.kt`)
- Android System UI → Corner input monitor: delivers touch
- Corner input monitor → Corner gesture engine: interprets gesture (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/hook/SystemUiCornerInputMonitor.kt`)
- Corner input monitor → Hook configuration: reads settings (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/hook/SystemUiCornerInputMonitor.kt`)
- Corner input monitor → Runtime environment: checks conditions (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/hook/SystemUiCornerInputMonitor.kt`)
- Gesture coordinator → Corner gesture engine: processes gesture (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformGestureCoordinator.kt`)
- Gesture coordinator → Radial overlay: shows overlay (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformGestureCoordinator.kt`)
- Gesture coordinator → App catalog: loads app choices (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/FreeformGestureCoordinator.kt`)
- App catalog → Launcher app repository: queries apps (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/common/AppCatalog.kt`)
- Radial overlay → Freeform launcher: launches selection
- Freeform launcher → Android freeform system: opens freeform
- Radial overlay → Sidebar client: hands off More
- Sidebar client → More-panel session: tracks panel (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/coloros/ColorOsSidebarClient.kt`)
- Sidebar client → ColorOS sidebar: requests all-apps panel
- Platform routing → ColorOS platform: selects platform (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/PlatformRouting.kt`)
- Platform routing → HyperOS platform: selects platform (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/platform/PlatformRouting.kt`)
- Outside-tap hook → Outside-tap classifier: classifies taps (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/hook/OutsideTapCloseHookInstaller.kt`)
- Outside-tap classifier → Outside-tap mode: uses mode (evidence: `app/src/main/kotlin/io/github/mangi/flymefreeform/gesture/OutsideTapGestureEngine.kt`)
- Device user → Outside-tap hook: taps outside
- Device user → Mini-window swipe hook: swipes handle
- Device user → Corner input monitor: swipes corner
