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

Commit c334f5a2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[DocsUI M3] Add navigation rail layout for medium size screen" into main

parents 2ee220bc 89c4d019
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_activated="true" android:color="?attr/colorSecondary" />
    <item android:color="?attr/colorOnSurfaceVariant" />
</selector>
+23 −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">
    <!-- By default the nav rail item has a grey background when it's focused, but we need the
     background to be put on the icon inside, so we override the focus background color to be
     transparent here.
     -->
    <item android:state_focused="true" android:drawable="@android:color/transparent" />
</selector>
 No newline at end of file
+145 −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.
-->

<ripple
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    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/nav_rail_item_icon_mask"/>

    <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/nav_rail_item_icon_bg_radius" />
                            <solid android:color="?attr/colorSecondaryContainer" />
                        </shape>
                    </item>
                    <item>
                        <shape android:tint="?attr/colorOnSecondaryContainer">
                            <corners android:radius="@dimen/nav_rail_item_icon_bg_radius" />
                            <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/nav_rail_item_icon_bg_radius" />
                            <solid android:color="?attr/colorSecondaryContainer" />
                        </shape>
                    </item>
                    <item>
                        <shape android:tint="?attr/colorOnSecondaryContainer">
                            <corners android:radius="@dimen/nav_rail_item_icon_bg_radius" />
                            <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/nav_rail_item_icon_bg_radius" />
                            <solid android:color="?attr/colorSecondaryContainer" />
                        </shape>
                    </item>
                    <item>
                        <shape>
                            <corners android:radius="@dimen/nav_rail_item_icon_bg_radius" />
                            <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/nav_rail_item_icon_bg_radius" />
                            <solid android:color="?attr/colorSecondaryContainer" />
                        </shape>
                    </item>
                    <item>
                        <shape android:tint="?attr/colorOnSecondaryContainer">
                            <corners android:radius="@dimen/nav_rail_item_icon_bg_radius" />
                            <solid android:color="@color/overlay_color_percentage_10" />
                        </shape>
                    </item>
                </layer-list>
            </item>
            <item android:state_activated="true">
                <shape>
                    <corners android:radius="@dimen/nav_rail_item_icon_bg_radius" />
                    <solid android:color="?attr/colorSecondaryContainer" />
                </shape>
            </item>

            <!-- Unselected. -->
            <item app:state_highlighted="true">
                <shape android:tint="?attr/colorOnSurface">
                    <corners android:radius="@dimen/nav_rail_item_icon_bg_radius" />
                    <solid android:color="@color/overlay_color_percentage_10" />
                </shape>
            </item>
            <item android:state_pressed="true">
                <shape android:tint="?attr/colorOnSurface">
                    <corners android:radius="@dimen/nav_rail_item_icon_bg_radius" />
                    <solid android:color="@color/overlay_color_percentage_10" />
                </shape>
            </item>
            <item android:state_focused="true">
                <shape>
                    <corners android:radius="@dimen/nav_rail_item_icon_bg_radius" />
                    <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/nav_rail_item_icon_bg_radius" />
                    <solid android:color="@color/overlay_color_percentage_10" />
                </shape>
            </item>

            <!-- Default: use the container background. -->
            <item android:drawable="@android:color/transparent" />
        </selector>
    </item>
</ripple>
 No newline at end of file
+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.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <corners android:radius="@dimen/nav_rail_item_icon_bg_radius"/>
    <!-- The color here doesn't matter, it's just being used as a mask. -->
    <solid android:color="@android:color/white" />
</shape>
 No newline at end of file
+25 −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.
-->

<com.android.documentsui.sidebar.RootsList xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/roots_list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:keyboardNavigationCluster="true"
    android:divider="@null"
    android:focusable="false"
    android:descendantFocusability="afterDescendants"
    style="@style/NavRailStyle"/>
Loading