Loading core/java/android/preference/DialogPreference.java +0 −23 Original line number Diff line number Diff line Loading @@ -36,8 +36,6 @@ import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.TextView; /** Loading Loading @@ -337,9 +335,6 @@ public abstract class DialogPreference extends Preference implements if (state != null) { dialog.onRestoreInstanceState(state); } if (needInputMethod()) { requestInputMethod(dialog); } dialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { Loading Loading @@ -379,24 +374,6 @@ public abstract class DialogPreference extends Preference implements } } /** * Returns whether the preference needs to display a soft input method when the dialog * is displayed. Default is false. Subclasses should override this method if they need * the soft input method brought up automatically. * @hide */ protected boolean needInputMethod() { return false; } /** * Sets the required flags on the dialog window to enable input method window to show up. */ private void requestInputMethod(Dialog dialog) { Window window = dialog.getWindow(); window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); } /** * Creates the content view for the dialog (if a custom content view is * required). By default, it inflates the dialog layout resource if it is Loading core/java/android/preference/EditTextPreference.java +10 −8 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.SharedPreferences; import android.content.res.TypedArray; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; Loading @@ -28,6 +29,7 @@ import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import android.view.WindowInsets; import android.widget.EditText; /** Loading Loading @@ -133,6 +135,13 @@ public class EditTextPreference extends DialogPreference { } } @Override protected void showDialog(Bundle state) { super.showDialog(state); mEditText.requestFocus(); mEditText.getWindowInsetsController().show(WindowInsets.Type.ime()); } /** * Adds the EditText widget of this preference to the dialog's view. * Loading Loading @@ -183,13 +192,6 @@ public class EditTextPreference extends DialogPreference { return mEditText; } /** @hide */ @Override protected boolean needInputMethod() { // We want the input method to show, if possible, when dialog is displayed return true; } @Override protected Parcelable onSaveInstanceState() { final Parcelable superState = super.onSaveInstanceState(); Loading Loading
core/java/android/preference/DialogPreference.java +0 −23 Original line number Diff line number Diff line Loading @@ -36,8 +36,6 @@ import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.TextView; /** Loading Loading @@ -337,9 +335,6 @@ public abstract class DialogPreference extends Preference implements if (state != null) { dialog.onRestoreInstanceState(state); } if (needInputMethod()) { requestInputMethod(dialog); } dialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { Loading Loading @@ -379,24 +374,6 @@ public abstract class DialogPreference extends Preference implements } } /** * Returns whether the preference needs to display a soft input method when the dialog * is displayed. Default is false. Subclasses should override this method if they need * the soft input method brought up automatically. * @hide */ protected boolean needInputMethod() { return false; } /** * Sets the required flags on the dialog window to enable input method window to show up. */ private void requestInputMethod(Dialog dialog) { Window window = dialog.getWindow(); window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); } /** * Creates the content view for the dialog (if a custom content view is * required). By default, it inflates the dialog layout resource if it is Loading
core/java/android/preference/EditTextPreference.java +10 −8 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.SharedPreferences; import android.content.res.TypedArray; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; Loading @@ -28,6 +29,7 @@ import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; import android.view.WindowInsets; import android.widget.EditText; /** Loading Loading @@ -133,6 +135,13 @@ public class EditTextPreference extends DialogPreference { } } @Override protected void showDialog(Bundle state) { super.showDialog(state); mEditText.requestFocus(); mEditText.getWindowInsetsController().show(WindowInsets.Type.ime()); } /** * Adds the EditText widget of this preference to the dialog's view. * Loading Loading @@ -183,13 +192,6 @@ public class EditTextPreference extends DialogPreference { return mEditText; } /** @hide */ @Override protected boolean needInputMethod() { // We want the input method to show, if possible, when dialog is displayed return true; } @Override protected Parcelable onSaveInstanceState() { final Parcelable superState = super.onSaveInstanceState(); Loading