Add label for default keyboard layout.
Bug: 6110399 Change-Id: I2431b99884cbd01de32f8cd6c14a3afbd18b5020
This commit is contained in:
@@ -2633,6 +2633,8 @@
|
|||||||
<string name="keyboard_layout_picker_title">Choose keyboard layout</string>
|
<string name="keyboard_layout_picker_title">Choose keyboard layout</string>
|
||||||
<!-- String to show when no keyboard layouts are available. [CHAR LIMIT=60] -->
|
<!-- String to show when no keyboard layouts are available. [CHAR LIMIT=60] -->
|
||||||
<string name="keyboard_layout_picker_empty_text">No keyboard layouts are available.</string>
|
<string name="keyboard_layout_picker_empty_text">No keyboard layouts are available.</string>
|
||||||
|
<!-- Label of the default keyboard layout. [CHAR LIMIT=35] -->
|
||||||
|
<string name="keyboard_layout_default_label">Default</string>
|
||||||
|
|
||||||
<!-- User dictionary settings --><skip />
|
<!-- User dictionary settings --><skip />
|
||||||
<!-- User dictionary settings, The titlebar text of the User dictionary settings screen. -->
|
<!-- User dictionary settings, The titlebar text of the User dictionary settings screen. -->
|
||||||
|
@@ -420,6 +420,8 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
|
|||||||
pref.setTitle(device.getName());
|
pref.setTitle(device.getName());
|
||||||
if (keyboardLayout != null) {
|
if (keyboardLayout != null) {
|
||||||
pref.setSummary(keyboardLayout.getLabel());
|
pref.setSummary(keyboardLayout.getLabel());
|
||||||
|
} else {
|
||||||
|
pref.setSummary(R.string.keyboard_layout_default_label);
|
||||||
}
|
}
|
||||||
pref.setIntent(intent);
|
pref.setIntent(intent);
|
||||||
mHardKeyboardPreferenceList.add(pref);
|
mHardKeyboardPreferenceList.add(pref);
|
||||||
|
@@ -110,8 +110,12 @@ public class KeyboardLayoutPicker extends ListFragment
|
|||||||
public KeyboardLayout[] loadInBackground() {
|
public KeyboardLayout[] loadInBackground() {
|
||||||
InputManager im = (InputManager)getContext().getSystemService(Context.INPUT_SERVICE);
|
InputManager im = (InputManager)getContext().getSystemService(Context.INPUT_SERVICE);
|
||||||
KeyboardLayout[] list = im.getKeyboardLayouts();
|
KeyboardLayout[] list = im.getKeyboardLayouts();
|
||||||
Arrays.sort(list);
|
KeyboardLayout[] listWithDefault = new KeyboardLayout[list.length + 1];
|
||||||
return list;
|
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
|
@Override
|
||||||
|
Reference in New Issue
Block a user