From f866e8e43cb20417e5f76cbb0d3b87fe549abd20 Mon Sep 17 00:00:00 2001 From: LeanBitLab Date: Sun, 22 Nov 2026 19:51:07 +0530 Subject: [PATCH 1/4] feat(release): publish English-only lite APKs for Android 11+ The all-languages APKs stay the main download and the F-Droid reference. The lite APKs drop the UI translations, which come as language packs. --- .github/workflows/build-release-apk.yml | 21 ++++++++++++++++++--- docs/scripts/generate_release_notes.py | 14 ++++++++------ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-release-apk.yml b/.github/workflows/build-release-apk.yml index 564d3ac7f0..1faadf4793 100644 --- a/.github/workflows/build-release-apk.yml +++ b/.github/workflows/build-release-apk.yml @@ -39,7 +39,22 @@ jobs: run: chmod +x gradlew - name: Build Release APKs - run: ./gradlew assembleStandardRelease assembleOfflineRelease + run: | + ./gradlew assembleStandardRelease assembleOfflineRelease + mkdir dist + mv app/build/outputs/apk/*/release/*.apk dist/ + + # English-only APKs for Android 11+: the UI translations come as language packs + # (LeanType-Language-Packs builds them from these APKs). The all-languages APKs above + # stay the main download, and the standard one is what F-Droid compares its build with. + - name: Build English-only APKs + run: | + ./gradlew assembleStandardRelease assembleOfflineRelease -PenglishOnly + for apk in app/build/outputs/apk/*/release/*.apk; do + name=$(basename "$apk") + mv "$apk" "dist/${name%-release.apk}-lite-release.apk" + done + ls -l dist - name: Generate Release Notes # ponytail: generate release notes from changelog during build @@ -50,7 +65,7 @@ jobs: with: name: LeanType-Release-APKs path: | - app/build/outputs/apk/**/*.apk + dist/*.apk docs/releasenote/release_notes_v*.md - name: Create GitHub Release @@ -60,4 +75,4 @@ jobs: prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') || contains(github.ref_name, 'rc') }} body_path: docs/releasenote/release_notes_temp.md files: | - app/build/outputs/apk/**/release/*.apk + dist/*.apk diff --git a/docs/scripts/generate_release_notes.py b/docs/scripts/generate_release_notes.py index 0344171251..5e46eb1f10 100755 --- a/docs/scripts/generate_release_notes.py +++ b/docs/scripts/generate_release_notes.py @@ -6,17 +6,19 @@ def extract_flavor(text): """Extracts the specific flavor name from an APK filename or markdown row.""" lower = text.lower() - if 'offlinelite' in lower: - return 'offlinelite' + # English-only lite builds (*-lite-release.apk, rows mentioning "lite") get their own sizes + lite = 'lite' if 'lite' in lower else '' if 'standard' in lower: - return 'standard' + return 'standard' + lite if 'offline' in lower: - return 'offline' + return 'offline' + lite return None def get_apk_sizes(project_root): - """Scans app/build/outputs/apk for built APK files and returns a map of filename -> formatted size.""" - apk_dir = os.path.join(project_root, 'app', 'build', 'outputs', 'apk') + """Scans dist (release workflow) or app/build/outputs/apk for APK files and returns a map of filename -> formatted size.""" + apk_dir = os.path.join(project_root, 'dist') + if not os.path.isdir(apk_dir): + apk_dir = os.path.join(project_root, 'app', 'build', 'outputs', 'apk') apk_sizes = {} if not os.path.exists(apk_dir): return apk_sizes From cf03a3d48d7ed99d64961c52a291cafeb9d29061 Mon Sep 17 00:00:00 2001 From: LeanBitLab Date: Sun, 22 Nov 2026 19:51:07 +0530 Subject: [PATCH 2/4] feat(i18n): show the app translation row only when a pack is needed Hidden when the APK already has the wanted translation and no pack is installed. --- .../keyboard/latin/utils/LanguagePacks.kt | 18 ++++++++++++++++++ .../preferences/LanguagePackPreference.kt | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/helium314/keyboard/latin/utils/LanguagePacks.kt b/app/src/main/java/helium314/keyboard/latin/utils/LanguagePacks.kt index 3b331c1b37..73f8b42734 100644 --- a/app/src/main/java/helium314/keyboard/latin/utils/LanguagePacks.kt +++ b/app/src/main/java/helium314/keyboard/latin/utils/LanguagePacks.kt @@ -4,6 +4,7 @@ package helium314.keyboard.latin.utils import android.app.Activity import android.app.Application import android.content.Context +import android.content.res.Configuration import android.content.res.Resources import android.content.res.loader.ResourcesLoader import android.content.res.loader.ResourcesProvider @@ -12,6 +13,7 @@ import android.os.Build import android.os.Bundle import android.os.ParcelFileDescriptor import androidx.annotation.RequiresApi +import helium314.keyboard.latin.R import helium314.keyboard.latin.settings.Defaults import helium314.keyboard.latin.settings.Settings import java.io.File @@ -90,6 +92,22 @@ object LanguagePacks { return listOfNotNull(locale.country.takeIf { it.isNotEmpty() }?.let { "${locale.language}-r$it" }, locale.language) } + /** Whether a pack is of use: one is installed, or this build has no translation for the app language. */ + fun isNeeded(context: Context): Boolean { + if (!isSupported) return false + val wanted = wantedLocales(context) + if (wanted.isEmpty()) return false + return installedPack(context) != null || wanted.none { hasBuiltInTranslation(context, it) } + } + + /** Builds with all translations return a translated string here, English-only builds fall back to English. */ + private fun hasBuiltInTranslation(context: Context, locale: String): Boolean { + fun title(tag: String) = context.createConfigurationContext( + Configuration(context.resources.configuration).apply { setLocale(Locale.forLanguageTag(tag)) } + ).getString(R.string.language_pack_title) + return title(locale.replace("-r", "-")) != title("en") + } + fun displayName(context: Context): String { val locale = wantedLocales(context).lastOrNull()?.let { Locale(it) } ?: return "" return locale.getDisplayName(locale).replaceFirstChar { it.uppercase(locale) } diff --git a/app/src/main/java/helium314/keyboard/settings/preferences/LanguagePackPreference.kt b/app/src/main/java/helium314/keyboard/settings/preferences/LanguagePackPreference.kt index d35381dffd..0bd43b6aa2 100644 --- a/app/src/main/java/helium314/keyboard/settings/preferences/LanguagePackPreference.kt +++ b/app/src/main/java/helium314/keyboard/settings/preferences/LanguagePackPreference.kt @@ -38,7 +38,7 @@ import kotlinx.coroutines.withContext @Composable fun LanguagePackPreference() { val ctx = LocalContext.current - if (!LanguagePacks.isSupported || LanguagePacks.wantedLocales(ctx).isEmpty()) return + if (!remember { LanguagePacks.isNeeded(ctx) }) return val scope = rememberCoroutineScope() var showDialog by remember { mutableStateOf(false) } var progress by remember { mutableStateOf(null) } // null: not downloading From 47a05f98e73ff1910350f98794f0cd846144672c Mon Sep 17 00:00:00 2001 From: LeanBitLab Date: Sun, 22 Nov 2026 19:51:07 +0530 Subject: [PATCH 3/4] docs: add generated settings map and fix settings paths tools/generate_settings_map.py builds the settings map in FEATURES.md from the settings code; --check (PR CI) fails when the map or a settings path in README/FEATURES is stale. Also documents lite builds, language packs and recent features. --- .github/workflows/build-test-auto.yml | 5 + README.md | 38 +-- docs/FEATURES.md | 344 +++++++++++++++++++++----- tools/generate_settings_map.py | 323 ++++++++++++++++++++++++ 4 files changed, 638 insertions(+), 72 deletions(-) create mode 100644 tools/generate_settings_map.py diff --git a/.github/workflows/build-test-auto.yml b/.github/workflows/build-test-auto.yml index 830ab70848..3dda6f7414 100644 --- a/.github/workflows/build-test-auto.yml +++ b/.github/workflows/build-test-auto.yml @@ -26,6 +26,11 @@ jobs: # PR merge commit plus its parents, to list the files the PR changes fetch-depth: 2 + # docs/FEATURES.md holds a settings map generated from the settings code; fail fast when a + # settings change leaves it (or a "Settings โ†’ ..." path in the docs) out of date + - name: Check settings map in docs + run: python3 tools/generate_settings_map.py --check + - name: Set up JDK uses: actions/setup-java@v5 with: diff --git a/README.md b/README.md index 2a2589f5a6..673c91b2f0 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,10 @@ LeanType is available in two purpose-built flavors designed to match your exact | **Package ID** | `com.leanbitlab.leantype` | `com.leanbitlab.leantype.offline` | | **Min Android Version** | Android 6.0+ *(SDK 23)* | Android 6.0+ *(SDK 23)* | | **Approximate APK Size** | **~12.8 MB** | **~12.5 MB** | +| **Lite APK** *(English-only, Android 11+)* | `-standard-lite-release.apk` (~9 MB) | `-offline-lite-release.apk` (~9 MB) | + +> [!TIP] +> **Lite builds (Android 11+):** every release also has English-only `-lite-release.apk` APKs, about 4 MB smaller. Other app languages come as [language packs](https://github.com/LeanBitLab/LeanType-Language-Packs): **Settings โ†’ Languages & Layouts โ†’ App translation** downloads one (Standard) or imports a pack file (Offline). The regular APKs and the F-Droid build keep all languages built in. > [!TIP] > **APK Installation Notice**: Google Play Protect or your browser may block direct APK installations downloaded from web browsers. If you experience installation issues, install via [Obtainium](https://apps.obtainium.imranr.dev/redirect.html?r=obtainium://add/https://github.com/LeanBitLab/LeanType) or a package manager like [App Manager](https://github.com/MuntashirAkon/AppManager). @@ -111,11 +115,12 @@ LeanType is available in two purpose-built flavors designed to match your exact - **๐ŸชŸ Native IME Floating Window**: Seamless native IME window architecture with zero sensitive permissions (no `SYSTEM_ALERT_WINDOW`), pass-through background touches, bottom control bar (close, center-drag pill, resize drag handle), multi-touch tracking, zero dead space, and persistent mode memory. - **๐ŸชŸ Auto Floating Keyboard in Landscape**: Automatically switches to a compact moveable floating window when entering landscape orientation and restores full docked width in portrait. - **๐Ÿ–ผ๏ธ Live System Wallpaper & FastBlurEngine**: Dynamic blurred home/lock screen wallpaper background beneath keys with adjustable blur intensity slider and adaptive contrast. -- **โš™๏ธ Per-App Profiles & Compatibility Engine**: Tailor keyboard behavior per application (**Settings โ†’ Plugins & Capabilities โ†’ App Profiles**): enable web editor compatibility, automatic incognito, force non-incognito, direct commit mode, symbol composing (preserving underscores `_` in Tasker variables), dialer search field compatibility (`TYPE_NULL`), and custom Enter action overrides. +- **โš™๏ธ Per-App Profiles & Compatibility Engine**: Tailor keyboard behavior per application (**Settings โ†’ Advanced โ†’ App Profiles**): enable web editor compatibility, automatic incognito, force non-incognito, direct commit mode, symbol composing (preserving underscores `_` in Tasker variables), dialer search field compatibility (`TYPE_NULL`), and custom Enter action overrides. - **โŒจ๏ธ First-Class Hardware Keyboard Support**: Full predictive text, auto-correction, candidate selection shortcuts (`1`, `2`, `3`), and D-PAD navigation in emoji palettes for external Bluetooth/USB keyboards, with smart toolbar elevation above the navigation bar. - **๐ŸŽจ Advanced Appearance & Key Ergonomics**: Independent corner radius sliders for Normal Keys, Functional Keys (Shift/Backspace), and Action Keys (Enter/Space), adjustable key gaps, customizable padding scales, and distinct Shift/Caps visual state indicators (outline, filled, underlined). - **โŒจ๏ธ Dual Toolbar / Split Suggestions**: Option to split suggestions from the quick-action toolbar. - **๐ŸŽจ Custom Layout Profiles**: Save up to 5 custom layout profiles with persistent slot index tracking. +- **๐Ÿ”ค Font Styles & Unicode Symbols**: A Font Style toolbar key opens a strip of Unicode text styles with live preview while typing, and a Unicode symbol panel sorted by topic (keycodes `FONT_STYLE`, `UNICODE_PANEL`). - **โŒจ๏ธ Direct Switch Target IME & Custom Keycodes**: Bind keycode `-10076` to any toolbar key to switch directly to a specific target keyboard (e.g. Japanese, Korean, or Chinese IME). See the [Comprehensive Keycodes & Actions Reference](docs/FEATURES.md#30-comprehensive-keycodes--actions-reference) for the full keycodes catalog. ### ๐Ÿ“‹ Clipboard & Productivity @@ -124,7 +129,7 @@ LeanType is available in two purpose-built flavors designed to match your exact - **๐Ÿ”ข Real-Time Inline Math Calculations**: Automatically evaluates mathematical expressions upon typing `=` (e.g. `25*4=`, `500-15%=`, `(12+8)/4=`) and shows the answer directly in the suggestion strip for 1-tap replacement. - **๐Ÿ” Smart Clipboard History & Inline Editing**: Search clips in real-time, swipe right to edit text directly in the toolbar with full gesture cursor/deletion, swipe left to delete with 5s undo, and fold pinned items. - **๐Ÿ“ธ Screenshot Suggestions**: Detects recently taken screenshots and offers instant 1-tap sharing via the suggestion strip or clipboard history. -- **๐Ÿ“ Versatile Text Expander**: Built-in shortcut expansion with dynamic variables (`%date%`, `%time%`, `%clipboard%`, `%cursor%`), composable modifier filters (`%clipboard:clean%`, `:singleline`, `:title`, `:slug`, `:upper`, `:replace`), and automatic Wikipedia / research paper citation cleaner. +- **๐Ÿ“ Versatile Text Expander**: Built-in shortcut expansion with dynamic variables (`%date%`, `%time%`, `%clipboard%`, `%cursor%`), composable modifier filters (`%clipboard:clean%`, `:singleline`, `:title`, `:slug`, `:upper`, `:replace`), `%tab%`, image shortcuts, a Bulk editor for all shortcuts as plain text, and a suggestion-only mode, and automatic Wikipedia / research paper citation cleaner. - **๐Ÿ’พ Storage & Cache Management**: Visual disk space auditing across AI models, dictionaries, sound packs, and media cache, with 1-tap cache purging and history reset (**Settings โ†’ Plugins โ†’ Storage & Cache**). - **๐Ÿ” Granular Backup & Encrypted API Key Export**: Export preferences, layouts, custom wordlists, typing history, and text expander shortcuts separately, with optional AES-256 encrypted export for third-party AI and media API keys. - **๐Ÿ’พ Selective Category Backup & Restore**: Export and restore your data modularly with independent category checkboxes (**Layouts**, **Theme & Custom Backgrounds**, **Dictionaries & Typing History**, **Clipboard History**, and **General Settings**) without all-or-nothing overwrites. @@ -132,7 +137,7 @@ LeanType is available in two purpose-built flavors designed to match your exact - **๐Ÿ“š Smart Learning & Session Boost**: Adaptive personal dictionary learning threshold (1 to 5 times) and dynamic session word boosting. - **๐Ÿšซ Blacklist & Regex Filtering**: Filter offensive words or unwanted suggestions with custom regex pattern support. - **๐Ÿ”„ Google Dictionary Import**: Seamlessly import personal dictionary words exported from Gboard. -- **๐Ÿ”„ In-App Update Checker**: Direct GitHub release checks with single-version changelogs and 1-tap "View Release" redirection (`standard` flavor). +- **๐Ÿ”„ In-App Update Checker**: Direct GitHub release checks for the app and companion plugins, a What's New dialog after each update, and 1-tap "View Release" redirection (`standard` flavor). --- @@ -170,7 +175,7 @@ LeanType is available in two purpose-built flavors designed to match your exact ### 1. Cloud & Self-Hosted AI Setup (Gemini / Groq / OpenAI / Ollama) 1. **Cloud API**: Obtain an API key from [Google AI Studio](https://aistudio.google.com/apikey) or [Groq Console](https://console.groq.com/keys). 2. **Self-Hosted AI**: Run [Ollama](https://ollama.com/), [LM Studio](https://lmstudio.ai/), or [LocalAI](https://localai.io/) on your local network (e.g. `http://192.168.1.100:11434/v1`). -3. Open **Settings โ†’ AI Integration โ†’ Set AI Provider**. +3. Open **Settings โ†’ AI Integration โ†’ AI Provider**. 4. Select your provider (or choose **Custom (OpenAI-compatible)** for self-hosted instances), enter your endpoint URL/token, and choose your preferred model and target language. 5. ๐Ÿ‘‰ **[Read the Full AI & Prompts Guide](docs/FEATURES.md)** @@ -182,40 +187,40 @@ LeanType is available in two purpose-built flavors designed to match your exact 5. Tap the microphone icon on the keyboard toolbar to start speech-to-text! ### 3. Translation Setup (Offline & Online) -1. **Online Flavor (`Standard`)**: Open **Settings โ†’ Translation** and tap **Download Plugin** to install the [LeanType Translation Plugin](https://github.com/LeanBitLab/LeanType-Translation-Plugin/releases/latest) automatically. +1. **Online Flavor (`Standard`)**: Open **Settings โ†’ Plugins โ†’ Translation** and tap **Download Plugin** to install the [LeanType Translation Plugin](https://github.com/LeanBitLab/LeanType-Translation-Plugin/releases/latest) automatically. 2. **Offline Flavor (`Offline`)**: Download `translation_plugin-arm64-v8a.apk` from [GitHub Releases](https://github.com/LeanBitLab/LeanType-Translation-Plugin/releases/latest) and load it in **Settings โ†’ Plugins โ†’ Translation**. 3. Download or import your required language translation models (~30 MB per language). 4. Tap the **Translate** icon on the keyboard toolbar to translate selected text or input fields instantly. ### 4. Handwriting Recognition Setup -1. **Online Flavor (`Standard`)**: Open **Settings โ†’ Handwriting** and tap **Download Plugin** to fetch the [LeanType Handwriting Plugin](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin/releases/latest). -2. **Offline Flavor (`Offline`)**: Download `handwriting_plugin-arm64-v8a.apk` from [GitHub Releases](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin/releases/latest) and load it in **Settings โ†’ Plugins โ†’ Handwriting**. +1. **Online Flavor (`Standard`)**: Open **Settings โ†’ Plugins โ†’ Handwriting Input Plugin** and tap **Download Plugin** to fetch the [LeanType Handwriting Plugin](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin/releases/latest). +2. **Offline Flavor (`Offline`)**: Download `handwriting_plugin-arm64-v8a.apk` from [GitHub Releases](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin/releases/latest) and load it in **Settings โ†’ Plugins โ†’ Handwriting Input Plugin**. 3. Download or import handwriting recognition models for your languages. 4. Tap the **Handwriting key** on the toolbar or long-press spacebar to draw characters on the writing canvas. ### 5. Offline AI Setup (Local GGUF Models) 1. Download `ai_plugin-arm64-v8a.apk` (or `ai_plugin-x86_64.apk`) from the [LeanType Offline AI Plugin Releases](https://github.com/LeanBitLab/LeanType-Offline-AI-Plugin/releases/latest). -2. In LeanType (`offline` build), navigate to **Settings โ†’ Plugins โ†’ Offline AI** and tap **Load Offline AI plugin** to load the `.apk`. +2. In LeanType (`offline` build), navigate to **Settings โ†’ Plugins โ†’ Offline AI Plugin** and tap **Load Offline AI plugin** to load the `.apk`. 3. Download a compatible GGUF model (e.g. `Qwen2.5-0.5B-Instruct-Q4_K_M.gguf` or `Llama-3.2-1B-Instruct-Q4_K_M.gguf`). -4. In LeanType, navigate to **Settings โ†’ Advanced โ†’ GGUF Model (.gguf)** and select the model file from storage. +4. In LeanType, navigate to **Settings โ†’ AI Integration โ†’ Offline Model** and select the model file from storage. ### 6. Dictionaries & Gesture Typing Setup -1. **Dictionaries**: With unbundled dictionaries in v4.1.6, open **Settings โ†’ Dictionaries** (or tap the dictionary icon on the toolbar when missing) to download or import your language dictionary (`.dict`). -2. **Gesture Typing**: In online builds, open **Settings โ†’ Gesture typing** to download the gesture library automatically. In offline builds, [download the library](https://github.com/erkserkserks/openboard/tree/46fdf2b550035ca69299ce312fa158e7ade36967/app/src/main/jniLibs) and load via *Settings โ†’ Gesture typing โ†’ Load gesture library*. +1. **Dictionaries**: With unbundled dictionaries in v4.1.6, open **Settings โ†’ Languages & Layouts โ†’ Dictionaries** (or tap the dictionary icon on the toolbar when missing) to download or import your language dictionary (`.dict`). +2. **Gesture Typing**: In online builds, open **Settings โ†’ Gestures & swipes** to download the gesture library automatically. In offline builds, [download the library](https://github.com/erkserkserks/openboard/tree/46fdf2b550035ca69299ce312fa158e7ade36967/app/src/main/jniLibs) and load via *Settings โ†’ Gesture typing โ†’ Load gesture library*. ### 7. Offline Camera & Screenshot OCR Setup -1. **Online Flavors**: Open **Settings โ†’ OCR & Text Extraction** (or **Settings โ†’ Plugins โ†’ OCR**) and tap **Download Plugin** to install the [LeanType OCR Plugin](https://github.com/LeanBitLab/LeanType-Ocr-Plugin/releases/latest). -2. **Offline Flavors**: Download `ocr_plugin.apk` from [GitHub Releases](https://github.com/LeanBitLab/LeanType-Ocr-Plugin/releases/latest) and load it in **Settings โ†’ Plugins โ†’ OCR**. +1. **Online Flavors**: Open **Settings โ†’ Plugins โ†’ Text Recognition (OCR)** and tap **Download Plugin** to install the [LeanType OCR Plugin](https://github.com/LeanBitLab/LeanType-Ocr-Plugin/releases/latest). +2. **Offline Flavors**: Download `ocr_plugin.apk` from [GitHub Releases](https://github.com/LeanBitLab/LeanType-Ocr-Plugin/releases/latest) and load it in **Settings โ†’ Plugins โ†’ Text Recognition (OCR)**. 3. Tap the **Camera / OCR** icon on the toolbar to open the in-keyboard scanner or take a screenshot to see the instant suggestion pill. ### 8. GIF Search & Media Picker Setup -1. Open **Settings โ†’ Plugins โ†’ GIF Settings** (or tap the GIF key on the toolbar). +1. Open **Settings โ†’ Plugins โ†’ GIF Search** (or tap the GIF key on the toolbar). 2. Select your preferred provider (**GIPHY** or **KLIPY**). Optionally configure custom API keys. 3. Search trending GIFs, browse stickers, or insert media directly into compatible messaging apps. ### 9. CJK (Chinese, Japanese & Korean) Setup -1. Open **Settings โ†’ Languages โ†’ Add language** and select Chinese, Japanese, or Korean. -2. In **Settings โ†’ Plugins โ†’ CJK Settings**, enable the CJK Engine (or install the companion plugin if prompted). +1. Open **Settings โ†’ Languages & Layouts โ†’ Add language** and select Chinese, Japanese, or Korean. +2. In **Settings โ†’ Plugins โ†’ CJK Input**, enable the CJK Engine (or install the companion plugin if prompted). 3. Select your input style (e.g. Pinyin for Chinese, Flick/Romaji for Japanese, 2-Set Hangul for Korean) and type with the live candidate strip. --- @@ -234,6 +239,7 @@ Expand LeanType with official companion plugins: | โœ๏ธ **Handwriting Plugin** | [LeanBitLab/Leantype-Handwriting-Plugin](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin) | ML Kit Digital Ink canvas recognition engine | | ๐ŸŽฌ **GIF Plugin** | [LeanBitLab/LeanType-Gif-Plugin](https://github.com/LeanBitLab/LeanType-Gif-Plugin) | In-keyboard GIF & sticker search engine (GIPHY & KLIPY) with WhatsApp normalization | | ๐Ÿˆฒ **CJK Plugin** | [LeanBitLab/LeanType-CJK-Plugin](https://github.com/LeanBitLab/LeanType-CJK-Plugin) | Pinyin Chinese, Japanese Romaji/Kana & Korean Hangul input engine | +| ๐ŸŒ **Language Packs** | [LeanBitLab/LeanType-Language-Packs](https://github.com/LeanBitLab/LeanType-Language-Packs) | UI translations for the English-only Lite builds (Android 11+) | | ๐ŸŽต **Sound Packs** | [LeanBitLab/LeanType-SoundPacks](https://github.com/LeanBitLab/LeanType-SoundPacks) | Synthesized and physical modeling keypress sound packs | | ๐ŸŽจ **Community Themes** | [GitHub: `leantype-theme`](https://github.com/topics/leantype-theme) | Browse and share custom color themes | diff --git a/docs/FEATURES.md b/docs/FEATURES.md index 954884f007..9ae866d28c 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -51,9 +51,12 @@ LeanType combines a lightweight, privacy-focused keyboard foundation with cuttin | ๐Ÿ“ฑ **[Foldable & Large Display Ergonomics](#41-foldable--large-display-ergonomics)** | Auto screen profile detection, scale factor, side padding, and split gap | | โš™๏ธ **[Settings Progressive Disclosure](#42-settings-progressive-disclosure)** | Expandable fine-tuning sections across settings categories | | ๐Ÿˆฒ **[Chinese Punctuation & CJK Symbols](#43-chinese-punctuation--cjk-symbols)** | Full-width punctuation, dedicated CJK symbols, and preedit sync | -| ๐Ÿšซ **[Blocked Words Standalone Import & Export](#44-blocked-words-standalone-import--export)** | Standalone word list import/export with duplicate filtering | +| ๐Ÿšซ **[Blocked Words Standalone Import & Export](#44-standalone-blocked-words-import--export)** | Standalone word list import/export with duplicate filtering | | ๐Ÿ‡ฎ๐Ÿ‡ณ **[Tamil V4 Layout Option](#45-tamil-v4-layout-option)** | Modern Tamil V4 layout option dynamically available across Tamil locales | | ๐Ÿ”ค **[Custom Text Styles](#46-custom-text-styles)** | Add your own Unicode font styles to the Font Style strip by pasting a styled alphabet | +| ๐ŸŒ **[Lite Builds & UI Language Packs](#47-lite-builds--ui-language-packs)** | English-only Android 11+ APKs about 4 MB smaller, with app translations as downloadable packs | +| ๐Ÿ—บ๏ธ **[Settings Map](#48-settings-map)** | Every settings screen and the settings on it, generated from the code | +| โœจ **[More Recent Additions](#49-more-recent-additions)** | Khipro Blinder mode, switch back to the main keyboard on reopen, What's New dialog | --- @@ -61,48 +64,48 @@ LeanType combines a lightweight, privacy-focused keyboard foundation with cuttin | Feature | Description | Settings Location | | :--- | :--- | :--- | -| **Multi-Provider Cloud AI** | Proofread, rewrite, and fix grammar via Gemini, Groq, or OpenAI-compatible custom endpoints. | `AI Integration > Set AI Provider` | -| **Custom AI Keys** | 10 customizable toolbar keys with prompt templates, hashtags (`#editor`, `#proofread`), and tag capsules. | `AI Integration > Custom Keys` | -| **Offline Proofreading (GGUF)** | Zero-network, on-device neural proofreading powered by embedded `llama.cpp`. | `Advanced > GGUF Model (.gguf)` | +| **Multi-Provider Cloud AI** | Proofread, rewrite, and fix grammar via Gemini, Groq, or OpenAI-compatible custom endpoints. | `AI Integration > AI Provider` | +| **Custom AI Keys** | 10 customizable toolbar keys with prompt templates, hashtags (`#editor`, `#proofread`), and tag capsules. | `AI Integration > Custom AI Keys` | +| **Offline Proofreading (GGUF)** | Zero-network, on-device neural proofreading powered by embedded `llama.cpp`. | `AI Integration > Offline Model` *(offline flavor)* | | **Multi-Mode In-Keyboard Translation** | Translate text on-device (Offline ML Kit), via Translation Plugin, or Cloud/Local AI with auto-fallback. | `Translation > Translation Mode` | -| **Whisper Voice Typing** | On-device speech-to-text with quantized multilingual Whisper models and audio visualizer. | `Plugins > Voice Input > Whisper Models` | +| **Whisper Voice Typing** | On-device speech-to-text with quantized multilingual Whisper models and audio visualizer. | `Plugins > Voice Input > Manage & Download Models` | | **Handwriting Recognition** | Draw characters on a dedicated canvas with in-app model manager (supported across all flavors via plugin). | `Handwriting > Handwriting recognition` | -| **Offline Camera & Screenshot OCR** | Live in-keyboard camera scanner and screenshot suggestion pill with rich text cleaners (casing, join styles, dehyphenation). | `OCR & Text Extraction` / `Plugins > OCR` | -| **Inline Math Calculation** | Instant arithmetic calculation suggestions on typing `=` with 1-tap expression replacement. | `Text correction > Inline math calculation` | -| **Custom Sound Packs** | Zero-latency key audio engine with 12+ built-in presets, remote catalog downloads, and `.zip` import. | `Plugins > Sound` / `Preferences > Sound on keypress` | -| **GIF Search & Media Picker** | Search GIFs and stickers via GIPHY/KLIPY with live preview and WhatsApp sticker insertion. | `Plugins > GIF Settings` / `Toolbar > GIF Key` | -| **CJK Plugin Engine** | Chinese Pinyin, Japanese Romaji/Kana, and Korean Hangul with dedicated candidate strip UI. | `Plugins > CJK Settings` | +| **Offline Camera & Screenshot OCR** | Live in-keyboard camera scanner and screenshot suggestion pill with rich text cleaners (casing, join styles, dehyphenation). | `OCR & Text Extraction` / `Plugins > Text Recognition (OCR)` | +| **Inline Math Calculation** | Instant arithmetic calculation suggestions on typing `=` with 1-tap expression replacement. | `Suggestions > Inline math calculation` | +| **Custom Sound Packs** | Zero-latency key audio engine with 12+ built-in presets, remote catalog downloads, and `.zip` import. | `Preferences > Keypress Audio` | +| **GIF Search & Media Picker** | Search GIFs and stickers via GIPHY/KLIPY with live preview and WhatsApp sticker insertion. | `Plugins > GIF Search` / `Toolbar > Select toolbar keys` | +| **CJK Plugin Engine** | Chinese Pinyin, Japanese Romaji/Kana, and Korean Hangul with dedicated candidate strip UI. | `Plugins > CJK Input` | | **Hexagonal Honeycomb Layouts** | Typewise and hexagonal QWERTY layouts with axial hit testing and landscape ergonomic thumb split. | `Languages > Layouts (hex_typewise, hex_qwerty)` | -| **Full Keyboard Swipe Gestures** | Horizontal swipe across entire keyboard to switch languages, move cursor, or toggle numpad. | `Gesture typing > Full keyboard horizontal swipe` | -| **2D Backspace Swipe Gesture** | Diagonal and vertical line/word selection adjustments from the Backspace key. | `Gesture typing > Delete key swipe gesture` | -| **Auto Floating in Landscape** | Automatically switch to floating keyboard when rotated to landscape orientation. | `Preferences > Floating keyboard auto in landscape` | +| **Full Keyboard Swipe Gestures** | Horizontal swipe across entire keyboard to switch languages, move cursor, or toggle numpad. | `Gestures & swipes > Full keyboard swipe gesture` | +| **2D Backspace Swipe Gesture** | Diagonal and vertical line/word selection adjustments from the Backspace key. | `Gestures & swipes > Delete swipe` | +| **Auto Floating in Landscape** | Automatically switch to floating keyboard when rotated to landscape orientation. | `Preferences > Floating mode in landscape` | | **Storage & Cache Management** | Categorized storage breakdowns (models, dicts, sound, cache) with 1-tap purging. | `Plugins > Storage & Cache` | -| **System Wallpaper Background** | Live or static device wallpaper background with FastBlurEngine blur slider. | `Appearance > Theme > Background > System Wallpaper` | +| **System Wallpaper Background** | Live or static device wallpaper background with FastBlurEngine blur slider. | `Appearance > Use system wallpaper` | | **Clipboard Action Pill & Multi-Select** | Gboard-style compact floating action pill on long press and multi-item batch deletion/pinning. | `Clipboard Toolbar > Long-press clip` | | **Granular Backup & API Key Export** | Selectable custom wordlists vs typing history with password-protected encrypted API keys export. | `Backup & restore > Backup` | | **Text Editing Panel** | Precision DPAD arrow navigation, Shift selection mode, and clipboard shortcuts. | Toolbar > Text Editing Icon | -| **Auto-Spanning Toolbar** | Dynamically expands and balances toolbar keys symmetrically across device widths. | `Appearance > Toolbar auto-spacing` | -| **Touchpad Mode** | Swipe up on Spacebar to activate full cursor control and laptop-style touchpad gestures. | `Gesture typing > Vertical spacebar swipe` | +| **Auto-Spanning Toolbar** | Dynamically expands and balances toolbar keys symmetrically across device widths. | `Toolbar > Auto-span toolbar keys` | +| **Touchpad Mode** | Swipe up on Spacebar to activate full cursor control and laptop-style touchpad gestures. | `Gestures & swipes > Vertical up spacebar swipe gesture` | | **Native IME Floating Window** | Moveable floating keyboard window with touch-passthrough, bottom dock bar, resize handle, zero dead space, and persistent memory. | Toolbar > Floating Keyboard / `Preferences > Remember floating mode` | -| **Per-App Profiles & Quirks** | Fine-tune composing behavior per app (Tasker symbol composing, web editor compatibility, auto-incognito, and Enter action overrides). | `Plugins > App Profiles` | +| **Per-App Profiles & Quirks** | Fine-tune composing behavior per app (Tasker symbol composing, web editor compatibility, auto-incognito, and Enter action overrides). | `Advanced > App Profiles` | | **Hardware Keyboard Support** | Full predictive suggestions, auto-correction, candidate shortcuts (`1`, `2`, `3`), and D-PAD emoji navigation for external keyboards. | `Languages > Physical keyboard` / Auto-detected | | **Appearance & Key Ergonomics** | Independent key corner radius sliders, adjustable key gaps, customizable padding scales, and distinct Shift/Caps visual indicators. | `Appearance > Key borders` / `Theme` | -| **Split Toolbar & Suggestions** | Separates suggestions from the toolbar into a dual-row view. | `Appearance > Split toolbar & suggestions` | -| **Versatile Text Expander** | Expand shortcuts with dynamic variables, citation stripper (`%clipboard:clean%`), bulk plain-text editor, and modifiers. | `Text correction > Text Expander` | +| **Split Toolbar & Suggestions** | Separates suggestions from the toolbar into a dual-row view. | `Toolbar > Split toolbar` | +| **Versatile Text Expander** | Expand shortcuts with dynamic variables, citation stripper (`%clipboard:clean%`), bulk plain-text editor, and modifiers. | `Text Expander` | | **Clipboard History & Inline Edit** | Search history, swipe-right to edit inline, swipe-left to delete with undo, fold pinned clips, and slide-select. | Clipboard Toolbar > Search / Swipe items | -| **Screenshot Suggestions** | Instant 1-tap sharing of recently taken screenshots via the suggestion strip. | `Text correction > Suggest recent screenshots` | +| **Screenshot Suggestions** | Instant 1-tap sharing of recently taken screenshots via the suggestion strip. | `Suggestions > Suggest recent screenshots` | | **Emoji Search** | Search emojis by name/keyword directly from the emoji palette. | `Emoji Key > Search Icon` | -| **Blocked Words Blacklist** | Prevent unwanted words from being suggested with regex pattern matching. | `Text correction > Blocked words blacklist` | -| **Smart Learning & Boost** | Adjustable personal dictionary learning threshold (1-5 times) and temporary session word boost. | `Text correction > Dictionary learning threshold` | -| **Gesture Typing** | Swipe typing powered by native C++ spatial scoring engine. | `Gesture typing > Enable gesture typing` | +| **Blocked Words Blacklist** | Prevent unwanted words from being suggested with regex pattern matching. | `Languages & Layouts > Dictionaries > Blocked words` | +| **Smart Learning & Boost** | Adjustable personal dictionary learning threshold (1-5 times) and temporary session word boost. | `Languages & Layouts > Dictionaries > Learning threshold` | +| **Gesture Typing** | Swipe typing powered by native C++ spatial scoring engine. | `Gestures & swipes > Enable gesture typing` | | **Direct Switch Target IME** | Fast 1-tap switching to another configured IME using custom keycode `-10076`. | `Preferences > Direct Switch Target IME` | | **Custom Layout Profiles** | Store up to 5 custom keyboard layouts with persistent slot tracking. | `Languages > Custom layouts` | | **In-App Update Checker** | Checks GitHub releases with changelogs and 1-tap release viewing (`standard` flavor). | `Settings > Updates` | -| **Exact Visual Line Delete Swipe** | Uses platform-native `requestTextBoundsInfo` (API 34+) to detect visual line wrap boundaries. | `Gesture typing > Delete key swipe gesture` | +| **Exact Visual Line Delete Swipe** | Uses platform-native `requestTextBoundsInfo` (API 34+) to detect visual line wrap boundaries. | `Gestures & swipes > Delete swipe` | | **Foldable & Tablet Controls** | Fine-tune scale factor, side padding, and split gap with automatic screen profile detection. | `Appearance > Foldable & Large Display` | | **Settings Progressive Disclosure** | Expandable fine-tune sections keep primary views minimal and intuitive. | Settings screens | -| **Chinese Punctuation & Symbols** | Full-width punctuation marks, dedicated CJK symbols, and live preedit sync. | CJK layouts / `Plugins > CJK Settings` | -| **Blocked Words Import & Export** | Standalone word list import and export with duplicate filtering. | `Text correction > Blocked words blacklist` | +| **Chinese Punctuation & Symbols** | Full-width punctuation marks, dedicated CJK symbols, and live preedit sync. | CJK layouts / `Plugins > CJK Input` | +| **Blocked Words Import & Export** | Standalone word list import and export with duplicate filtering. | `Languages & Layouts > Dictionaries > Blocked words` | | **Tamil V4 Layout** | Selectable Tamil V4 layout dynamically available across Tamil locales. | `Languages > Tamil > Layouts` | | **Custom Text Styles** | Define your own Unicode font styles (one line each) and use them from the Font Style strip with live typing and undo. | `Toolbar > Custom text styles` | @@ -125,7 +128,7 @@ LeanType connects directly with top AI providers for ultra-fast proofreading, gr - **Google Gemini**: [Google AI Studio](https://aistudio.google.com/apikey) (key starts with `AIzaSy...`). - **Groq**: [Groq Console](https://console.groq.com/keys) (key starts with `gsk_...`). - **OpenAI-compatible**: [OpenRouter](https://openrouter.ai/keys), [DeepSeek Platform](https://platform.deepseek.com), or your local LLM server. -2. In LeanType, open **Settings โ†’ AI Integration โ†’ Set AI Provider**. +2. In LeanType, open **Settings โ†’ AI Integration โ†’ AI Provider**. 3. Select your provider, paste your API token, and pick your preferred model and target language. --- @@ -135,7 +138,7 @@ LeanType connects directly with top AI providers for ultra-fast proofreading, gr You can assign custom prompts, personas, and custom label tags to **10 dedicated toolbar keys**. ### Custom Text Capsules -- Assign custom labels (e.g. `French`, `Rephrase`, `Reply`) in **Settings โ†’ AI Integration โ†’ Custom Keys**. +- Assign custom labels (e.g. `French`, `Rephrase`, `Reply`) in **Settings โ†’ AI Integration โ†’ Custom AI Keys**. - Enable **Show tags on keyboard** to render them as themed pill capsules directly on the keyboard toolbar. ### AI Persona Keywords (Hashtags) @@ -162,12 +165,12 @@ Include these hashtags in your custom prompts to enforce strict system roles: ### Setup Instructions 1. Download `ai_plugin-arm64-v8a.apk` (or `ai_plugin-x86_64.apk`) from the [LeanType Offline AI Plugin Releases](https://github.com/LeanBitLab/LeanType-Offline-AI-Plugin/releases/latest). -2. In LeanType, open **Settings โ†’ Plugins โ†’ Offline AI** and tap **Load Offline AI plugin** to load the `.apk`. +2. In LeanType, open **Settings โ†’ AI Integration โ†’ Offline AI Plugin** to load the `.apk`. 3. Download a compact GGUF model: - **Qwen 2.5 0.5B Instruct (Q4_K_M)**: Extremely lightweight & fast (~350 MB). - **Llama 3.2 1B Instruct (Q4_K_M)**: High-quality compact reasoning (~900 MB). - **Qwen 2.5 1.5B Instruct (Q4_K_M)**: High intelligence for modern devices (~1.1 GB). -4. Open **Settings โ†’ Advanced โ†’ GGUF Model (.gguf)** and select the `.gguf` file from your storage. +4. Open **Settings โ†’ AI Integration โ†’ Offline Model** and select the `.gguf` file from your storage. 5. Configure sampling temperature, Top-K, Top-P, and custom system instructions. --- @@ -186,7 +189,7 @@ LeanType offers a flexible translation architecture supporting all app flavors: - Uses your configured **AI Provider** (Google Gemini, Groq, OpenAI, Ollama, or local GGUF models) with customizable translation prompts. ### How to Setup -1. **Online Flavor (`Standard`)**: Open **Settings โ†’ Translation** and tap **Download Plugin** to install the [LeanType Translation Plugin](https://github.com/LeanBitLab/LeanType-Translation-Plugin/releases/latest) automatically. +1. **Online Flavor (`Standard`)**: Open **Settings โ†’ Plugins โ†’ Translation** and tap **Download Plugin** to install the [LeanType Translation Plugin](https://github.com/LeanBitLab/LeanType-Translation-Plugin/releases/latest) automatically. 2. **Offline Flavor (`Offline`)**: Download `translation_plugin-arm64-v8a.apk` from [GitHub Releases](https://github.com/LeanBitLab/LeanType-Translation-Plugin/releases/latest) and load it in **Settings โ†’ Plugins โ†’ Translation**. 3. Download or import your required source and target language pairs. 4. Tap the **Translate** icon on the keyboard toolbar to instantly translate selected text or entire input fields. @@ -231,8 +234,8 @@ The multilingual models support 99 languages. English-only models are a little m Draw letters, words, or symbols directly on a handwriting recognition canvas using your finger or stylus via the companion [LeanType Handwriting Plugin](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin) (supported across all flavors). ### Setup Instructions -1. **Online Flavors**: Open **Settings โ†’ Handwriting** and tap **Download Plugin** to install the [LeanType Handwriting Plugin](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin/releases/latest). -2. **Offline Flavors**: Download `handwriting_plugin-arm64-v8a.apk` from [GitHub Releases](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin/releases/latest) and load it in **Settings โ†’ Plugins โ†’ Handwriting**. +1. **Online Flavors**: Open **Settings โ†’ Plugins โ†’ Handwriting Input Plugin** and tap **Download Plugin** to install the [LeanType Handwriting Plugin](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin/releases/latest). +2. **Offline Flavors**: Download `handwriting_plugin-arm64-v8a.apk` from [GitHub Releases](https://github.com/LeanBitLab/Leantype-Handwriting-Plugin/releases/latest) and load it in **Settings โ†’ Plugins โ†’ Handwriting Input Plugin**. 3. Use the **Offline Handwriting Models** dialog to download recognition packs directly (or import downloaded `.zip` model packs on offline builds). 4. Customize stroke width, stroke fade timeout, and recognition sensitivity. 5. Tap the **Handwriting (Pencil)** icon on the keyboard toolbar to open the drawing canvas and write naturally. @@ -250,7 +253,7 @@ A precision editing panel designed for frictionless text manipulation and direct - **Navigation Shortcuts**: Jump directly to start or end of document (`code: -25` / `-26`) or line (`code: -27` / `-28`). ### Prebuilt Layout Variants -LeanType includes 3 prebuilt text editing layouts (switchable in **Settings -> Languages -> Secondary layouts -> Text editing layout**): +LeanType includes 3 prebuilt text editing layouts (switchable in **Settings โ†’ Languages & Layouts โ†’ Secondary layouts โ†’ Text editing**): 1. **Gboard (Default)** (`editing_gboard`): Modern D-Pad cluster with centered `Select` toggle, `โœ•` (Close / exit), `Cut`, `Copy`, `Paste`, `Undo`, `Redo`, `Select all`, Jump to Start (`|<`), Jump to End (`>|`), and Backspace. 2. **Standard** (`editing`): Full grid with Undo/Redo, Word/All selection, Cut/Copy/Paste, DPAD arrows, and line jumps. 3. **Classic** (`editing_classic`): Vintage layout with extended navigation keys and symbol shortcuts. @@ -259,7 +262,7 @@ LeanType includes 3 prebuilt text editing layouts (switchable in **Settings -> L ### Custom Editing Layout Scripting Guide -You can create and import your own text editing layout JSON files in **Settings -> Languages -> Secondary layouts -> Text editing layout -> Load from file** (or paste directly in the layout editor). +You can create and import your own text editing layout JSON files in **Settings โ†’ Languages & Layouts โ†’ Secondary layouts โ†’ Text editing**, then **Load from file** (or paste directly in the layout editor). #### JSON Structure An editing layout is defined as a 2D JSON array representing rows of keys: @@ -345,7 +348,7 @@ An editing layout is defined as a 2D JSON array representing rows of keys: The **Auto-Spanning Toolbar** dynamically measures available screen width and proportionately balances toolbar keys symmetrically. - Eliminates awkward blank space on large screens, tablets, and landscape orientation. - Unifies alignment between standard toolbar keys and clipboard action rows. -- Configure via **Settings โ†’ Appearance โ†’ Toolbar auto-spacing**. +- Configure via **Settings โ†’ Toolbar โ†’ Auto-span toolbar keys**. --- @@ -386,7 +389,7 @@ LeanType features an advanced **Native IME Floating Window** architecture that r ## 11. Dual Toolbar & Split Suggestions Split your toolbar and suggestion strip into two independent rows for fast, unhindered access to both word predictions and quick actions. -- Configure via **Settings โ†’ Appearance โ†’ Split toolbar & suggestions**. +- Configure via **Settings โ†’ Toolbar โ†’ Split toolbar**. --- @@ -461,7 +464,7 @@ Manage your entire shortcut collection simultaneously as plain text: - **Custom Prefixes**: Add custom characters (e.g. `;`, `//`, `.` or blank) to prevent accidental expansions during everyday typing. ### Setup Instructions -1. Open **Settings -> Text correction -> Text Expander**. +1. Open **Settings โ†’ Text Expander**. 2. Tap **+ (Add)** to add a shortcut dialog, or tap **Edit all as text** to manage shortcuts in bulk. --- @@ -486,14 +489,14 @@ LeanType features a comprehensive, privacy-first clipboard manager with rich ges - **Instant Suggestion**: Automatically detects newly captured screenshots (within 4 minutes) and presents a thumbnail preview in the suggestion strip for 1-tap insertion. - **Clipboard Sync**: Automatically saves captured screenshots into your clipboard image history. -- Enable via **Settings โ†’ Text correction โ†’ Suggest recent screenshots**. +- Enable via **Settings โ†’ Suggestions โ†’ Suggest recent screenshots**. --- ## 15. Emoji Search - Search through thousands of emojis by keyword or name directly inside the emoji palette. -- **Setup**: Ensure an **Emoji Dictionary** (e.g. *Emoji English*) is enabled under **Settings โ†’ Text correction โ†’ Dictionary**. +- **Setup**: Ensure an **Emoji Dictionary** (e.g. *Emoji English*) is enabled under **Settings โ†’ Languages & Layouts โ†’ Dictionaries**. --- @@ -501,7 +504,7 @@ LeanType features a comprehensive, privacy-first clipboard manager with rich ges Prevent offensive, sensitive, or unwanted words from ever appearing in the suggestion strip: - Supports literal words and custom **regular expression (regex)** patterns. -- Manage rules via **Settings โ†’ Text correction โ†’ Blocked words blacklist**. +- Manage rules via **Settings โ†’ Languages & Layouts โ†’ Dictionaries โ†’ Blocked words**. --- @@ -513,7 +516,7 @@ LeanType learns your vocabulary organically as you type while providing deep gra - **Suggestion Balance Master Sliders**: Fine-tune the exact scoring weights between unigram frequency, bigram/ngram context, and dictionary matches (**Settings โ†’ Suggestions โ†’ Suggestion Balance**). - **SuggestTrace & ScoreAudit Telemetry**: Built-in developer/power-user instrumentation to audit why specific words are being predicted or auto-corrected, backed by early beam pruning (`BEAM_DELTA = 60`) for optimal typing latency. - **Google Dictionary Import**: Import existing user dictionaries exported from Gboard. -- Configure via **Settings โ†’ Suggestions** and **Settings โ†’ Text correction โ†’ Dictionary learning threshold**. +- Configure via **Settings โ†’ Suggestions** and **Settings โ†’ Languages & Layouts โ†’ Dictionaries โ†’ Learning threshold**. --- @@ -521,7 +524,7 @@ LeanType learns your vocabulary organically as you type while providing deep gra - Smooth swipe typing powered by native C++ spatial scoring (`libjni_latinime.so`). - Supports floating preview text, customizable trail colors, and space-aware gesture input. -- In `standard` builds, the gesture library is downloaded automatically via **Settings โ†’ Gesture typing**. +- In `standard` builds, the gesture library is downloaded automatically via **Settings โ†’ Gestures & swipes**. --- @@ -537,14 +540,14 @@ Map the custom keycode `-10076` (`SWITCH_TO_USER_IME`) to any toolbar key: - Create and save up to **5 persistent custom layout profiles**. - Switch between layout profiles seamlessly while preserving active slot indices across orientation and symbol states. -- Manage via **Settings โ†’ Languages โ†’ Custom layouts**. +- Manage via **Settings โ†’ Languages & Layouts**. --- ## 22. In-App Update Checker & Release Viewer > [!NOTE] -> Available in the **Standard** (`-standard-release.apk`) build flavor. +> Available in the **Standard** build flavor (`-standard-release.apk` and `-standard-lite-release.apk`). - Automatically checks GitHub releases for updates in the background. - Eliminates sensitive package installation permissions (`REQUEST_INSTALL_PACKAGES`) by redirecting to official GitHub Releases for safe and verified APK updates. @@ -565,6 +568,11 @@ LeanType is published in two purpose-built flavors to balance cloud AI capabilit | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | **Standard (Recommended)** | โœ… | โŒ | โœ… *(Plugin)* | โœ… *(Plugin)* | โœ… *(Plugin)* | โœ… *(Plugin/AI)* | โœ… *(View Release)* | ๐ŸŒ Optional *(Opt-in)* | SDK 23 (6.0+) | **~12.8 MB** | | **Offline** | โŒ | โœ… *(Plugin on 8.0+)* | โœ… *(Plugin)* | โœ… *(Plugin)* | โœ… *(Plugin)* | โœ… *(Plugin)* | โŒ | ๐Ÿšซ **None** | SDK 23 (6.0+) | **~12.5 MB** | +| **Standard Lite** *(`-standard-lite-release.apk`)* | โœ… | โŒ | โœ… *(Plugin)* | โœ… *(Plugin)* | โœ… *(Plugin)* | โœ… *(Plugin/AI)* | โœ… *(View Release)* | ๐ŸŒ Optional *(Opt-in)* | **Android 11+** | **~9 MB** | +| **Offline Lite** *(`-offline-lite-release.apk`)* | โŒ | โœ… *(Plugin on 8.0+)* | โœ… *(Plugin)* | โœ… *(Plugin)* | โœ… *(Plugin)* | โœ… *(Plugin)* | โŒ | ๐Ÿšซ **None** | **Android 11+** | **~9 MB** | + +> [!NOTE] +> **Lite builds** are the same app with English as the only built-in UI language. Other app languages come as language packs (see [Lite Builds & UI Language Packs](#47-lite-builds--ui-language-packs)). They install over the regular build of the same flavor. The F-Droid build is the regular, all-languages Standard build. > [!TIP] > **Concurrent Installation**: The `offline` (`com.leanbitlab.leantype.offline`) build uses a unique package ID, allowing you to install it alongside `standard` on the same device! @@ -618,7 +626,7 @@ Perform calculations instantly while typing in any app without switching to an e - **High Precision**: Built with a pure Kotlin `BigDecimal` parsing engine with robust scientific formatting and division-by-zero protection. ### โš™๏ธ Settings -- Enable or disable via **Settings โ†’ Text correction โ†’ Inline math calculation**. +- Enable or disable via **Settings โ†’ Suggestions โ†’ Inline math calculation**. --- @@ -645,7 +653,7 @@ LeanType includes a zero-latency native keypress audio feedback engine that deli - **Unbundled Light Footprint**: Sound packs are unbundled from the core APK to keep the core keyboard download footprint compact. - **Custom `.zip` Pack Import**: Import custom sound packs packaged as a `.zip` containing a `soundpack.json` manifest and keypress audio files (`.wav` or `.ogg`). - **Live Audition & Volume**: Audition sounds with live sample playback (โ–ถ๏ธ) and fine-tune keypress audio volume independently from system media volume. -- **Dedicated Settings Screen**: Access via **Settings โ†’ Plugins โ†’ Keypress Audio / Sound** or **Settings โ†’ Preferences โ†’ Sound on keypress**. +- **Dedicated Settings Screen**: Access via **Settings โ†’ Preferences โ†’ Keypress Audio**. --- @@ -653,7 +661,7 @@ LeanType includes a zero-latency native keypress audio feedback engine that deli Certain Android apps, terminal emulators, code editors, automation tools, and web-based input fields handle text entry in non-standard ways. LeanType features a dedicated **Per-App Profiles & Compatibility Engine** that lets you customize composing, auto-correction, and key behaviors on a granular per-application basis. -Access via **Settings โ†’ Plugins & Capabilities โ†’ App Profiles**. +Access via **Settings โ†’ Advanced โ†’ App Profiles**. ### โš™๏ธ Available Per-App Quirks & Overrides @@ -704,7 +712,7 @@ Go beyond simple color themes with granular, user-level control over the keyboar - **Outline Arrow**: Inactive / lowercase. - **Filled Arrow**: Single Shift active. - **Underlined Arrow**: Caps Lock locked. -- **Auto-Spanning Key Balance**: Proportionately expands toolbar keys symmetrically across wider displays and landscape orientations (**Settings โ†’ Appearance โ†’ Toolbar auto-spacing**). +- **Auto-Spanning Key Balance**: Proportionately expands toolbar keys symmetrically across wider displays and landscape orientations (**Settings โ†’ Toolbar โ†’ Auto-span toolbar keys**). --- @@ -713,7 +721,7 @@ Go beyond simple color themes with granular, user-level control over the keyboar LeanType provides an extensible keycode architecture that allows customizing keys in: - **Custom JSON Layouts**: Map keys via `"code": ` (e.g. `{"code": -9, "label": "Del"}`). - **Simple Text Layouts**: Defined directly in custom layout `.txt` files. -- **Toolbar Customization**: Custom primary and long-press codes via **Settings โ†’ Preferences โ†’ Customize toolbar key codes**. +- **Toolbar Customization**: Custom primary and long-press codes via **Settings โ†’ Toolbar โ†’ Customize toolbar key codes**. - **Popup Keys**: Extended keys revealed on long-pressing any primary keyboard key. > [!TIP] @@ -932,12 +940,14 @@ and correction rules are unchanged. LeanType introduces rich media integration with a dedicated, high-performance in-keyboard GIF and sticker media picker view. Access it via the toolbar media icon, custom layout keycode `-10086`, or from the emoji view media tabs. ### ๐ŸŽฌ Key Capabilities -- **Dual Content Providers**: Integrated support for both **GIPHY** and **KLIPY** search backends. Choose your preferred service or configure custom API keys under **Settings โ†’ Plugins โ†’ GIF Settings**. +- **Dual Content Providers**: Integrated support for both **GIPHY** and **KLIPY** search backends. Choose your preferred service or configure custom API keys under **Settings โ†’ Plugins โ†’ GIF Search**. - **Trending & Instant Search**: Browse real-time trending animations or enter keywords into the inline search bar with debounced, instantaneous query resolution. - **Stickers Support**: Switch seamlessly between animated GIF clips and transparent sticker graphics. - **Recent Media History**: Quick-access recent tray caches your favorite and recently shared media for 1-tap re-insertion without re-querying the network. - **Direct Content Insertion**: Dispatches media directly using Android's native `InputConnection.commitContent()` API with MIME type negotiation (`image/gif`, `image/webp`, `image/png`). - **WhatsApp Sticker Normalization**: Transparent stickers sent to WhatsApp and compatible messaging clients are automatically normalized and resized to the official WhatsApp sticker specification (512x512 WebP format), preventing awkward black backgrounds or attachment fallbacks. +- **Animated Preview**: Turn on **Preview** under **Settings โ†’ Plugins โ†’ GIF Search** to play the visible tiles without a long-press. Only tiles on screen animate, so scrolling costs no extra CPU (Android 9+). +- **Sticker Packs**: Packs show as square tiles with their name and item count; tap one to browse it and **Close pack** to go back. - **Offline & Low-Bandwidth Friendly**: Aggressive thumbnail caching minimizes network overhead. Cached media can be purged at any time via the Storage & Cache management screen. --- @@ -982,7 +992,7 @@ For users seeking ergonomic thumb typing efficiency on mobile devices, LeanType LeanType enhances gesture controls with full-surface keyboard swiping and multi-dimensional backspace selection. ### ๐Ÿ‘† Full Keyboard Horizontal Swiping -Configure full-keyboard horizontal edge-to-edge swipes under **Settings โ†’ Gesture typing โ†’ Full keyboard horizontal swipe**: +Configure full-keyboard horizontal edge-to-edge swipes under **Settings โ†’ Gestures & swipes โ†’ Full keyboard swipe gesture**: - **Switch Subtype / Language**: Quickly swipe across the keyboard to toggle between active languages and input scripts. - **Cursor Navigation**: Slide horizontally across keys to glide the cursor through text lines with high precision. - **Toggle Views**: Rapidly jump between Alphabet, Numeric Numpad, and Symbol keyboards. @@ -1001,7 +1011,7 @@ Take complete control over text deletion with multidirectional backspace gesture Using a full-width virtual keyboard in landscape orientation on modern wide smartphones often obscures up to 75% of the screen. LeanType solves this with intelligent **Auto Floating in Landscape**. ### ๐ŸชŸ Key Features -- **Automatic Orientation Adaptation**: Enable **Settings โ†’ Preferences โ†’ Floating keyboard auto in landscape**. LeanType automatically detaches into a compact floating window when your device rotates to landscape mode, and docks back to full-width when returning to portrait. +- **Automatic Orientation Adaptation**: Enable **Settings โ†’ Preferences โ†’ Floating mode in landscape**. LeanType automatically detaches into a compact floating window when your device rotates to landscape mode, and docks back to full-width when returning to portrait. - **Persistent Geometry Memory**: Position, dimension, and transparency preferences for the floating window are remembered independently for landscape mode. - **Zero Dead Space & Touch Passthrough**: Move the floating window anywhere on screen with the drag handle. Unused screen areas remain fully interactive and touch-transparent. @@ -1030,7 +1040,7 @@ Keep your keyboard installation clean and inspect on-device storage consumption Create a keyboard theme that seamlessly blends with your Android desktop aesthetic using dynamic live system wallpaper backgrounds. ### ๐Ÿ–ผ๏ธ Visual Personalization -- **Dynamic Wallpaper Integration**: Enable via **Settings โ†’ Appearance โ†’ Theme โ†’ Background โ†’ System Wallpaper**. The keyboard renders a blurred representation of your current home or lock screen wallpaper beneath the keys. +- **Dynamic Wallpaper Integration**: Enable via **Settings โ†’ Appearance โ†’ Use system wallpaper**. The keyboard renders a blurred representation of your current home or lock screen wallpaper beneath the keys. - **FastBlurEngine**: Powered by an optimized multi-threaded native stack blur engine that renders smoothly at 60/120 FPS without lag, dropped frames, or perceptible battery consumption. - **Adjustable Blur Intensity**: Fine-tune background diffusion using the blur radius slider, ranging from subtle frosted glass effects to deep, opaque tinting. - **Adaptive Key Contrast**: Key labels, borders, and functional glyphs automatically adapt their contrast and luminosity to ensure effortless legibility across light, dark, and vibrant wallpapers. @@ -1055,7 +1065,7 @@ LeanType's clipboard manager receives major productivity upgrades with floating ## 39. Granular Backup & Encrypted API Key Export -Safeguard your personalized keyboard configuration, custom layouts, and linguistic data with granular backup options and encrypted credential export (**Settings โ†’ Backup & restore**). +Safeguard your personalized keyboard configuration, custom layouts, and linguistic data with granular backup options and encrypted credential export (**Settings โ†’ Advanced โ†’ Backup and restore**). ### ๐Ÿ” Backup Flexibility & Security - **Modular Data Selection**: Choose exactly which components to include in your backup archive: @@ -1126,7 +1136,7 @@ Typing in East Asian languages receives streamlined punctuation handling via dee Manage and share your blocked words blacklist modularly without affecting other dictionary or layout data: ### ๐Ÿšซ Blacklist Management -- **Dedicated Import & Export**: Import and export your blocked words list directly under **Settings โ†’ Text correction โ†’ Blocked words blacklist**. +- **Dedicated Import & Export**: Import and export your blocked words list directly under **Settings โ†’ Languages & Layouts โ†’ Dictionaries โ†’ Blocked words**. - **Format Flexibility**: Supports plain word lists, language tags, and comment lines. - **Automatic Deduplication**: Duplicate entries and conflicting entries are automatically filtered upon import. @@ -1169,3 +1179,225 @@ Bubble: โ’ถโ’ทโ’ธโ’นโ’บโ’ปโ’ผโ’ฝโ’พโ’ฟโ“€โ“โ“‚โ“ƒโ“„โ“…โ“†โ“‡โ“ˆโ“‰โ“Šโ“‹โ“Œโ“ - Styled text can be converted back to plain text, including text styled with a custom font. - Live styling is never applied in password, email, URL, or non-text fields. - The styled characters are plain Unicode text, so they display correctly only where the receiving app has a font that includes them. + +--- + +## 47. Lite Builds & UI Language Packs + +Every release also ships English-only **Lite** APKs (`1-LeanType_-standard-lite-release.apk`, `2-LeanType_-offline-lite-release.apk`) for **Android 11 and newer**. They leave out the built-in UI translations, which makes them about 4 MB smaller. Typing languages, layouts and dictionaries are not affected: only the app's own text (settings, menus, keyboard panels) is. + +### Getting Your Language +- Open **Settings โ†’ Languages & Layouts โ†’ App translation**. The row appears when the app language has no built-in translation. +- **Standard Lite**: tap the row, then **Download translation** to fetch the pack for your language and build from [LeanType-Language-Packs](https://github.com/LeanBitLab/LeanType-Language-Packs/releases). +- **Offline Lite**: download the matching pack APK from that repository in a browser, then tap the row, **Import from file**, and pick the file. +- A pack is never installed as an app. LeanType loads it from its own storage and checks that it holds only translations. + +### After Updates +- Each pack is built for one exact app build. After an app update, the old pack no longer fits and is removed: download or import the pack for the new version. +- The regular APKs and the F-Droid build keep all languages built in and never need a pack. + +--- + +## 49. More Recent Additions + +- **Khipro Blinder mode (Bengali)**: In the Khipro layout, type `\` to pass Latin text through untransliterated until the next `;`. Type `;;` for a literal `;`. `?` does not start Blinder mode, since it ends Bengali questions. +- **Back to the main keyboard on reopen**: **Settings โ†’ Text correction โ†’ Switch to main keyboard afterโ€ฆ** now has a **Reopening the keyboard** option, so the keyboard always opens on the letters layout instead of the symbols or numpad layout you left it on. +- **What's New dialog**: After an update, LeanType shows what changed in the new version once. The same list is in **Settings โ†’ Updates**. +- **Restart keyboard**: **Settings โ†’ About โ†’ Restart keyboard** restarts the keyboard process and reloads all models, plugins and background services. + +--- + +## 48. Settings Map + +Every settings screen and the settings on it, generated from the settings code. Run `python3 tools/generate_settings_map.py` after changing settings; `--check` fails when this map or a `Settings โ†’ ...` path in the docs is out of date. + + + +```mermaid +graph LR + S(["Settings"]) + S --> g0{{"Keyboard"}} + g0 --> n_Languages["Languages & Layouts"] + n_Languages --> n_Layouts["Secondary layouts"] + n_Languages --> n_Dictionaries["Dictionaries"] + n_Dictionaries --> n_PersonalDictionaries["Personal dictionary"] + n_Dictionaries --> n_BlockedWords["Blocked words"] + g0 --> n_Appearance["Appearance"] + g0 --> n_Preferences["Preferences"] + n_Preferences --> n_Sound["Keypress Audio"] + g0 --> n_Toolbar["Toolbar"] + S --> g1{{"Typing"}} + g1 --> n_GestureTyping["Gestures & swipes"] + g1 --> n_TextCorrection["Text correction"] + g1 --> n_Suggestions["Suggestions"] + g1 --> n_TextExpander["Text Expander"] + S --> g2{{"Extras"}} + g2 --> n_AIIntegration["AI Integration"] + g2 --> n_Libraries["Plugins"] + n_Libraries --> n_OfflineVoice["Voice Input"] + n_Libraries --> n_Translation["Translation"] + n_Libraries --> n_Handwriting["Handwriting Input Plugin"] + n_Libraries --> n_OCR["Text Recognition (OCR)"] + n_Libraries --> n_Cjk["CJK Input"] + n_Libraries --> n_Gif["GIF Search"] + n_Libraries --> n_Storage["Storage & Cache"] + S --> g3{{"System"}} + g3 --> n_Advanced["Advanced"] + n_Advanced --> n_AppQuirks["App Profiles"] + n_Advanced --> n_BackgroundServices["Background Services"] + n_Advanced --> n_Debug["Debug settings"] + n_Advanced --> n_CustomAIKeys["Custom AI Keys"] + g3 --> n_Updates["Updates"] + g3 --> n_About["About"] +``` + +
Settings โ†’ Languages & Layouts (8) + +- Remember language per app, App Language +- App translation, Active Keyboards, Add language, Configuration, Secondary layouts, Dictionaries + +
+
Settings โ†’ Languages & Layouts โ†’ Secondary layouts (17) + +- Symbols, More symbols, Functional keys, Numbers, Number row, Numpad, Numpad (landscape), Phone, Phone symbols, Emoji bottom row, Clipboard bottom row, Text editing, Custom layout 1, Custom layout 2, Custom layout 3, Custom layout 4, Custom layout 5 + +
+
Settings โ†’ Languages & Layouts โ†’ Dictionaries (10) + +- "here", "Add dictionary from file", Personal dictionary, Blocked words, Clear learned words, Dictionary repository, Word learning, Add words to personal dictionary, Learning threshold, Languages & Layouts + +
+- **Settings โ†’ Languages & Layouts โ†’ Dictionaries โ†’ Personal dictionary** +- **Settings โ†’ Languages & Layouts โ†’ Dictionaries โ†’ Blocked words** +
Settings โ†’ Appearance (53) + +- Style, Colors, Key borders, Auto day/night mode, Colors (night), Set background image, Use system wallpaper, Theme and borders, Key corner radius, Functional key corner radius, Action key corner radius, Color navigation bar, Set background image (landscape), Background blur, Icon style, Customize icons, Clear clipboard icon +- **Size, layout & fonts**: Keyboard height scale, Enable split keyboard, Set custom font from file, Set custom emoji font from file, Custom text on space bar, Foldable & large display, Unfolded keyboard height, Split keyboard when unfolded, Unfolded split spacer scale, Unfolded bottom padding, Unfolded side padding, Keyboard sizing and fonts, Bottom padding scale, Side padding scale, Narrow key gaps, Narrowness level, Enable split keyboard (landscape), Split distance, Keyboard font scale, Secondary character font scale, Emoji view font scale, Use system emoji font, Show emoji description on long press, Scale emoji key size with font size +- **Key appearance & hints**: Show key hints, Select popup key order, Popup on keypress, Key popups and previews, Key popup width, Key popup height, Key popup corner radius, Long-press popup position, Animation scale, Select hint source, Show functional hints, Show TLD popup keys + +
+
Settings โ†’ Preferences (36) + +- **Input, sound & vibration**: Key long press delay, Default emoji skin tone, Emoji key, Keypress Audio, Vibrate on keypress, Keypress vibration duration, Haptics and vibration, Haptic feedback engine, Keypress vibration strength, Vibrate in do not disturb mode +- **Additional keys**: Number row, Language switch key, Change input method with space key, Secondary and layout keys, Localize number row, Localized numbers in popups, Show hints on number row, Show number row in symbols view, Compact symbols number row, Long press symbols key for numpad, Language switch key behavior, Direct Switch Target IME, Remove redundant popups, Show more letters with diacritics in popup, Customize currencies, Format for timestamp key +- **Window & floating modes**: Remember floating mode, Floating mode in landscape, Persist text editing mode +- **Clipboard history**: Enable clipboard history, History retention time, Don't keep passwords and codes, Clipboard behavior, Show pinned items on top, Fold pinned items by default, Clipboard history font scale + +
+
Settings โ†’ Preferences โ†’ Keypress Audio (20) + +- "here", Sound on keypress, Keypress sound volume, Sound Pack, Keypress sound style, Active Pack Info, Acoustics & Playback, Pitch Shift, Random pitch variation, Spatial stereo panning, Dynamic typing velocity, Key Sound Balance, Spacebar volume, Backspace volume, Enter key volume, Modifiers volume (Shift & Symbols), System & Profiles, Mute in silent/vibrate mode, Mute in Do Not Disturb, Play custom sounds over Bluetooth + +
+
Settings โ†’ Toolbar (22) + +- Toolbar mode, Split toolbar, Select toolbar keys, Select pinned toolbar keys, Select clipboard toolbar keys, Custom text styles, Show download button in toolbar, Toolbar behavior, Auto-span toolbar keys, Toolbar keys alignment, Pin toolbar key on long press, Auto show toolbar on open, Auto show toolbar on select, Auto hide toolbar, Auto show toolbar when no suggestions, Auto hide pinned keys, Remember toolbar state, Show long-press hint pills, Customize toolbar key codes, Show only toolbar with physical keyboard, Variable toolbar direction, Hide clipboard and emoji toolbars too + +
+
Settings โ†’ Gestures & swipes (24) + +- **Configuration**: Enable gesture typing, Load gesture typing library +- **Visuals & Preview**: Show gesture trail, Floating preview, Gesture typing, Dynamic floating preview, Gesture trail lifespan, Phrase gesture, Rapid typing cooldown, Autospace before gesture typing a word, Autospace after gesture typing a word +- **Advanced Gestures**: Horizontal spacebar swipe gesture, Delete swipe, Delete word by word, Full keyboard swipe gesture, Full-screen touchpad, Swipe gestures and touchpad, Horizontal swipe threshold, Vertical swipe threshold, Vertical up spacebar swipe gesture, Vertical down spacebar swipe gesture, Toolbar swipe up gesture, Toolbar swipe down gesture, Touchpad sensitivity + +
+
Settings โ†’ Text correction (22) + +- **Corrections**: Block offensive words, Auto-correction, Auto-correction aggressiveness, Auto-correct on, Backspace reverts autocorrect, Auto-correct indicator underline, Holding delete removes whole words, Auto-correction confidence, More auto-correction, Auto-correct shortcuts, Auto-capitalization, Force auto-capitalization, Shift changes capitalization of typed word +- **Space**: Double-space period, Auto-pair symbols, Autospace after punctuation, Autospace after emoji, Autospace after picking a suggestion, Immediate auto-space, No autospace when pressing shift, Preserve space before punctuation, Switch to main keyboard afterโ€ฆ + +
+
Settings โ†’ Suggestions (22) + +- **Suggestions strip**: Show correction suggestions, Always show suggestions, Donโ€™t always show suggestions for web edit fields, Number of suggestions, Always use middle suggestion, Always show typed word in the middle, Punctuation suggestions +- **Prediction & learning**: Next-word suggestions, Suggestion balance, Personalized suggestions, Clear learned words, Prediction details, Prioritize personal & learned words, Require context match for learned words, Disable multi-word suggestions +- **Smart suggestions & tools**: Suggest emojis, Inline emoji search, Suggest clipboard content, Suggest recent screenshots, Compress screenshot suggestions, Inline math calculation, Look up app names + +
+
Settings โ†’ Text Expander (11) + +- "here", Configuration, Enable Text Expander, Expand immediately, Backspace undoes expansion, Show in suggestions, Autocomplete shortcuts, Suggestion only (no auto-expand), Management & Tools, Bulk editor, Online Guide & Syntax Reference + +
+
Settings โ†’ AI Integration (16) + +- AI Provider, Custom AI Keys, API Token, Model, Translation Model, Voice Model, Cloud AI Max Tokens, Gemini API Key, Gemini Model, API Endpoint, Use max_completion_tokens, Omit temperature, Allow insecure connections +- Offline AI Plugin, Offline Model, Keep model loaded + +
+
Settings โ†’ Plugins (13) + +- Active Engines & Capabilities, Offline AI Plugin, Handwriting Input Plugin, Text Recognition (OCR), Voice Input, Translation, CJK Input, GIF Search, Keypress Audio, Storage & Maintenance, Storage & Cache, Documentation, Features Guide + +
+
Settings โ†’ Plugins โ†’ Voice Input (11) + +- "here", Voice Plugin, Voice Input Provider, AI Provider & Voice Model, Manage On-Screen Keyboards, Disabled, Permissions, Microphone Permission, Manage & Download Models, Dictation & Behavior, Performance & Advanced + +
+
Settings โ†’ Plugins โ†’ Translation (7) + +- Downloadingโ€ฆ, Translation target language, Translation source language, Plugin Management, Load translation plugin, Offline Models, Offline Translation Models + +
+
Settings โ†’ Plugins โ†’ Handwriting Input Plugin (6) + +- Load handwriting plugin, Plugin Management, Handwriting Plugin, Configuration, Offline Models, Handwriting Models + +
+
Settings โ†’ Plugins โ†’ Text Recognition (OCR) (20) + +- Downloading plugin..., "here", Text Recognition Settings, Plugin management, OCR Plugin APK, Permissions, Camera permission, Text extraction & formatting, Preserve line breaks, Trim extra whitespace, De-hyphenate broken words, Normalize punctuation & quotes, Strip list bullets & markers, Filter stray noise characters, Workflow & automation, Auto-copy to clipboard, Auto-insert into input field, Suggest text extraction from screenshots, Camera & viewfinder, Remember flash state + +
+
Settings โ†’ Plugins โ†’ CJK Input (11) + +- Downloading CJK pluginโ€ฆ, "here", Plugin Management, Load CJK companion plugin, Supported Languages, Chinese (Pinyin), Japanese (Romaji to Kana/Kanji), Korean (Hangul), Engine Utilities, Enable Mock Engine (Debug), Clear CJK User History + +
+
Settings โ†’ Plugins โ†’ GIF Search (4) + +- "here", Plugin Status, Preview, Available Providers + +
+- **Settings โ†’ Plugins โ†’ Storage & Cache** +
Settings โ†’ Advanced (23) + +- Force incognito mode, App Profiles, Background Services, Backup and restore, Enable debug settings, Debug settings, Physical keyboards and experimental, Physical keyboard layout, Emoji for physical keyboard, Physical keyboard suggestion shortcuts +- **Experimental**: Override Emoji version, URL detection +- "here", Downloadingโ€ฆ, Translation source language, Translation target language, Offline AI Plugin, System Instruction, Translate System Instruction, Temperature, Top-P (Nucleus Sampling), Top-K, Min-P + +
+
Settings โ†’ Advanced โ†’ App Profiles (12) + +- Always show suggestions, Hide suggestion strip, Hide toolbar, Selection-based word replacement, Web Editor Compatibility, Automatic Incognito, Force Non-Incognito, Strip No-Enter Flag, Force Direct Text Commit, Allow Symbol Composing, Disable Auto-Spacing, Allow on Non-Editable Fields + +
+
Settings โ†’ Advanced โ†’ Background Services (3) + +- Spell Checker Service, Clipboard Listener, App Launcher Sync + +
+
Settings โ†’ Advanced โ†’ Debug settings (6) + +- Enable debug settings, Debug Mode, Show suggestion infos, Force non-distinct multitouch, Show slide indicator +- "here" + +
+
Settings โ†’ Advanced โ†’ Custom AI Keys (2) + +- "here", Show tags on keyboard + +
+
Settings โ†’ Updates (5) + +- "here", GitHub Sponsors, Donate on Open Collective, Check for updates, Companion plugins + +
+
Settings โ†’ About (8) + +- Setup wizard, Version, Restart keyboard, Open-source license, Description of hidden features, Go to FEATURES.md, View on GitHub, Save log + +
+ + diff --git a/tools/generate_settings_map.py b/tools/generate_settings_map.py new file mode 100644 index 0000000000..06053c4b71 --- /dev/null +++ b/tools/generate_settings_map.py @@ -0,0 +1,323 @@ +#!/usr/bin/env python3 +"""Generate the settings map in docs/FEATURES.md from the settings code, and check doc paths. + +The map (screen graph plus the settings on each screen) is built from: +- settings/SettingsNavHost.kt: which screen opens which (navController.navigate calls), +- navigateTo(SettingsDestination.X) calls inside screen files, +- the ordered `items` lists of each screen (category headers and setting keys), +- Setting(context, KEY, R.string.title) definitions and the base strings.xml. + +Usage: + python3 tools/generate_settings_map.py rewrite the map section in docs/FEATURES.md + python3 tools/generate_settings_map.py --check exit 1 if the map is stale or a doc path + ("Settings โ†’ A โ†’ B") names no existing screen/setting +""" +import html +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +SETTINGS = ROOT / "app/src/main/java/helium314/keyboard/settings" +STRINGS = ROOT / "app/src/main/res/values/strings.xml" +FEATURES = ROOT / "docs/FEATURES.md" +DOCS = [ROOT / "README.md", FEATURES] +START = "" +END = "" + +# screens whose title is not a plain `title = stringResource(...)` in their composable +TITLE_OVERRIDES = { + "AppQuirks": "app_quirks_title", + "BackgroundServices": "background_services_title", + "Dictionaries": "dictionary_settings_category", + "Gif": "gif_settings_title", + "Sound": "sound_packs_title", + "OfflineVoice": "voice_input_title", + "OCR": "ocr_title", + "Translation": "translation_settings_title", + "Handwriting": "libraries_hub_handwriting_title", + "Cjk": "cjk_settings_title", + "Storage": "libraries_storage_cache_title", + "TextExpander": "text_expander_title", + "Layouts": "settings_screen_secondary_layouts", + "PersonalDictionaries": "edit_personal_dictionary", + "BlockedWords": "edit_blocked_words", + "CustomAIKeys": "custom_ai_keys_title", +} +# screens not worth listing (dialogs/editors reached from lists, duplicates) +SKIP = {"Settings", "CustomAIKeyConfig", "PersonalDictionary", "ColorsNight", "Subtype", "LanguagesList"} + + +def load_strings(): + text = STRINGS.read_text(encoding="utf-8") + out = {} + for name, value in re.findall(r']*>(.*?)', text, re.S): + if "@string/" in value: + continue + out[name] = html.unescape(re.sub(r"\\(.)", r"\1", value)).strip() + return out + + +def block_after(text, start): + """Text of the balanced (...) block starting at the first '(' at or after start.""" + i = text.index("(", start) + depth = 0 + for j in range(i, len(text)): + if text[j] == "(": + depth += 1 + elif text[j] == ")": + depth -= 1 + if depth == 0: + return text[i + 1:j] + return text[i + 1:] + + +def expression_after(text, i): + """A Kotlin call expression starting at i, e.g. `remember(a) { buildList { ... } }`.""" + m = re.match(r"[\w.]*\s*", text[i:]) + j = i + m.end() + out_start = j + while j < len(text) and text[j] in "({": + depth = 0 + for k in range(j, len(text)): + if text[k] in "({": + depth += 1 + elif text[k] in ")}": + depth -= 1 + if depth == 0: + break + j = k + 1 + while j < len(text) and text[j] in " \t\n": + j += 1 + return text[out_start:j] + + +def build(): + S = load_strings() + kt = {f: f.read_text(encoding="utf-8") for f in SETTINGS.rglob("*.kt")} + defre = re.compile(r"Setting\(\s*context,\s*([\w.]+),\s*R\.string\.(\w+)") + key_title = {} + for t in kt.values(): + for k, s in defre.findall(t): + if s in S: + key_title.setdefault(k.split(".")[-1], S[s]) + fun_file = {} + for f, t in kt.items(): + for fn in re.findall(r"^fun (\w+)\(", t, re.M): + fun_file[fn] = f + + nav = kt[SETTINGS / "SettingsNavHost.kt"] + dest_fun, edges = {}, {} + parts = re.split(r"composable\(SettingsDestination\.(\w+)", nav) + for dest, body in zip(parts[1::2], parts[2::2]): + m = re.search(r"(\w+Screen)\(", body) + if m and dest not in dest_fun: + dest_fun[dest] = m[1] + edges.setdefault(dest, []) + for child in re.findall(r"navigate\(SettingsDestination\.(\w+)", body): + if child not in edges[dest]: + edges[dest].append(child) + + def file_of(dest): + return fun_file.get(dest_fun.get(dest, "")) + + for dest in list(dest_fun): + f = file_of(dest) + if not f: + continue + for child in re.findall(r"navigateTo\(SettingsDestination\.(\w+)\)", kt[f]): + if child != dest and child not in edges[dest]: + edges[dest].append(child) + + def title(dest): + if dest in TITLE_OVERRIDES and TITLE_OVERRIDES[dest] in S: + return S[TITLE_OVERRIDES[dest]] + f = file_of(dest) + if f: + t = kt[f] + i = t.find(f"fun {dest_fun[dest]}(") + m = re.search(r"title = stringResource\(R\.string\.(\w+)\)", t[i:]) + if m: + return S.get(m[1], m[1]) + return dest + + def items(dest): + """Ordered (category, [settings]) of a screen: its `items`/`settings` list, then other named rows.""" + f = file_of(dest) + if not f: + return [] + t = kt[f] + # the screen composable plus the private composables of its file (e.g. flavor variants) + bodies = [] + for m in re.finditer(r"^(private )?fun (\w+)\(", t, re.M): + if m[2] == dest_fun[dest] or (m[1] and "Preview" not in m[2]): + end = t.find("\nfun ", m.end()) + nxt = t.find("\nprivate fun ", m.end()) + end = min(e for e in (end, nxt, len(t)) if e > 0) + bodies.append(t[m.start():end]) + groups, seen = [], set() + for body in bodies: + for m in re.finditer(r"\b(?:val items|settings)\s*=\s*", body): + blk = expression_after(body, m.end()) + toks = re.findall(r"R\.string\.(settings_category_\w+)|(?:Settings|SettingsWithoutKey)\.(\w+)", blk) + cur = ["", []] + for cat, key in toks: + if cat: + if cur[1]: + groups.append(cur) + cur = [S.get(cat, cat), []] + elif key in key_title and key_title[key] not in seen: + seen.add(key_title[key]) + cur[1].append(key_title[key]) + if cur[1]: + groups.append(cur) + # rows and cards drawn directly (not Setting objects) + extra = [] + # preference composables, e.g. LanguagePackPreference: their first stringResource is the row name + for fn in re.findall(r"\b(\w+Preference)\(", body): + pf = fun_file.get(fn) + if pf and "/preferences/" in str(pf): + pt = kt[pf][kt[pf].find(f"fun {fn}("):] + m2 = re.search(r"stringResource\(R\.string\.(\w+)\)", pt) + if m2 and S.get(m2[1]) and S[m2[1]] not in seen: + seen.add(S[m2[1]]) + extra.append(S[m2[1]]) + for sid in re.findall(r"(?:name|title) = stringResource\(R\.string\.(\w+)\)|PreferenceCategory\(stringResource\(R\.string\.(\w+)\)", body): + sid = sid[0] or sid[1] + label = S.get(sid) + if label and label not in seen and label != title(dest) and len(label) <= 60: + seen.add(label) + extra.append(label) + if "LayoutType.entries" in body: # one row per secondary layout type + lt = (ROOT / "app/src/main/java/helium314/keyboard/latin/utils/LayoutType.kt").read_text(encoding="utf-8") + for sid in re.findall(r"R\.string\.(\w+)", lt)[1:]: + if S.get(sid) and S[sid] not in seen: + seen.add(S[sid]) + extra.append(S[sid]) + if extra: + groups.append(["", extra]) + return groups + + # main screen: groups and their entries, in the order of MainSettingsScreen + main = kt[fun_file["MainSettingsScreen"]] + title_dest = {} + for dest in edges.get("Settings", []) + ["TextExpander"]: + title_dest[title(dest)] = dest + groups, cur = [], None + for gid, sid in re.findall(r"R\.string\.(settings_group_\w+)|name = stringResource\(R\.string\.(\w+)\)", main): + if gid: + cur = [S.get(gid, gid), []] + groups.append(cur) + elif cur is not None and S.get(sid) in title_dest: + d = title_dest[S[sid]] + if d not in cur[1]: + cur[1].append(d) + return {"groups": groups, "edges": edges, "title": title, "items": items} + + +def render(model): + title, edges, items = model["title"], model["edges"], model["items"] + out = [START, "", "```mermaid", "graph LR"] + out.append(' S(["Settings"])') + seen, order = set(), [] + + def nid(d): + return "n_" + d + + def walk(d, parent_path): + if d in seen or d in SKIP: + return + seen.add(d) + path = parent_path + [title(d)] + order.append((d, path)) + for c in edges.get(d, []): + if c not in seen and c not in SKIP: + out.append(f' {nid(d)} --> {nid(c)}["{title(c)}"]') + walk(c, path) + + for gi, (gname, dests) in enumerate(model["groups"]): + g = f"g{gi}" + out.append(f' S --> {g}{{{{"{gname}"}}}}') + for d in dests: + out.append(f' {g} --> {nid(d)}["{title(d)}"]') + walk(d, []) + out += ["```", ""] + for d, path in order: + groups = items(d) + count = sum(len(s) for _, s in groups) + label = "Settings โ†’ " + " โ†’ ".join(path) + if not groups: + out.append(f"- **{label}**") + continue + out.append(f"
{label} ({count})") + out.append("") + for cat, sets in groups: + out.append(f"- {'**' + cat + '**: ' if cat else ''}{', '.join(sets)}") + out.append("") + out.append("
") + out += ["", END] + return "\n".join(out) + + +def known_labels(model): + """Map screen title -> set of labels allowed after it in a path.""" + title, edges, items = model["title"], model["edges"], model["items"] + allowed = {} + for d in edges: + labels = {title(c).lower() for c in edges.get(d, [])} + for cat, sets in items(d): + labels |= {cat.lower()} | {s.lower() for s in sets} + allowed.setdefault(title(d).lower(), set()).update(labels) + top = {title(d).lower() for _, ds in model["groups"] for d in ds} + return top, allowed + + +def check_paths(model): + top, allowed = known_labels(model) + bad = [] + pat = re.compile(r"\*\*Settings\s*(?:โ†’|->)\s*([^*\n]+)\*\*|`((?:[A-Z][^`>\n]*? > )+[^`\n]+)`|\*\*([A-Z][^*\n]*?(?:โ†’|->)[^*\n]+)\*\*") + for doc in DOCS: + for n, line in enumerate(doc.read_text(encoding="utf-8").splitlines(), 1): + if START in line: + break # the generated map itself + for m in pat.finditer(line): + segs = [s.strip() for s in re.split(r"โ†’|->| > ", m[1] or m[2] or m[3]) if s.strip()] + if segs and segs[0] == "Settings": + segs = segs[1:] + if not segs or (not m[1] and segs[0].lower() not in top): + continue # a backtick path that is not a settings path (e.g. a key sequence) + prev, ok = None, True + for s in segs: + s_l = s.lower() + if prev is None: + ok = s_l in top + else: + ok = s_l in allowed.get(prev, set()) + if not ok: + bad.append(f"{doc.relative_to(ROOT)}:{n}: '{s}' in '{' โ†’ '.join(segs)}'") + break + prev = s_l if s_l in allowed else prev + return bad + + +def main(): + model = build() + section = render(model) + text = FEATURES.read_text(encoding="utf-8") + if START not in text: + sys.exit(f"{FEATURES.relative_to(ROOT)} has no settings map markers") + current = text[text.index(START):text.index(END) + len(END)] + if "--check" in sys.argv: + problems = [] + if current != section: + problems.append("settings map in docs/FEATURES.md is stale: run python3 tools/generate_settings_map.py") + problems += check_paths(model) + for p in problems: + print(p) + sys.exit(1 if problems else 0) + FEATURES.write_text(text.replace(current, section), encoding="utf-8") + print("settings map updated") + + +if __name__ == "__main__": + main() From ed38d23ef6a005d6f22a948773e9fca651cd50df Mon Sep 17 00:00:00 2001 From: LeanBitLab Date: Sun, 22 Nov 2026 19:53:15 +0530 Subject: [PATCH 4/4] chore: ignore Python caches --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 30873914ff..6fd494ff92 100755 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,7 @@ CLAUDE.local.md .codex/ .kiro/ .github/copilot-instructions.md + +# Python caches +__pycache__/ +*.pyc