Loading core/java/com/android/internal/app/AlertController.java +30 −0 Original line number Diff line number Diff line Loading @@ -559,6 +559,13 @@ public class AlertController { final boolean hasButtonPanel = buttonPanel != null && buttonPanel.getVisibility() != View.GONE; if (!parentPanel.isInTouchMode()) { final View content = hasCustomPanel ? customPanel : contentPanel; if (!requestFocusForContent(content)) { requestFocusForDefaultButton(); } } // Only display the text spacer if we don't have buttons. if (!hasButtonPanel) { if (contentPanel != null) { Loading Loading @@ -624,6 +631,29 @@ public class AlertController { a.recycle(); } private boolean requestFocusForContent(View content) { if (content != null && content.requestFocus()) { return true; } if (mListView != null) { mListView.setSelection(0); return true; } return false; } private void requestFocusForDefaultButton() { if (mButtonPositive.getVisibility() == View.VISIBLE) { mButtonPositive.requestFocus(); } else if (mButtonNegative.getVisibility() == View.VISIBLE) { mButtonNegative.requestFocus(); } else if (mButtonNeutral.getVisibility() == View.VISIBLE) { mButtonNeutral.requestFocus(); } } private void setupCustomContent(ViewGroup customPanel) { final View customView; if (mView != null) { Loading Loading
core/java/com/android/internal/app/AlertController.java +30 −0 Original line number Diff line number Diff line Loading @@ -559,6 +559,13 @@ public class AlertController { final boolean hasButtonPanel = buttonPanel != null && buttonPanel.getVisibility() != View.GONE; if (!parentPanel.isInTouchMode()) { final View content = hasCustomPanel ? customPanel : contentPanel; if (!requestFocusForContent(content)) { requestFocusForDefaultButton(); } } // Only display the text spacer if we don't have buttons. if (!hasButtonPanel) { if (contentPanel != null) { Loading Loading @@ -624,6 +631,29 @@ public class AlertController { a.recycle(); } private boolean requestFocusForContent(View content) { if (content != null && content.requestFocus()) { return true; } if (mListView != null) { mListView.setSelection(0); return true; } return false; } private void requestFocusForDefaultButton() { if (mButtonPositive.getVisibility() == View.VISIBLE) { mButtonPositive.requestFocus(); } else if (mButtonNegative.getVisibility() == View.VISIBLE) { mButtonNegative.requestFocus(); } else if (mButtonNeutral.getVisibility() == View.VISIBLE) { mButtonNeutral.requestFocus(); } } private void setupCustomContent(ViewGroup customPanel) { final View customView; if (mView != null) { Loading