Skip to content

Commit f30f199

Browse files
4di-helloclaude
andcommitted
Typing heatmap: readable layout names and a note on separate learning
Show "Deutsch (Qwertz) · Landscape" instead of the internal id like "custom.Latn.1880uw1k6y. (landscape)", and explain that each way of holding the keyboard (normal, one-handed, floating, landscape) is learned separately. Display only, the stored data is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VuiaMhLXwhErf9shhrr1uD
1 parent 7937b1c commit f30f199

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

‎app/src/main/java/helium314/keyboard/settings/screens/TypingHeatmapScreen.kt‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ import helium314.keyboard.latin.R
4848
import helium314.keyboard.latin.heatmap.TypingHeatmap
4949
import helium314.keyboard.latin.settings.Defaults
5050
import helium314.keyboard.latin.settings.Settings
51+
import helium314.keyboard.latin.utils.SubtypeLocaleUtils
52+
import helium314.keyboard.latin.utils.SubtypeSettings
53+
import helium314.keyboard.latin.utils.locale
54+
import helium314.keyboard.latin.utils.mainLayoutName
5155
import helium314.keyboard.latin.utils.prefs
5256
import helium314.keyboard.settings.SearchSettingsScreen
5357
import helium314.keyboard.settings.dialogs.ConfirmationDialog
@@ -112,10 +116,11 @@ fun TypingHeatmapScreen(onClickBack: () -> Unit) {
112116
FilterChip(
113117
selected = it.id == layout.id,
114118
onClick = { selectedLayoutId = it.id },
115-
label = { Text(it.id) }
119+
label = { Text(layoutLabel(it.id)) }
116120
)
117121
}
118122
}
123+
Text(stringResource(R.string.typing_heatmap_views), style = MaterialTheme.typography.bodySmall)
119124
}
120125
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
121126
FilterChip(selected = !onlyMisses, onClick = { onlyMisses = false },
@@ -214,6 +219,27 @@ fun TypingHeatmapScreen(onClickBack: () -> Unit) {
214219
}
215220
}
216221

222+
/** Readable name for a layout id like "custom.Latn.xyz. (landscape) (one-handed)", e.g. "Deutsch (Qwertz) · Querformat" */
223+
@Composable
224+
private fun layoutLabel(id: String): String {
225+
var main = id
226+
val modes = mutableListOf<String>()
227+
for ((suffix, res) in listOf(" (floating)" to R.string.typing_heatmap_view_floating,
228+
" (one-handed)" to R.string.typing_heatmap_view_one_handed, " (landscape)" to R.string.typing_heatmap_view_landscape)) {
229+
if (main.endsWith(suffix)) {
230+
main = main.removeSuffix(suffix)
231+
modes.add(0, stringResource(res))
232+
}
233+
}
234+
val name = (SubtypeLocaleUtils.getMainLayoutDisplayName(main) ?: main).replaceFirstChar { it.uppercase() }
235+
val language = remember(main) {
236+
SubtypeSettings.getEnabledSubtypes().firstOrNull { it.mainLayoutName() == main }
237+
?.let { SubtypeLocaleUtils.getSubtypeLanguageDisplayName(it.locale()) }
238+
}
239+
val base = if (language == null || name.contains(language, ignoreCase = true)) name else "$language ($name)"
240+
return (listOf(base) + modes).joinToString(" · ")
241+
}
242+
217243
private fun cp(code: Int) = if (Character.isValidCodePoint(code)) String(Character.toChars(code)) else "?"
218244

219245
@Composable

‎app/src/main/res/values-de/strings.xml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,6 +1812,10 @@ Ermöglicht lokale GGUF / llama.cpp-Inferenz für Korrekturlesen und Umschreiben
18121812
<string name="adapt_to_typing_summary">Lernen, wo Du die Tasten triffst, und an Tastengrenzen die gemeinte Taste erkennen, auch für die Autokorrektur. Eine Taste wird angepasst, sobald sie 30 Anschläge hat. Nur lokal gespeichert, keine Cloud, keine Übertragung</string>
18131813
<string name="typing_heatmap_title">Tipp-Heatmap</string>
18141814
<string name="typing_heatmap_no_data">Noch keine Daten. Schalte \"An mein Tippen anpassen\" ein und tippe wie gewohnt ein paar Sätze. Mit Gesten oder im Inkognito-Modus getippte Wörter werden nicht aufgezeichnet.</string>
1815+
<string name="typing_heatmap_views">Die Tastatur lernt für jede Ansicht getrennt, weil Du sie unterschiedlich hältst: normal, Einhand, schwebend und Querformat.</string>
1816+
<string name="typing_heatmap_view_one_handed">Einhand</string>
1817+
<string name="typing_heatmap_view_floating">Schwebend</string>
1818+
<string name="typing_heatmap_view_landscape">Querformat</string>
18151819
<string name="typing_heatmap_all_touches">Alle Anschläge</string>
18161820
<string name="typing_heatmap_only_misses">Nur Fehltreffer</string>
18171821
<string name="typing_heatmap_stats">%1$d Anschläge, %2$d Fehltreffer (%3$.1f %%)</string>

‎app/src/main/res/values/strings.xml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,6 +2497,10 @@ New dictionary:
24972497
<string name="adapt_to_typing_summary">Learn where you touch the keys and recognize the key you meant near key borders, also for autocorrection. A key is adapted once it has 30 touches. Stored only locally, no cloud, no transfer</string>
24982498
<string name="typing_heatmap_title">Typing heatmap</string>
24992499
<string name="typing_heatmap_no_data">No data yet. Enable \"Adapt to my typing\" and type a few sentences as usual. Words typed with gestures or in incognito mode are not recorded.</string>
2500+
<string name="typing_heatmap_views">The keyboard learns separately for each way you hold it: normal, one-handed, floating and landscape.</string>
2501+
<string name="typing_heatmap_view_one_handed">One-handed</string>
2502+
<string name="typing_heatmap_view_floating">Floating</string>
2503+
<string name="typing_heatmap_view_landscape">Landscape</string>
25002504
<string name="typing_heatmap_all_touches">All touches</string>
25012505
<string name="typing_heatmap_only_misses">Only misses</string>
25022506
<string name="typing_heatmap_stats">%1$d touches, %2$d misses (%3$.1f %%)</string>

0 commit comments

Comments
 (0)