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

Commit 0149de4a authored by Wenbo Jie's avatar Wenbo Jie
Browse files

[DocsUI M3] Fix alignment issues in RTL

* Normalize padding for breadcrumb to make sure it align correctly
  in both LTR and RTL modes.
* Handle RTL for Profile tabs layout.
* Handle RTL for Search chip group.

Check the attached bug for demo.

Bug: 385784063
Test: m DocumentsUIGoogle && manual inspection
Flag: com.android.documentsui.flags.use_material3
Change-Id: Iee5f4a8dcdbbc2c416233dd3d05ce3cd2e2d07e3
parent e1604abe
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -83,7 +83,8 @@
                    android:id="@+id/horizontal_breadcrumb"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="?attr/colorSurfaceBright" />
                    android:background="?attr/colorSurfaceBright"
                    android:paddingHorizontal="@dimen/breadcrumb_padding_horizontal" />

                <androidx.coordinatorlayout.widget.CoordinatorLayout
                    android:id="@+id/container_save"
+2 −1
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@
                <com.android.documentsui.HorizontalBreadcrumb
                    android:id="@+id/horizontal_breadcrumb"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
                    android:layout_height="wrap_content"
                    android:paddingHorizontal="@dimen/breadcrumb_padding_horizontal" />

            </LinearLayout>

+2 −1
Original line number Diff line number Diff line
@@ -147,7 +147,8 @@
                    <com.android.documentsui.HorizontalBreadcrumb
                        android:id="@+id/horizontal_breadcrumb"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />
                        android:layout_height="wrap_content"
                        android:paddingHorizontal="@dimen/breadcrumb_padding_horizontal" />
                </LinearLayout>

                <androidx.coordinatorlayout.widget.CoordinatorLayout
+16 −5
Original line number Diff line number Diff line
@@ -20,10 +20,21 @@
    android:layout_height="wrap_content"
    android:scrollbars="none">

    <!-- This additional FrameLayout layer is essential to make HorizontalScrollView work with the
         marginHorizontal on the ChipGroup below, without this the scroll behavior is weird.
         Alternatively we could use paddingHorizontal on the ChipGroup below to make it work with
         HorizontalScrollView, but that cause a weird padding issue in RTL.
    -->
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.google.android.material.chip.ChipGroup
            android:id="@+id/search_chip_group"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
        android:paddingHorizontal="@dimen/main_container_padding_start"
            android:layout_marginHorizontal="@dimen/main_container_padding_start"
            android:paddingVertical="@dimen/search_chip_group_padding_vertical" />

    </FrameLayout>
</HorizontalScrollView>
+5 −0
Original line number Diff line number Diff line
@@ -58,7 +58,12 @@
    <dimen name="list_item_icon_padding">16dp</dimen>
    <dimen name="list_divider_inset">72dp</dimen>
    <!-- block end -->
    <dimen name="breadcrumb_padding_horizontal">@dimen/space_small_3</dimen>
    <!-- TODO(b/379776735): remove this after use_material3 flag is launched. -->
    <dimen name="breadcrumb_item_padding">8dp</dimen>
    <dimen name="breadcrumb_item_padding_horizontal">12dp</dimen>
    <dimen name="breadcrumb_item_padding_vertical">6dp</dimen>
    <dimen name="breadcrumb_item_arrow_padding">@dimen/space_extra_small_2</dimen>
    <dimen name="breadcrumb_item_height">36dp</dimen>
    <dimen name="dir_elevation">8dp</dimen>
    <dimen name="drag_shadow_size">120dp</dimen>
Loading