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

Commit ca59241c authored by Wenbo Jie's avatar Wenbo Jie
Browse files

[DocsUI M3] Update styles for nav tree item row

Check the bug item for demo video.

Bug: 381959045
Test: Manually inspect after deployment
Flag: com.android.documentsui.flags.use_material3
Change-Id: Ie51a29fde20eddbb4593852585fa89cd7180535c
parent a6f4ee8e
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -15,10 +15,9 @@
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_activated="false"
        android:color="?android:colorControlNormal" />
    <item
        android:state_activated="true"
        android:color="?android:colorControlActivated" />
        android:color="?attr/colorOnSecondaryContainer" />
    <item
        android:color="?attr/colorOnSurfaceVariant" />
</selector>
+2 −4
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_focused="true" android:state_activated="true" android:color="?android:colorControlActivated" />
    <item android:state_focused="false" android:state_activated="true" android:color="?android:colorControlActivated" />
    <item android:state_enabled="false" android:alpha="0.5" android:color="?android:textColorPrimary" />
    <item android:color="?android:textColorPrimary" />
    <item android:state_activated="true" android:color="?attr/colorOnSecondaryContainer" />
    <item android:color="?attr/colorOnSurfaceVariant" />
</selector>
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 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

      https://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_activated="true"
        android:alpha="@dimen/ripple_overlay_alpha" android:color="?attr/colorOnSecondaryContainer"/>
    <item android:alpha="@dimen/ripple_overlay_alpha" android:color="?attr/colorOnSurface"/>
</selector>
 No newline at end of file
+2 −6
Original line number Diff line number Diff line
@@ -16,10 +16,6 @@
  -->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_focused="true" android:state_activated="true"
        android:color="?android:colorControlActivated" />
    <item android:state_focused="false" android:state_activated="true"
        android:color="?android:colorControlActivated" />
    <item android:state_enabled="false" android:alpha="0.5" android:color="?android:textColorSecondary" />
    <item android:color="?android:textColorSecondary" />
    <item android:state_activated="true" android:color="?attr/colorOnSecondaryContainer" />
    <item android:color="?attr/colorOnSurfaceVariant" />
</selector>
+97 −11
Original line number Diff line number Diff line
@@ -17,27 +17,113 @@
<ripple
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:color="?android:attr/colorControlHighlight">
    android:color="@color/item_root_ripple_color">

    <!-- The mask below only works for the ripple itself, doesn't work for other <item>s, we
         need to explicitly apply the drawable if the other items also need this mask. -->
    <item
        android:id="@android:id/mask"
        android:drawable="@drawable/root_list_selector"/>

    <item>
        <selector>
            <!-- Selected (activated). -->
            <!-- Highlight: when dragging files over the item. -->
            <item android:state_activated="true" app:state_highlighted="true">
                <layer-list>
                    <item>
                        <shape>
                            <corners android:radius="@dimen/drawer_item_height"/>
                            <solid android:color="?attr/colorSecondaryContainer"/>
                        </shape>
                    </item>
                    <item>
                        <shape android:tint="?attr/colorOnSecondaryContainer">
                            <corners android:radius="@dimen/drawer_item_height"/>
                            <solid android:color="@color/overlay_color_percentage_10"/>
                        </shape>
                    </item>
                </layer-list>
            </item>
            <item android:state_activated="true" android:state_pressed="true">
                <layer-list>
                    <item>
                        <shape>
                            <corners android:radius="@dimen/drawer_item_height"/>
                            <solid android:color="?attr/colorSecondaryContainer"/>
                        </shape>
                    </item>
                    <item>
                        <shape android:tint="?attr/colorOnSecondaryContainer">
                            <corners android:radius="@dimen/drawer_item_height"/>
                            <solid android:color="@color/overlay_color_percentage_10"/>
                        </shape>
                    </item>
                </layer-list>
            </item>
            <item android:state_activated="true" android:state_focused="true">
                <layer-list>
                    <item>
                        <shape>
                            <corners android:radius="@dimen/drawer_item_height"/>
                            <solid android:color="?attr/colorSecondaryContainer"/>
                        </shape>
                    </item>
                    <item>
                        <shape>
                            <corners android:radius="@dimen/drawer_item_height"/>
                            <stroke android:width="@dimen/focus_ring_width" android:color="?attr/colorSecondary"/>
                        </shape>
                    </item>
                </layer-list>
            </item>
            <item android:state_activated="true" android:state_hovered="true">
                <layer-list>
                    <item>
                        <shape>
                            <corners android:radius="@dimen/drawer_item_height"/>
                            <solid android:color="?attr/colorSecondaryContainer"/>
                        </shape>
                    </item>
                    <item>
                        <shape android:tint="?attr/colorOnSecondaryContainer">
                            <corners android:radius="@dimen/drawer_item_height"/>
                            <solid android:color="@color/overlay_color_percentage_10"/>
                        </shape>
                    </item>
                </layer-list>
            </item>
            <item android:state_activated="true" android:drawable="@drawable/root_list_selector"/>

            <!-- Unselected. -->
            <item app:state_highlighted="true">
                <color android:color="?android:attr/colorControlHighlight"/>
                <shape android:tint="?attr/colorOnSurface">
                    <corners android:radius="@dimen/drawer_item_height"/>
                    <solid android:color="@color/overlay_color_percentage_10"/>
                </shape>
            </item>
            <item
                app:state_highlighted="false"
                android:drawable="@android:color/transparent"/>
        </selector>
            <item android:state_pressed="true">
                <shape android:tint="?attr/colorOnSurface">
                    <corners android:radius="@dimen/drawer_item_height"/>
                    <solid android:color="@color/overlay_color_percentage_10"/>
                </shape>
            </item>
            <item android:state_focused="true">
                <shape>
                    <corners android:radius="@dimen/drawer_item_height"/>
                    <stroke android:width="@dimen/focus_ring_width" android:color="?attr/colorSecondary"/>
                </shape>
            </item>
            <item android:state_hovered="true">
                <shape android:tint="?attr/colorOnSurface">
                    <corners android:radius="@dimen/drawer_item_height"/>
                    <solid android:color="@color/overlay_color_percentage_10"/>
                </shape>
            </item>

    <item>
        <selector>
            <!-- Default: use the container background. -->
            <item
                android:state_activated="true"
                android:drawable="@drawable/root_list_selector"/>
                android:drawable="@android:color/transparent"/>
        </selector>
    </item>
</ripple>
 No newline at end of file
Loading