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

Commit b47b4b56 authored by Garfield Tan's avatar Garfield Tan
Browse files

Add a type column to show user-friendly type info.

Also add a special map from mime type to user friendly strings.

Test: Auto tests & smoke tests.
Bug: 34844878
Change-Id: I773f2bae524b7dffc6eeda1a1e92330b5ad64473
parent 2b50615b
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@
                android:id="@android:id/title"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="0.5"
                android:layout_weight="0.375"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:gravity="center_vertical"
@@ -76,6 +76,20 @@
                <include layout="@layout/shared_cell_content" />
            </com.android.documentsui.sorting.HeaderCell>

            <com.android.documentsui.sorting.HeaderCell
                android:id="@+id/file_type"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="0.125"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">

                <include layout="@layout/shared_cell_content" />
            </com.android.documentsui.sorting.HeaderCell>

            <com.android.documentsui.sorting.HeaderCell
                android:id="@+id/size"
                android:layout_width="0dp"
+13 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginEnd="12dp"
                android:layout_weight="0.5"
                android:layout_weight="0.375"
                android:ellipsize="middle"
                android:singleLine="true"
                android:textAlignment="viewStart"
@@ -100,6 +100,18 @@
                android:textAppearance="@android:style/TextAppearance.Material.Body1"
                android:textColor="?android:attr/textColorSecondary" />

            <TextView
                android:id="@+id/file_type"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginEnd="12dp"
                android:layout_weight="0.125"
                android:ellipsize="end"
                android:singleLine="true"
                android:textAlignment="viewStart"
                android:textAppearance="@android:style/TextAppearance.Material.Body1"
                android:textColor="?android:attr/textColorSecondary" />

            <TextView
                android:id="@+id/size"
                android:layout_width="0dp"
+11 −0
Original line number Diff line number Diff line
@@ -113,6 +113,17 @@
                    android:textAppearance="@android:style/TextAppearance.Material.Caption"
                    android:textColor="@color/item_details" />

                <TextView
                    android:id="@+id/file_type"
                    android:layout_width="90dp"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:textAlignment="viewStart"
                    android:textAppearance="@android:style/TextAppearance.Material.Caption"
                    android:textColor="@color/item_details" />

                <TextView
                    android:id="@android:id/summary"
                    android:layout_width="0dp"

res/values/mimes.xml

0 → 100644
+67 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2017 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.
  -->

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- Generic file type with an extention shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="generic_extention_file_type"><xliff:g id="extension" example="APE">%1$s</xliff:g> file</string>
    <!-- Generic file type without an extention shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="generic_file_type">File</string>
    <!-- Generic image file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="image_file_type">Image</string>
    <!-- Image file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="image_extension_file_type"><xliff:g id="fileType" example="JPG">%1$s</xliff:g> image</string>
    <!-- Generic audio file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="audio_file_type">Audio</string>
    <!-- Audio file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="audio_extension_file_type"><xliff:g id="fileType" example="MP3">%1$s</xliff:g> audio</string>
    <!-- Generic video file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="video_file_type">Video</string>
    <!-- Video file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="video_extension_file_type"><xliff:g id="fileType" example="AVI">%1$s</xliff:g> video</string>
    <!-- Archive file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="archive_file_type"><xliff:g id="fileType" example="Zip">%1$s</xliff:g> archive</string>
    <!-- Android application file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="apk_file_type">Android application</string>
    <!-- Plain text file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="txt_file_type">Plain text</string>
    <!-- HTML file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="html_file_type">HTML document</string>
    <!-- PDF file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="pdf_file_type">PDF document</string>
    <!-- Word document file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="word_file_type">Word document</string>
    <!-- PowerPoint presentation file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="ppt_file_type">PowerPoint presentation</string>
    <!-- Excel spreadsheet file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="excel_file_type">Excel spreadsheet</string>
    <!-- Google document file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="gdoc_file_type">Google document</string>
    <!-- Google spreadsheet file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="gsheet_file_type">Google spreadsheet</string>
    <!-- Google presentation file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="gslides_file_type">Google presentation</string>
    <!-- Google drawing file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="gdraw_file_type">Google drawing</string>
    <!-- Google table file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="gtable_file_type">Google table</string>
    <!-- Google form file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="gform_file_type">Google form</string>
    <!-- Google map file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="gmap_file_type">Google map</string>
    <!-- Google site file type shown in type column in list view. [CHAR LIMIT=24] -->
    <string name="gsite_file_type">Google site</string>
</resources>
 No newline at end of file
+4 −2
Original line number Diff line number Diff line
@@ -108,10 +108,12 @@
    <string name="sort_dimension_name">Name</string>
    <!-- Table header for metadata of downloaded files, such as download source and progress. [CHAR_LIMIT=24] -->
    <string name="sort_dimension_summary">Summary</string>
    <!-- Table header for last modified time. [CHAR_LIMIT=18] -->
    <string name="sort_dimension_date">Modified</string>
    <!-- Table header for file type. [CHAR_LIMIT=12] -->
    <string name="sort_dimension_file_type">Type</string>
    <!-- Table header for file size. [CHAR_LIMIT=12] -->
    <string name="sort_dimension_size">Size</string>
    <!-- Table header for last modified time. [CHAR_LIMIT=18] -->
    <string name="sort_dimension_date">Modified</string>

    <!-- content description to describe ascending sorting used with upward arrow in table header. -->
    <string name="sort_direction_ascending">Ascending</string>
Loading