CleverKeys provides an Android Quick Settings tile that allows users to quickly access the keyboard switcher from the notification shade. Tapping the tile opens the system input method picker, providing a convenient way to switch between keyboards without navigating to system settings.
| File | Class/Function | Purpose |
|---|---|---|
src/main/kotlin/tribixbite/cleverkeys/KeyboardTileService.kt |
KeyboardTileService |
TileService implementation |
AndroidManifest.xml |
Service registration | Declares tile service |
Quick Settings Panel
|
v (user taps tile)
+------------------+
| KeyboardTile | -- Android calls onClick()
| Service |
+------------------+
|
v
+------------------+
| showInputMethod | -- Opens system IME picker
| Picker() |
+------------------+
|
v (fallback)
+------------------+
| Open Input | -- If picker fails, opens settings
| Method Settings |
+------------------+
@RequiresApi(Build.VERSION_CODES.N)
class KeyboardTileService : TileService() {
// Called when Quick Settings panel opens
override fun onStartListening() {
updateTileState()
}
// Called when user taps the tile
override fun onClick() {
showInputMethodPicker()
}
// Called when user adds tile to panel
override fun onTileAdded() {
updateTileState()
}
// Update tile visual state
private fun updateTileState() {
qsTile?.apply {
state = if (isCleverKeysActive()) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE
updateTile()
}
}
// Show system input method picker
private fun showInputMethodPicker() {
val imm = getSystemService(InputMethodManager::class.java)
imm?.showInputMethodPicker()
}
}| State | Condition | Visual |
|---|---|---|
STATE_ACTIVE |
CleverKeys is current input method | Highlighted/colored |
STATE_INACTIVE |
Another keyboard is active | Dimmed/gray |
private fun isCleverKeysActive(): Boolean {
val currentIme = Settings.Secure.getString(
contentResolver,
Settings.Secure.DEFAULT_INPUT_METHOD
)
return currentIme?.contains(packageName) == true
}If InputMethodManager.showInputMethodPicker() fails:
private fun showInputMethodPicker() {
try {
val imm = getSystemService(InputMethodManager::class.java)
imm?.showInputMethodPicker()
} catch (e: Exception) {
// Fallback: open system input method settings
val intent = Intent(Settings.ACTION_INPUT_METHOD_SETTINGS)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
startActivity(intent)
}
}<service
android:name="tribixbite.cleverkeys.KeyboardTileService"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:exported="true">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE"/>
</intent-filter>
</service>- Android 7.0 (API 24) or higher (TileService introduced in API 24)
- CleverKeys must be installed and enabled as an input method
- User must manually add tile to Quick Settings panel
- Pull down notification shade
- Tap "Edit" or pencil icon to customize tiles
- Find "CleverKeys" in available tiles
- Drag to active tiles area
- Tile now appears in Quick Settings
- Tap tile → system IME picker appears → select keyboard