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 InputManager mIm;
private KeyboardLayoutAdapter mAdapter;
private boolean mHasShownLayoutSelectionScreen;
public KeyboardLayoutDialogFragment() {
}
@@ -187,7 +186,6 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
dialog.getListView().setItemChecked(data.current, true);
}
updateSwitchHintVisibility();
showSetupKeyboardLayoutsIfNecessary();
}
@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 final LayoutInflater mInflater;
private int mCheckedItem = -1;

View File

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