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

Commit 06c4b111 authored by Garfield Tan's avatar Garfield Tan
Browse files

[multi-part] Make context menu match spec.

* Update context menu items in DirectoryFragment as defined in PRD
* Fix selection by right click in pickers
* Fix several bugs caused by selection in pickers

Functionalities are not done. OpenWith and OpenInNewWindow is not
yet supported.

Bug: 31495650
Bug: 31345822
Change-Id: I7be3169e2ee69971c0e86aa8b5e1078b15eb2960
parent d080506e
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->

<!-- Context menu used when right clicks on empty area of recycler view or empty view. -->
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <group
        android:id="@+id/menu_clipboard_group">
        <item
            android:id="@+id/menu_select_all"
            android:title="@string/menu_select_all" />

        <item
            android:id="@+id/menu_paste_from_clipboard"
            android:title="@string/menu_paste_from_clipboard" />
    </group>

    <group
        android:id="@+id/menu_modifier_group">
        <item
            android:id="@+id/menu_create_dir"
            android:title="@string/menu_create_dir" />
    </group>
</menu>
 No newline at end of file
+50 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->

<!-- Context menu used when user right clicks on a folder with a selection that doesn't have files.
    Selection may be empty. -->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <group
        android:id="@+id/menu_open_group">
        <item
            android:id="@+id/menu_open_in_new_window"
            android:title="@string/menu_open_in_new_window" />
    </group>

    <group
        android:id="@+id/menu_clipboard_group">
        <item
            android:id="@+id/menu_cut_to_clipboard"
            android:title="@string/menu_cut_to_clipboard" />
        <item
            android:id="@+id/menu_copy_to_clipboard"
            android:title="@string/menu_copy_to_clipboard" />
        <item
            android:id="@+id/menu_paste_into_folder"
            android:title="@string/menu_paste_into_folder" />
    </group>

    <group
        android:id="@+id/menu_modifier_group">
        <item
            android:id="@+id/menu_rename"
            android:title="@string/menu_rename" />
        <item
            android:id="@+id/menu_delete"
            android:title="@string/menu_delete" />
    </group>
</menu>
 No newline at end of file
+52 −0
Original line number Diff line number Diff line
@@ -14,18 +14,39 @@
     limitations under the License.
-->

<!-- Context menu used when user right clicks on a file with a selection that doesn't have folders.
    The selection may be empty. -->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <group
        android:id="@+id/menu_open_group">
        <item
            android:id="@+id/menu_share"
            android:title="@string/menu_share" />
        <item
            android:id="@+id/menu_open"
            android:title="@string/menu_open" />
        <item
            android:id="@+id/menu_open_with"
            android:title="@string/menu_open_with" />
    </group>

    <group
        android:id="@+id/menu_clipboard_group">
        <item
            android:id="@+id/menu_cut_to_clipboard"
            android:title="@string/menu_cut_to_clipboard" />
        <item
            android:id="@+id/menu_copy_to_clipboard"
            android:title="@string/menu_copy_to_clipboard" />
    <item
        android:id="@+id/menu_paste_from_clipboard"
        android:title="@string/menu_paste_from_clipboard" />
    </group>

    <group
        android:id="@+id/menu_modifier_group">
        <item
            android:id="@+id/menu_rename"
            android:title="@string/menu_rename" />
        <item
        android:id="@+id/menu_paste_into_folder"
        android:title="@string/menu_paste_into_folder" />
            android:id="@+id/menu_delete"
            android:title="@string/menu_delete" />
    </group>
</menu>
+37 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2016 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->

<!-- Context menu used when user right clicks with a selection mixed with both folders and docs. -->
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <group
        android:id="@+id/menu_clipboard_group">
        <item
            android:id="@+id/menu_cut_to_clipboard"
            android:title="@string/menu_cut_to_clipboard" />
        <item
            android:id="@+id/menu_copy_to_clipboard"
            android:title="@string/menu_copy_to_clipboard" />
    </group>

    <group
        android:id="@+id/menu_modifier_group">
        <item
            android:id="@+id/menu_delete"
            android:title="@string/menu_delete" />
    </group>
</menu>
 No newline at end of file
+6 −4
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@
    <string name="menu_grid">Grid view</string>
    <!-- Menu item that switches view to show documents as a list [CHAR LIMIT=24] -->
    <string name="menu_list">List view</string>
    <!-- Menu item that switches the criteria with which documents are sorted [CHAR LIMIT=24] -->
    <string name="menu_sort">Sort by</string>
    <!-- Menu item that enters a mode to search for documents [CHAR LIMIT=24] -->
    <string name="menu_search">Search</string>
    <!-- Menu item that opens settings/options for a device (like an SD card). [CHAR LIMIT=24] -->
@@ -41,6 +39,10 @@

    <!-- Menu item title that opens the selected documents [CHAR LIMIT=24] -->
    <string name="menu_open">Open</string>
    <!-- Menu item title that shows a chooser to user to pick the app to open the selected documents. [CHAR LIMIT=24] -->
    <string name="menu_open_with">Open with</string>
    <!-- Menu item title that opens a doc in new window. [CHAR LIMIT=24] -->
    <string name="menu_open_in_new_window">Open in new window</string>
    <!-- Menu item title that saves the current document [CHAR LIMIT=24] -->
    <string name="menu_save">Save</string>
    <!-- Menu item title that shares the selected documents [CHAR LIMIT=24] -->
@@ -53,6 +55,8 @@
    <string name="menu_copy">Copy to\u2026</string>
    <!-- Menu item title that moves the selected documents [CHAR LIMIT=24] -->
    <string name="menu_move">Move to\u2026</string>
    <!-- Menu item that renames the selected document [CHAR LIMIT=24] -->
    <string name="menu_rename">Rename</string>

    <!-- Menu item title that creates a new window in the activity [CHAR LIMIT=24] -->
    <string name="menu_new_window">New window</string>
@@ -203,8 +207,6 @@
    </plurals>
    <!-- Toast shown when a user tries to paste files into an unsupported location. -->
    <string name="clipboard_files_cannot_paste">Cannot paste the selected files in this location.</string>
    <!-- Menu item that renames the selected document [CHAR LIMIT=24] -->
    <string name="menu_rename">Rename</string>
    <!-- Toast shown when renaming document failed with an error [CHAR LIMIT=48] -->
    <string name="rename_error">Failed to rename document</string>
    <!-- Context Menu item that ejects the root selected [CHAR LIMIT=24] -->
Loading