From ed2e391454503397292058f42571768beebe07bd Mon Sep 17 00:00:00 2001 From: Clara Bayarri Date: Tue, 24 Mar 2015 14:57:34 +0000 Subject: [PATCH] Editor: Reorder items in the text selection action mode. Reorder elements to place "Select All" last, as otherwise when we use a floating toolbar the first element is "Select All" and takes up too much space, forcing Copy and Paste to the overflow. Change-Id: I04cdd79915bd2a3abbd10969ce298b7b0f7f8cb0 --- core/java/android/widget/Editor.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 3fca463ee9f3c..5f43871ea6ecd 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -2956,13 +2956,6 @@ public class Editor { mode.setSubtitle(null); mode.setTitleOptionalHint(true); - menu.add(0, TextView.ID_SELECT_ALL, 0, com.android.internal.R.string.selectAll). - setIcon(styledAttributes.getResourceId( - R.styleable.SelectionModeDrawables_actionModeSelectAllDrawable, 0)). - setAlphabeticShortcut('a'). - setShowAsAction( - MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); - if (mTextView.canCut()) { menu.add(0, TextView.ID_CUT, 0, com.android.internal.R.string.cut). setIcon(styledAttributes.getResourceId( @@ -2990,6 +2983,13 @@ public class Editor { MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); } + menu.add(0, TextView.ID_SELECT_ALL, 0, com.android.internal.R.string.selectAll). + setIcon(styledAttributes.getResourceId( + R.styleable.SelectionModeDrawables_actionModeSelectAllDrawable, 0)). + setAlphabeticShortcut('a'). + setShowAsAction( + MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); + if (mTextView.isSuggestionsEnabled() && isCursorInsideSuggestionSpan()) { menu.add(0, TextView.ID_REPLACE, 0, com.android.internal.R.string.replace). setShowAsAction(