The PK settings UI should show subtype labels instead of the subtype's language names.

1. Use InputMethodSubtype#getDisplayName()
2. Sorting by label

Video: https://screencast.googleplex.com/cast/NjEzMjM3OTI0OTgwMzI2NHxiODBhNjQzZi1kZA

Bug: 271504879
Test: manual
Change-Id: Ia2be6f3a007c678e62bdda21fe20d95a2b304d70
This commit is contained in:
danielwbhuang
2023-03-07 21:43:33 +08:00
parent 541a7153a5
commit a6b78f6d01
3 changed files with 49 additions and 37 deletions

View File

@@ -72,24 +72,28 @@ public class NewKeyboardSettingsUtils {
}
static class KeyboardInfo {
String mLanguage;
CharSequence mSubtypeLabel;
String mLayout;
InputMethodInfo mInputMethodInfo;
InputMethodSubtype mInputMethodSubtype;
KeyboardInfo(
String language,
CharSequence subtypeLabel,
String layout,
InputMethodInfo inputMethodInfo,
InputMethodSubtype inputMethodSubtype) {
mLanguage = language;
mSubtypeLabel = subtypeLabel;
mLayout = layout;
mInputMethodInfo = inputMethodInfo;
mInputMethodSubtype = inputMethodSubtype;
}
String getLanguage() {
return mLanguage;
String getPrefId() {
return mInputMethodInfo.getId() + "_" + mInputMethodSubtype.hashCode();
}
CharSequence getSubtypeLabel() {
return mSubtypeLabel;
}
String getLayout() {