Add label for default keyboard layout.

Bug: 6110399
Change-Id: I2431b99884cbd01de32f8cd6c14a3afbd18b5020
This commit is contained in:
Jeff Brown
2012-04-17 13:55:15 -07:00
parent afdadec674
commit 512d0cb3eb
3 changed files with 10 additions and 2 deletions

View File

@@ -420,6 +420,8 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
pref.setTitle(device.getName());
if (keyboardLayout != null) {
pref.setSummary(keyboardLayout.getLabel());
} else {
pref.setSummary(R.string.keyboard_layout_default_label);
}
pref.setIntent(intent);
mHardKeyboardPreferenceList.add(pref);

View File

@@ -110,8 +110,12 @@ public class KeyboardLayoutPicker extends ListFragment
public KeyboardLayout[] loadInBackground() {
InputManager im = (InputManager)getContext().getSystemService(Context.INPUT_SERVICE);
KeyboardLayout[] list = im.getKeyboardLayouts();
Arrays.sort(list);
return list;
KeyboardLayout[] listWithDefault = new KeyboardLayout[list.length + 1];
listWithDefault[0] = new KeyboardLayout(null,
getContext().getString(R.string.keyboard_layout_default_label));
System.arraycopy(list, 0, listWithDefault, 1, list.length);
Arrays.sort(listWithDefault);
return listWithDefault;
}
@Override