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

Commit a71b4b97 authored by Ben Reich's avatar Ben Reich
Browse files

Update the file list sort icon

This updates the sort icon that appears in the file list unit bar.
Currently it appears as a single arrow, this adds a background that is
properly styled along with keyboard interaction support.

Bug: 377771803
Test: atest SortDocumentUiTest#testSortByArrowIcon
Flag: com.android.documentsui.flags.use_material3

Change-Id: I46779db9ce7dc7c3caf3a4565be3ab9552dee1bf
parent c18605ea
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -15,14 +15,12 @@
    limitations under the License.
  -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    android:width="28dp"
    android:height="32dp"
    android:viewportHeight="32"
    android:viewportWidth="28">

    <path
        android:pathData="M0 0h24v24H0V0z" />
    <path
        android:fillColor="?android:textColorSecondary"
        android:pathData="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" />
        android:fillColor="?attr/colorOnSecondaryContainer"
        android:pathData="M13.25 19.125V10.75c0-.208.07-.382.208-.52A.74.74 0 0 1 14 10c.208 0 .382.076.52.23.154.138.23.312.23.52v8.375l3.667-3.667a.718.718 0 0 1 .52-.229c.209 0 .39.077.542.23.153.152.23.333.23.541a.718.718 0 0 1-.23.52l-4.958 4.96a.786.786 0 0 1-.25.166.85.85 0 0 1-.271.041c-.097 0-.194-.013-.292-.041a.878.878 0 0 1-.229-.167l-4.958-4.958A.718.718 0 0 1 8.29 16a.822.822 0 0 1 .25-.542.718.718 0 0 1 .521-.229.74.74 0 0 1 .542.23l3.646 3.666Z" />
</vector>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
  -->

<rotate xmlns:android="http://schemas.android.com/apk/res/android"
        android:drawable="@drawable/ic_arrow_upward"
        android:drawable="@drawable/ic_sort_icon"
        android:fromDegrees="0"
        android:toDegrees="180"
        android:pivotX="50%"
+98 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2024 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_focused="true"
        android:state_hovered="true">
        <layer-list>
            <item>
                <shape
                    android:background="?attr/colorSurfaceBright"
                    android:shape="rectangle"
                    android:tint="?attr/colorSecondaryContainer"
                    android:tintMode="multiply">
                    <corners android:radius="14dp" />
                    <size
                        android:width="28dp"
                        android:height="32dp" />
                    <solid android:color="?attr/colorSecondaryContainer" />
                    <stroke
                        android:width="@dimen/focus_ring_width"
                        android:color="?attr/colorSecondary" />
                </shape>
            </item>
            <item android:drawable="@drawable/ic_arrow_upward" />
        </layer-list>
    </item>
    <item
        android:state_focused="false"
        android:state_hovered="true">
        <layer-list>
            <item>
                <shape
                    android:background="?attr/colorSurfaceBright"
                    android:shape="rectangle"
                    android:tint="?attr/colorSecondaryContainer"
                    android:tintMode="multiply">
                    <corners android:radius="14dp" />
                    <size
                        android:width="28dp"
                        android:height="32dp" />
                    <solid android:color="?attr/colorSecondaryContainer" />
                </shape>
            </item>
            <item android:drawable="@drawable/ic_arrow_upward" />
        </layer-list>
    </item>
    <item
        android:state_focused="true"
        android:state_hovered="false">
        <layer-list>
            <item>
                <shape
                    android:background="?attr/colorSurfaceBright"
                    android:shape="rectangle">
                    <corners android:radius="14dp" />
                    <size
                        android:width="28dp"
                        android:height="32dp" />
                    <solid android:color="?attr/colorSecondaryContainer" />
                    <stroke
                        android:width="@dimen/focus_ring_width"
                        android:color="?attr/colorSecondary" />
                </shape>
            </item>
            <item android:drawable="@drawable/ic_arrow_upward" />
        </layer-list>
    </item>
    <item>
        <layer-list>
            <item>
                <shape
                    android:background="?attr/colorSurfaceBright"
                    android:shape="rectangle">
                    <corners android:radius="14dp" />
                    <size
                        android:width="28dp"
                        android:height="32dp" />
                    <solid android:color="?attr/colorSecondaryContainer" />
                </shape>
            </item>
            <item android:drawable="@drawable/ic_arrow_upward" />
        </layer-list>
    </item>
</selector>
 No newline at end of file
+10 −5
Original line number Diff line number Diff line
@@ -54,7 +54,8 @@
                android:layout_height="match_parent"
                android:layout_weight="0.4"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:clickable="true"
                android:focusable="false"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">
@@ -68,7 +69,8 @@
                android:layout_height="match_parent"
                android:layout_weight="0"
                android:layout_marginEnd="0dp"
                android:focusable="true"
                android:clickable="true"
                android:focusable="false"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">
@@ -82,7 +84,8 @@
                android:layout_height="match_parent"
                android:layout_weight="0.2"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:clickable="true"
                android:focusable="false"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">
@@ -96,7 +99,8 @@
                android:layout_height="match_parent"
                android:layout_weight="0.2"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:clickable="true"
                android:focusable="false"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">
@@ -110,7 +114,8 @@
                android:layout_height="match_parent"
                android:layout_weight="0.2"
                android:layout_marginEnd="12dp"
                android:focusable="true"
                android:clickable="true"
                android:focusable="false"
                android:gravity="center_vertical"
                android:orientation="horizontal"
                android:animateLayoutChanges="true">
+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@
        android:layout_width="@dimen/doc_header_sort_icon_size"
        android:layout_marginStart="3dp"
        android:visibility="gone"
        android:focusable="true"
        android:clickable="true"
        android:background="?attr/colorSurfaceBright"
        android:src="@drawable/ic_sort_arrow"
        android:contentDescription="@null"/>
</merge>
 No newline at end of file
Loading