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

Commit fcf7f84e authored by Danesh's avatar Danesh
Browse files

This adds copyAll to the edit contextMenu.

Thnx to knitterb_ on irc for the help.

Change-Id: I1df2703badc6cf85b376eb329e2349f924e791da
parent 3977575b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -7469,6 +7469,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                menu.add(0, ID_SELECT_ALL, 0, com.android.internal.R.string.selectAll).
                     setOnMenuItemClickListener(handler).
                     setAlphabeticShortcut('a');
                menu.add(0, ID_COPY_ALL, 0, com.android.internal.R.string.copyAll).
                setOnMenuItemClickListener(handler).
                setAlphabeticShortcut('b');
                added = true;
            }

@@ -7535,6 +7538,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    private static final int ID_COPY_URL = android.R.id.copyUrl;
    private static final int ID_SWITCH_INPUT_METHOD = android.R.id.switchInputMethod;
    private static final int ID_ADD_TO_DICTIONARY = android.R.id.addToDictionary;
    private static final int ID_COPY_ALL = com.android.internal.R.id.copyAll;

    private class MenuHandler implements MenuItem.OnMenuItemClickListener {
        public boolean onMenuItemClick(MenuItem item) {
@@ -7624,6 +7628,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    getContext().startActivity(i);
                }
                return true;

            case ID_COPY_ALL:
                clip.setText(mText);
                return true;
            }

        return false;
+1 −0
Original line number Diff line number Diff line
@@ -68,4 +68,5 @@
  <item type="id" name="accountPreferences" />
  <item type="id" name="smallIcon" />
  <item type="id" name="custom" />
  <item type="id" name="copyAll" />
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -1929,6 +1929,9 @@
    <!-- Item on EditText context menu. This action is used to select all text in the edit field. -->
    <string name="selectAll">Select all</string>

    <!-- Item on EditText context menu. This action is used to copy all text in the edit field. -->
    <string name="copyAll">Copy all</string>

    <!-- Item on EditText context menu. This action is used to start selecting text in the edit field. [CHAR LIMIT=20] -->
    <string name="selectText">Select word</string>