Modify PK Settings page to make it more user friendly
PK Settings page:
- Show current PK layout selected for the current user profile and current IME language instead of a list of IMEs
PK layout mapping page:
- Show IME name in header only if multiple active IMEs
- Show the PK layout selection criteria (Automatic v/s User selected)
Bug: 325925410
Bug: 326195401
Test: manual
Change-Id: I93a2e169742a800fa116fa5d55e1a91e5548cebb
This commit is contained in:
@@ -280,19 +280,11 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
|
||||
final Preference pref = new Preference(getPrefContext());
|
||||
pref.setTitle(hardKeyboardDeviceInfo.mDeviceName);
|
||||
if (mIsNewKeyboardSettings) {
|
||||
List<String> suitableImes = new ArrayList<>();
|
||||
suitableImes.addAll(
|
||||
NewKeyboardSettingsUtils.getSuitableImeLabels(
|
||||
getContext(), mImm, UserHandle.myUserId()));
|
||||
if (!suitableImes.isEmpty()) {
|
||||
String summary = suitableImes.get(0);
|
||||
StringBuilder result = new StringBuilder(summary);
|
||||
for (int i = 1; i < suitableImes.size(); i++) {
|
||||
result.append(", ").append(suitableImes.get(i));
|
||||
}
|
||||
pref.setSummary(result.toString());
|
||||
} else {
|
||||
pref.setSummary(hardKeyboardDeviceInfo.mLayoutLabel);
|
||||
String currentLayout =
|
||||
NewKeyboardSettingsUtils.getSelectedKeyboardLayoutLabelForUser(getContext(),
|
||||
UserHandle.myUserId(), hardKeyboardDeviceInfo.mDeviceIdentifier);
|
||||
if (currentLayout != null) {
|
||||
pref.setSummary(currentLayout);
|
||||
}
|
||||
pref.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
|
||||
Reference in New Issue
Block a user