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

Commit 3bcc9488 authored by Ben Kwa's avatar Ben Kwa
Browse files

Add a "Select All" menu item and code.

Change-Id: I31ed8bff83d8a621a31ea5c2a0d1bb218f53d6e2
parent 1c6bfd69
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -29,4 +29,8 @@
        android:icon="@drawable/ic_menu_delete"
        android:title="@string/menu_delete"
        android:showAsAction="always" />
    <item
        android:id="@+id/menu_select_all"
        android:title="@string/menu_select_all"
        android:showAsAction="never" />
</menu>
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@
    <string name="menu_delete">Delete</string>
    <!-- Menu item title that selects the current directory [CHAR LIMIT=48] -->
    <string name="menu_select">Select \"<xliff:g id="directory" example="My Directory">^1</xliff:g>\"</string>
    <!-- Menu item title that selects all documents in the current directory [CHAR LIMIT=24] -->
    <string name="menu_select_all">Select All</string>

    <!-- Menu item that reveals internal storage built into the device [CHAR LIMIT=24] -->
    <string name="menu_advanced_show" product="nosdcard">Show internal storage</string>
+8 −0
Original line number Diff line number Diff line
@@ -501,6 +501,14 @@ public class DirectoryFragment extends Fragment {
                mode.finish();
                return true;

            } else if (id == R.id.menu_select_all) {
                int count = mCurrentView.getCount();
                for (int i = 0; i < count; i++) {
                    mCurrentView.setItemChecked(i, true);
                }
                updateDisplayState();
                return true;

            } else {
                return false;
            }