Directly show the layout selection screen.

When a user clicks on the physical keyboard in order to select a
layout, rather than showing them a dialog with an empty list of
layouts, send them straight to the screen where they can pick which
layouts to enable.

Also, only request keyboard layouts that are appropriate for the
input device we're in the process of configuring.

Bug: 25062009
Change-Id: I4483dfc89afc8d148b2cfa7c6a5f66d2a02f712a
This commit is contained in:
Michael Wright
2015-11-03 15:26:01 +00:00
parent 949499948a
commit 17b6319884
3 changed files with 24 additions and 8 deletions

View File

@@ -572,10 +572,13 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
}
private void showKeyboardLayoutDialog(InputDeviceIdentifier inputDeviceIdentifier) {
KeyboardLayoutDialogFragment fragment = new KeyboardLayoutDialogFragment(
inputDeviceIdentifier);
fragment.setTargetFragment(this, 0);
fragment.show(getActivity().getFragmentManager(), "keyboardLayout");
KeyboardLayoutDialogFragment fragment = (KeyboardLayoutDialogFragment)
getFragmentManager().findFragmentByTag("keyboardLayout");
if (fragment == null) {
fragment = new KeyboardLayoutDialogFragment(inputDeviceIdentifier);
fragment.setTargetFragment(this, 0);
fragment.show(getActivity().getFragmentManager(), "keyboardLayout");
}
}
@Override