Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed2e3914 authored by Clara Bayarri's avatar Clara Bayarri
Browse files

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
parent a7b212d9
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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(