zero-Symbol-input-view is an Android symbol-input module for code and text editing apps.
It provides a production-ready symbol drawer + management system built around Sora CodeEditor,
with support for grouped paging, gesture-controlled drawer states, configurable indicators,
and import/export of symbol configuration JSON.
This module is designed for scenarios where users frequently input symbols, templates, and editing actions (e.g., cursor movement, line actions, clipboard actions) while writing code.
Compared with a plain soft keyboard symbol row, this module offers:
- multi-group symbol organization
- tap/long-press dual behavior per symbol
- stable drawer interaction (collapse/expand + drag)
- visual group indicators (tab/line/dot/block/hidden)
- full symbol data lifecycle management
- Grouped symbol pages with horizontal switching
- Adjustable collapsed/expanded layout model
- Gesture-based expand/collapse behavior
- Per-symbol click and long-click action dispatch
- Remembered expanded state and remembered last page (optional)
- Multiple indicator styles:
- Standard tab indicator
- Minimal compact dots (bottom)
- Hidden indicator
- Top line indicator
- Block indicator (bottom)
- Group CRUD (add/edit/delete/reorder)
- Symbol CRUD (add/edit/copy/move/delete)
- Batch operations
- Import/export via clipboard and file
- Settings panel for rows, per-row count, indicator style, behavior toggles
Each symbol can map to:
- short-press action
- optional long-press action
- action payload text (insert content / custom text)
Action execution is delegated through SymbolActionExecutor to the bound editor instance.
-
Supports direct import of JSON files from the MT Manager symbol input toolbar
-
Similar to importing, JSON files exported from zero-Symbol-input-view can also be directly used in the MT Manager symbol input toolbar
-
Mostly the same design as MT Manager.
- View layer
AdvancedSymbolInputViewGroupIndicatorBar- compact bottom indicator view
SymbolPageGridView
- Data/model layer
SymbolGroup,SymbolItem,SymbolUiSettings
- Persistence layer
SymbolDataManager(SharedPreferences + JSON)
- Behavior layer
SymbolActionExecutor(editor action routing)
- Data-driven UI: group/symbol rendering is generated from persisted JSON data.
- Interaction consistency: drawer height uses unified row-height formulas.
- Extensibility: indicator styles and symbol actions are decoupled from core paging.
- Compatibility: keeps legacy integration points (e.g.,
followSystemIme) while using the new internal drawer model.
Indicator rendering is style-based:
- tab-like styles render in the top indicator bar
- compact styles render at the drawer bottom
- hidden style suppresses indicator UI
This avoids forcing a single indicator paradigm for all UX requirements.
settings.gradle.kts
include(":zero-Symbol-input-view")build.gradle.kts
dependencies {
implementation(project(":zero-Symbol-input-view"))
}<android.zero.studio.widget.editor.symbolinput.AdvancedSymbolInputView
android:id="@+id/symbol_input_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />val symbolInputView = findViewById<android.zero.studio.widget.editor.symbolinput.AdvancedSymbolInputView>(R.id.symbol_input_view)
val editor = findViewById<io.github.rosemoe.sora.widget.CodeEditor>(R.id.editor)
symbolInputView.bindEditor(editor)
symbolInputView.onOpenManagerListener = {
startActivity(Intent(this, android.zero.studio.widget.editor.symbolinput.SymbolManagerActivity::class.java))
}
override fun onResume() {
super.onResume()
symbolInputView.onHostResume()
}
// reload after settings/data changes
symbolInputView.refreshData()The module supports JSON import/export and is compatible with symbol-config workflows commonly used by MT-style editor toolbars.
Recommended practice:
- version and back up symbol JSON files
- keep shared team presets under VCS
- validate imported data before production rollout
zero-Symbol-input-view/
└── src/main/
├── kotlin/android/zero/studio/widget/editor/symbolinput/
│ ├── AdvancedSymbolInputView.kt
│ ├── SymbolManagerActivity.kt
│ ├── SymbolData.kt
│ ├── SymbolDataManager.kt
│ └── SymbolActionExecutor.kt
└── res/
AdvancedSymbolInputView.followSystemImeis retained for legacy integration compatibility.- If you migrate from an older bottom-sheet based implementation, call
refreshData()after migration.