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

Commit 28fdd411 authored by Wenbo Jie (介文博)'s avatar Wenbo Jie (介文博) Committed by Android (Google) Code Review
Browse files

Merge changes from topic "docsui-m3-file-row" into main

* changes:
  [DocsUI M3] Uplift File list row colors/states
  [DocsUI M3] Uplift File list row layout
parents e98608e2 13d65fe9
Loading
Loading
Loading
Loading
+21 −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_selected="true" android:color="?attr/colorOnPrimary" />
    <item android:color="?attr/colorSecondary" />
</selector>
+21 −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_selected="true" android:color="?attr/colorOnPrimary" />
    <item android:color="?attr/colorOnSurface" />
</selector>
+2 −3
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
  -->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false"
        android:color="@color/doc_list_item_subtitle_disabled" />
    <item android:color="@color/doc_list_item_subtitle_enabled" />
    <item android:state_selected="true" android:color="?attr/colorOnPrimary" />
    <item android:color="?attr/colorOnSurfaceVariant" />
</selector>
+7 −6
Original line number Diff line number Diff line
@@ -14,11 +14,12 @@ Copyright (C) 2024 The Android Open Source Project
    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">
    android:width="20dp"
    android:height="20dp"
    android:viewportWidth="960"
    android:viewportHeight="960">
    <path
        android:fillColor="?android:attr/colorAccent"
        android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10,-4.48 10,-10S17.52 2 12 2zm-2 15l-5,-5 1.41,-1.41L10 14.17l7.59,-7.59L19 8l-9 9z"/>
        android:fillColor="?attr/colorOnPrimaryContainer"
        android:pathData="M428.28,628.78L669.87,388.2L612.41,330.5L428.28,513.63L346.15,432.5L288.7,490.2L428.28,628.78ZM480,872.13Q399.09,872.13 327.66,841.51Q256.22,810.89 202.66,757.34Q149.11,703.78 118.49,632.34Q87.87,560.91 87.87,480Q87.87,398.09 118.49,327.16Q149.11,256.22 202.66,202.66Q256.22,149.11 327.66,118.49Q399.09,87.87 480,87.87Q561.91,87.87 632.84,118.49Q703.78,149.11 757.34,202.66Q810.89,256.22 841.51,327.16Q872.13,398.09 872.13,480Q872.13,560.91 841.51,632.34Q810.89,703.78 757.34,757.34Q703.78,810.89 632.84,841.51Q561.91,872.13 480,872.13Z"/>
</vector>
+69 −7
Original line number Diff line number Diff line
@@ -14,18 +14,80 @@
     limitations under the License.
-->

<!-- Use @color/list_item_selected_background_color instead of the "?attr/colorPrimary"
     because the variable is exposed in overlayable.xml. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_focused="true" >
        <color android:color="@color/list_item_selected_background_color"/>
    <!-- selected -->
    <item android:state_selected="true" android:state_drag_hovered="true">
        <layer-list>
            <item>
                <shape>
                    <corners android:radius="@dimen/list_item_height" />
                    <solid android:color="@color/list_item_selected_background_color" />
                </shape>
            </item>
            <item>
                <shape android:tint="?attr/colorOnPrimary">
                    <corners android:radius="@dimen/list_item_height" />
                    <solid android:color="@color/overlay_color_percentage_10" />
                </shape>
            </item>
        </layer-list>
    </item>
    <item android:state_selected="true" android:state_focused="true">
        <layer-list>
            <item
                android:bottom="@dimen/focus_ring_gap"
                android:left="@dimen/focus_ring_gap"
                android:right="@dimen/focus_ring_gap"
                android:top="@dimen/focus_ring_gap">
                <shape>
                    <corners android:radius="@dimen/list_item_height" />
                    <solid android:color="@color/list_item_selected_background_color" />
                </shape>
            </item>
            <item>
                <shape>
                    <corners android:radius="@dimen/list_item_height" />
                    <stroke
                        android:width="@dimen/focus_ring_width"
                        android:color="?attr/colorSecondary" />
                </shape>
            </item>
        </layer-list>
    </item>
    <item android:state_selected="true" android:state_hovered="true">
        <shape>
            <corners android:radius="@dimen/list_item_height" />
            <solid android:color="@color/list_item_selected_background_color" />
        </shape>
    </item>
    <item android:state_selected="true">
        <color android:color="@color/list_item_selected_background_color"/>
        <shape>
            <corners android:radius="@dimen/list_item_height" />
            <solid android:color="@color/list_item_selected_background_color" />
        </shape>
    </item>

    <!-- unselected -->
    <item android:state_drag_hovered="true">
        <color android:color="?android:strokeColor"/>
        <shape android:tint="?attr/colorOnSurface">
            <corners android:radius="@dimen/list_item_height" />
            <solid android:color="@color/overlay_color_percentage_10" />
        </shape>
    </item>
    <item android:state_focused="true">
        <shape>
            <corners android:radius="@dimen/list_item_height" />
            <stroke
                android:width="@dimen/focus_ring_width"
                android:color="?attr/colorSecondary" />
        </shape>
    </item>
    <item android:state_hovered="true">
        <color android:color="@android:color/transparent"/>
    </item>
    <item android:state_selected="false"
          android:state_focused="false">
        <color android:color="?android:attr/colorBackground"/>
    <item>
        <color android:color="?attr/colorSurfaceBright"/>
    </item>
</selector>
 No newline at end of file
Loading