Add Keyboard Shortcuts Helper entry in Settings
Bug: 27811273 Change-Id: Ic4a97c869d6476bf427e41023dc595b39589e6ce
This commit is contained in:
@@ -3636,6 +3636,10 @@
|
|||||||
<string name="show_ime">Show virtual keyboard</string>
|
<string name="show_ime">Show virtual keyboard</string>
|
||||||
<!-- Summary text for the 'add virtual keyboard' preference sub-screen. [CHAR LIMIT=100] -->
|
<!-- Summary text for the 'add virtual keyboard' preference sub-screen. [CHAR LIMIT=100] -->
|
||||||
<string name="show_ime_summary">Keep it on screen while physical keyboard is active</string>
|
<string name="show_ime_summary">Keep it on screen while physical keyboard is active</string>
|
||||||
|
<!-- Title for the button to trigger the 'keyboard shortcuts helper' dialog. [CHAR LIMIT=35] -->
|
||||||
|
<string name="keyboard_shortcuts_helper">Keyboard shortcuts helper</string>
|
||||||
|
<!-- Summary text for the 'keyboard shortcuts helper' dialog. [CHAR LIMIT=100] -->
|
||||||
|
<string name="keyboard_shortcuts_helper_summary">Display available shortcuts</string>
|
||||||
<!--
|
<!--
|
||||||
Format string for a physical device in the form: InputMethodSubtype - InputMethodEditor.
|
Format string for a physical device in the form: InputMethodSubtype - InputMethodEditor.
|
||||||
e.g. English (US) - X Keyboard -->
|
e.g. English (US) - X Keyboard -->
|
||||||
|
@@ -25,5 +25,10 @@
|
|||||||
android:title="@string/show_ime"
|
android:title="@string/show_ime"
|
||||||
android:summary="@string/show_ime_summary"
|
android:summary="@string/show_ime_summary"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:key="keyboard_shortcuts_helper"
|
||||||
|
android:title="@string/keyboard_shortcuts_helper"
|
||||||
|
android:summary="@string/keyboard_shortcuts_helper_summary" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@@ -61,6 +61,7 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
|
|||||||
private static final int USER_SYSTEM = 0;
|
private static final int USER_SYSTEM = 0;
|
||||||
private static final String KEYBOARD_ASSISTANCE_CATEGORY = "keyboard_assistance_category";
|
private static final String KEYBOARD_ASSISTANCE_CATEGORY = "keyboard_assistance_category";
|
||||||
private static final String SHOW_VIRTUAL_KEYBOARD_SWITCH = "show_virtual_keyboard_switch";
|
private static final String SHOW_VIRTUAL_KEYBOARD_SWITCH = "show_virtual_keyboard_switch";
|
||||||
|
private static final String KEYBOARD_SHORTCUTS_HELPER = "keyboard_shortcuts_helper";
|
||||||
private static final String IM_SUBTYPE_MODE_KEYBOARD = "keyboard";
|
private static final String IM_SUBTYPE_MODE_KEYBOARD = "keyboard";
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@@ -95,6 +96,14 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
|
|||||||
mShowVirtualKeyboardSwitch = Preconditions.checkNotNull(
|
mShowVirtualKeyboardSwitch = Preconditions.checkNotNull(
|
||||||
(SwitchPreference) mKeyboardAssistanceCategory.findPreference(
|
(SwitchPreference) mKeyboardAssistanceCategory.findPreference(
|
||||||
SHOW_VIRTUAL_KEYBOARD_SWITCH));
|
SHOW_VIRTUAL_KEYBOARD_SWITCH));
|
||||||
|
findPreference(KEYBOARD_SHORTCUTS_HELPER).setOnPreferenceClickListener(
|
||||||
|
new Preference.OnPreferenceClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
|
toggleKeyboardShortcutsMenu();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -245,6 +254,10 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
|
|||||||
mShowVirtualKeyboardSwitch.setChecked(mSettings.isShowImeWithHardKeyboardEnabled());
|
mShowVirtualKeyboardSwitch.setChecked(mSettings.isShowImeWithHardKeyboardEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void toggleKeyboardShortcutsMenu() {
|
||||||
|
getActivity().requestKeyboardShortcutsHelper();
|
||||||
|
}
|
||||||
|
|
||||||
private final OnPreferenceChangeListener mShowVirtualKeyboardSwitchPreferenceChangeListener =
|
private final OnPreferenceChangeListener mShowVirtualKeyboardSwitchPreferenceChangeListener =
|
||||||
new OnPreferenceChangeListener() {
|
new OnPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user