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

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

DocsUI M3: Move parts of the app bar around

This CL mostly just move things around, follow up restyles them.

Move the buttons/menu-items: sub_menu_grid and sub_menu_list from the
sub_menu to options_menu_search. Update logic handling their
visibility to account for this move.

Move the breadcrumb to the bottom without re-styling it yet, so its
appearance isn't ideal yet.

Update the Snackbars to be anchored on coordinator_layout instead of
container_save because it snackbar messages were pushing the breadcrumb
up when displaying the message.

Test: Manual build, deploy apk and start it on DUT with flag off
Flag: com.android.documentsui.flags.use_material3
Bug: 377771946
Change-Id: Ie27cf066a65a7a89931c1f16c537dcedd0008f22
parent 9ffb04ab
Loading
Loading
Loading
Loading
+0 −31
Original line number Diff line number Diff line
@@ -20,10 +20,6 @@
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <com.android.documentsui.HorizontalBreadcrumb
        android:id="@+id/horizontal_breadcrumb"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <!-- used for search chip. -->
    <include layout="@layout/search_chip_row"/>
@@ -62,33 +58,6 @@
    <!-- used for apps row. -->
    <include layout="@layout/apps_row"/>

    <LinearLayout
        android:id="@+id/header_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/root_info_header_horizontal_padding"
        android:layout_marginEnd="@dimen/root_info_header_horizontal_padding"
        android:minHeight="@dimen/root_info_header_height"
        android:accessibilityHeading="true">

        <TextView
            android:id="@+id/header_title"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:textAppearance="@style/SectionHeader"
            android:maxLines="1"
            android:ellipsize="end"
            android:gravity="start|center_vertical"/>

        <androidx.appcompat.widget.ActionMenuView
            android:id="@+id/sub_menu"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|center_vertical"/>

    </LinearLayout>

    <!-- column headers are empty on small screens, in portrait or in grid mode. -->
    <include layout="@layout/column_headers"/>

+7 −0
Original line number Diff line number Diff line
@@ -60,6 +60,13 @@
                    android:layout_height="match_parent"/>
            </FrameLayout>

            <com.android.documentsui.HorizontalBreadcrumb
                android:id="@+id/horizontal_breadcrumb"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                />

            <androidx.coordinatorlayout.widget.CoordinatorLayout
                android:id="@+id/container_save"
                android:layout_width="match_parent"
+5 −0
Original line number Diff line number Diff line
@@ -99,6 +99,11 @@

                </FrameLayout>

                <com.android.documentsui.HorizontalBreadcrumb
                    android:id="@+id/horizontal_breadcrumb"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />

                <androidx.coordinatorlayout.widget.CoordinatorLayout
                    android:id="@+id/container_save"
                    android:layout_width="match_parent"
+10 −0
Original line number Diff line number Diff line
@@ -33,6 +33,16 @@
        android:visible="false"
        app:showAsAction="always|collapseActionView"
        app:actionViewClass="androidx.appcompat.widget.SearchView"/>
    <item
        android:id="@+id/sub_menu_grid"
        android:title="@string/menu_grid"
        android:icon="@drawable/ic_menu_view_grid"
        app:showAsAction="always" />
    <item
        android:id="@+id/sub_menu_list"
        android:title="@string/menu_list"
        android:icon="@drawable/ic_menu_view_list"
        app:showAsAction="always" />
<!-- This group is being hidden when searching is in full bar mode-->
    <group android:id="@+id/group_hide_when_searching">
        <item
+0 −31
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.
-->

<menu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/sub_menu_grid"
        android:title="@string/menu_grid"
        android:icon="@drawable/ic_menu_view_grid"
        app:showAsAction="always"/>
    <item
        android:id="@+id/sub_menu_list"
        android:title="@string/menu_list"
        android:icon="@drawable/ic_menu_view_list"
        app:showAsAction="always"/>
</menu>
 No newline at end of file
Loading