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

Commit a6f4ee8e authored by Luciano Pacheco's avatar Luciano Pacheco
Browse files

DocsUI M3: Re-style app bar for material 3

Update the sizes, margins and paddings.

Update the Toolbar to the material3 component, removing most of the
style customizations.

Removing actionBarSize to rely on material library default.

Test: Manual build, deploy apk and start it on DUT with flag off
Flag: com.android.documentsui.flags.use_material3
Bug: 377771946, 383172565
Change-Id: I1d456cc74c19d212a007c80f75019e49c6fe8a43
parent db8b9532
Loading
Loading
Loading
Loading
+0 −55
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.google.android.material.appbar.AppBarLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/app_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?android:attr/colorBackground">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?android:attr/actionBarSize"
        android:layout_margin="@dimen/search_bar_margin"
        android:background="?android:attr/colorBackground"
        android:theme="?actionBarTheme"
        android:popupTheme="?actionBarPopupTheme"
        android:elevation="3dp"
        app:collapseContentDescription="@string/button_back"
        app:titleTextAppearance="@style/ToolbarTitle"
        app:layout_collapseMode="pin">

        <TextView
            android:id="@+id/searchbar_title"
            android:layout_width="match_parent"
            android:layout_height="?android:attr/actionBarSize"
            android:layout_marginStart="@dimen/search_bar_text_margin_start"
            android:layout_marginEnd="@dimen/search_bar_text_margin_end"
            android:paddingStart="@dimen/search_bar_icon_padding"
            android:gravity="center_vertical"
            android:text="@string/search_bar_hint"
            android:textAppearance="@style/SearchBarTitle"
            android:drawableStart="@drawable/ic_menu_search"
            android:drawablePadding="@dimen/search_bar_icon_padding"/>

    </androidx.appcompat.widget.Toolbar>

    <include layout="@layout/directory_header"/>

</com.google.android.material.appbar.AppBarLayout>
 No newline at end of file
+4 −11
Original line number Diff line number Diff line
@@ -37,17 +37,10 @@

        </androidx.core.widget.NestedScrollView>

        <androidx.appcompat.widget.Toolbar
        <com.google.android.material.appbar.MaterialToolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?android:attr/actionBarSize"
            android:layout_margin="@dimen/search_bar_margin"
            android:background="?android:attr/colorBackground"
            android:theme="?actionBarTheme"
            android:popupTheme="?actionBarPopupTheme"
            android:elevation="@dimen/search_bar_elevation"
            app:collapseContentDescription="@string/button_back"
            app:titleTextAppearance="@style/ToolbarTitle"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="pin">

            <TextView
@@ -58,7 +51,7 @@
                android:text="@string/search_bar_hint"
                android:textAppearance="@style/SearchBarTitle" />

        </androidx.appcompat.widget.Toolbar>
        </com.google.android.material.appbar.MaterialToolbar>

    </com.google.android.material.appbar.CollapsingToolbarLayout>

+2 −3
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
    android:layout_height="wrap_content"
    android:orientation="vertical">


    <!-- used for search chip. -->
    <include layout="@layout/search_chip_row"/>

@@ -31,8 +30,8 @@
        android:clipChildren="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingLeft="@dimen/profile_tab_padding"
        android:paddingRight="@dimen/profile_tab_padding"
        android:paddingStart="@dimen/main_container_padding_start"
        android:paddingEnd="@dimen/main_container_padding_end"
        android:orientation="vertical">

        <com.google.android.material.tabs.TabLayout
+2 −2
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@
                android:layout_height="wrap_content"
                android:layout_gravity="bottom|center_horizontal"
                android:background="?android:attr/colorBackgroundFloating"
                android:elevation="8dp" />
                />

            <include layout="@layout/directory_app_bar"/>

@@ -88,7 +88,7 @@
            android:elevation="0dp"
            android:background="?android:attr/colorBackground">

            <androidx.appcompat.widget.Toolbar
            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/roots_toolbar"
                android:layout_width="match_parent"
                android:layout_height="?android:attr/actionBarSize"
+11 −16
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
            android:orientation="horizontal"
            android:baselineAligned="false">

            <!-- Navigation: left hand side. -->
            <FrameLayout
                android:id="@+id/container_roots"
                android:layout_width="256dp"
@@ -44,42 +45,35 @@
                android:layout_marginTop="@dimen/space_medium_1"
                />

            <!-- Main container for the right hand side. -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:background="@drawable/main_container_background"
                android:layout_margin="@dimen/space_small_1"
                android:layout_marginStart="0dp">
                android:layout_marginBottom="@dimen/space_extra_small_6"
                android:layout_marginTop="@dimen/main_container_margin_top"
                android:layout_marginEnd="@dimen/main_container_margin_end">

                <androidx.appcompat.widget.Toolbar
                <com.google.android.material.appbar.MaterialToolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?android:attr/actionBarSize"
                    android:layout_margin="@dimen/search_bar_margin"
                    android:elevation="3dp"
                    android:popupTheme="?actionBarPopupTheme"
                    android:theme="?actionBarTheme"
                    app:collapseContentDescription="@string/button_back"
                    app:titleTextAppearance="@style/ToolbarTitle">
                    android:layout_height="?attr/actionBarSize"
                    android:layout_marginTop="@dimen/action_bar_margin">

                    <TextView
                        android:id="@+id/searchbar_title"
                        android:layout_width="match_parent"
                        android:layout_height="?android:attr/actionBarSize"
                        android:layout_marginEnd="@dimen/search_bar_text_margin_end"
                        android:layout_marginStart="@dimen/search_bar_text_margin_start"
                        android:drawablePadding="@dimen/search_bar_icon_padding"
                        android:drawableStart="@drawable/ic_menu_search"
                        android:gravity="center_vertical"
                        android:paddingStart="@dimen/search_bar_icon_padding"
                        android:text="@string/search_bar_hint"
                        android:textAppearance="@style/SearchBarTitle" />

                </androidx.appcompat.widget.Toolbar>
                </com.google.android.material.appbar.MaterialToolbar>

                <include layout="@layout/directory_header" />

                <!-- Main list area (file list/grid or search results). -->
                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
@@ -99,6 +93,7 @@

                </FrameLayout>

                <!-- Footer of right hand side: Breadcrumbs and Picker footer. -->
                <com.android.documentsui.HorizontalBreadcrumb
                    android:id="@+id/horizontal_breadcrumb"
                    android:layout_width="match_parent"
Loading