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

Commit 5668b866 authored by Ben Lin's avatar Ben Lin
Browse files

Docsui-level work for implementing Eject on Roots list.

1. Added Eject Icon for Roots that support eject
2. Added Context Menu for RootsFragment (Settings and Eject)

Bug: 29584653
Change-Id: I97f582de05763e3f0327bc0d2dc6d4e2222e047c
parent 598c0ebe
Loading
Loading
Loading
Loading
+20 −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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false" android:alpha="@*android:dimen/disabled_alpha_material_light" android:color="@*android:color/primary_text_default_material_light" />
    <item android:color="@*android:color/primary_text_default_material_light" />
</selector>
+24 −0
Original line number Diff line number Diff line
<!--
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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="#FF737373"
        android:pathData="M5 17h14v2H5zm7-12L5.33 15h13.34z"/>
</vector>
+17 −1
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@
        android:layout_height="wrap_content"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        android:orientation="vertical">
        android:orientation="vertical"
        android:layout_weight="1">

        <TextView
            android:id="@android:id/title"
@@ -70,4 +71,19 @@

    </LinearLayout>

     <FrameLayout
        android:layout_width="@dimen/icon_size"
        android:layout_height="@dimen/icon_size"
        android:duplicateParentState="true">

        <ImageView
            android:id="@+id/unmount_icon"
            android:layout_width="@dimen/root_icon_size"
            android:layout_height="match_parent"
            android:scaleType="centerInside"
            android:contentDescription="@string/menu_eject_root"
            android:visibility="gone" />

    </FrameLayout>

</com.android.documentsui.RootItemView>
+24 −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.
-->

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/menu_eject_root"
        android:title="@string/menu_eject_root" />
    <item
        android:id="@+id/menu_settings"
        android:title="@string/menu_settings" />
</menu>
+2 −0
Original line number Diff line number Diff line
@@ -199,6 +199,8 @@
    <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] -->
    <string name="menu_eject_root">Eject</string>
    <!-- First line for notifications saying that some files were converted to a different format
         during a copy. [CHAR LIMIT=48] -->
    <string name="notification_copy_files_converted_title">Some files were converted</string>
Loading