Merge "Logically revert "Directly show the layout selection screen."" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-21 15:01:11 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 20 deletions

View File

@@ -55,7 +55,6 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
private int mInputDeviceId = -1; private int mInputDeviceId = -1;
private InputManager mIm; private InputManager mIm;
private KeyboardLayoutAdapter mAdapter; private KeyboardLayoutAdapter mAdapter;
private boolean mHasShownLayoutSelectionScreen;
public KeyboardLayoutDialogFragment() { public KeyboardLayoutDialogFragment() {
} }
@@ -187,7 +186,6 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
dialog.getListView().setItemChecked(data.current, true); dialog.getListView().setItemChecked(data.current, true);
} }
updateSwitchHintVisibility(); updateSwitchHintVisibility();
showSetupKeyboardLayoutsIfNecessary();
} }
@Override @Override
@@ -222,17 +220,6 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
} }
} }
private void showSetupKeyboardLayoutsIfNecessary() {
AlertDialog dialog = (AlertDialog)getDialog();
if (dialog != null
&& mAdapter.getCount() == 1 && mAdapter.getItem(0) == null
&& !mHasShownLayoutSelectionScreen) {
mHasShownLayoutSelectionScreen = true;
((OnSetupKeyboardLayoutsListener)getTargetFragment()).onSetupKeyboardLayouts(
mInputDeviceIdentifier);
}
}
private static final class KeyboardLayoutAdapter extends ArrayAdapter<KeyboardLayout> { private static final class KeyboardLayoutAdapter extends ArrayAdapter<KeyboardLayout> {
private final LayoutInflater mInflater; private final LayoutInflater mInflater;
private int mCheckedItem = -1; private int mCheckedItem = -1;

View File

@@ -187,14 +187,11 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
} }
private void showKeyboardLayoutDialog(InputDeviceIdentifier inputDeviceIdentifier) { private void showKeyboardLayoutDialog(InputDeviceIdentifier inputDeviceIdentifier) {
KeyboardLayoutDialogFragment fragment = (KeyboardLayoutDialogFragment) KeyboardLayoutDialogFragment fragment = new KeyboardLayoutDialogFragment(
getFragmentManager().findFragmentByTag("keyboardLayout"); inputDeviceIdentifier);
if (fragment == null) {
fragment = new KeyboardLayoutDialogFragment(inputDeviceIdentifier);
fragment.setTargetFragment(this, 0); fragment.setTargetFragment(this, 0);
fragment.show(getActivity().getFragmentManager(), "keyboardLayout"); fragment.show(getActivity().getFragmentManager(), "keyboardLayout");
} }
}
private void registerShowVirtualKeyboardSettingsObserver() { private void registerShowVirtualKeyboardSettingsObserver() {
unregisterShowVirtualKeyboardSettingsObserver(); unregisterShowVirtualKeyboardSettingsObserver();