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

Commit 872138dc authored by Wenbo Jie's avatar Wenbo Jie
Browse files

[DocsUI M3] Move drawer burger menu to nav rail

For medium size screen, we show a nav rail on the left side,
if nav rail exists, we don't want to show the drawer burger menu
on the toolbar, instead, we want to show it on the top of the
nav rail.

Check the attached bug for demo video.

Bug: 385652028
Test: m DocumentsUIGoogle && manual inspection
Flag: com.android.documentsui.flags.use_material3
Change-Id: I6dcfbbf99ab16ce1db83fc0002088a2f3e3621f9
parent 315018fa
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2025 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:alpha="@dimen/ripple_overlay_alpha" android:color="?attr/colorOnSurfaceVariant" />
</selector>
+1 −1
Original line number Diff line number Diff line
@@ -20,6 +20,6 @@
        android:viewportWidth="24"
        android:viewportHeight="24">
    <path
        android:fillColor="?android:attr/colorControlNormal"
        android:fillColor="?attr/colorOnSurface"
        android:pathData="M3,18h18v-2H3V18zM3,13h18v-2H3V13zM3,6v2h18V6H3z"/>
</vector>
 No newline at end of file
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2025 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_pressed="true"
        android:color="?attr/colorOnSurfaceVariant"
        android:alpha="@dimen/hover_overlay_alpha" />
    <item android:state_hovered="true"
        android:color="?attr/colorOnSurfaceVariant"
        android:alpha="@dimen/hover_overlay_alpha" />
    <item android:color="@android:color/transparent" />
</selector>
+28 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
     floating action buttons) to operate correctly. -->
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/coordinator_layout">
@@ -39,11 +40,35 @@
            android:background="?attr/colorSurfaceContainer">

            <!-- Navigation rail: left hand side. -->
            <FrameLayout
                android:id="@+id/nav_rail_container_roots"
            <LinearLayout
                android:id="@+id/nav_rail_container"
                android:layout_width="144dp"
                android:layout_height="match_parent"
                />
                android:orientation="vertical"
                android:gravity="center_horizontal">

                <com.google.android.material.button.MaterialButton
                    style="?attr/materialIconButtonStyle"
                    android:id="@+id/nav_rail_burger_menu"
                    android:layout_width="@dimen/nav_rail_burger_icon_size"
                    android:layout_height="@dimen/nav_rail_burger_icon_size"
                    android:layout_marginBottom="24dp"
                    app:iconPadding="0dp"
                    app:iconGravity="textStart"
                    app:iconTint="?attr/colorOnSurfaceVariant"
                    app:backgroundTint="@drawable/nav_rail_burger_icon_background"
                    app:rippleColor="@color/nav_rail_burger_icon_ripple_color"
                    app:strokeColor="?attr/colorPrimary"
                    android:contentDescription="@string/drawer_open"
                    app:icon="@drawable/ic_hamburger" />

                <FrameLayout
                    android:id="@+id/nav_rail_container_roots"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1" />

            </LinearLayout>

            <!-- Main container for the right hand side. -->
            <LinearLayout
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
    we zero here, to avoid pushing the title further. -->
    <dimen name="search_bar_text_margin_start">0dp</dimen>

    <dimen name="toolbar_padding_start">@dimen/space_small_3</dimen>
    <dimen name="toolbar_padding_start">@dimen/main_container_padding_start</dimen>

    <dimen name="list_container_padding">@dimen/space_extra_small_6</dimen>
</resources>
Loading