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

Commit 8ef010c4 authored by Austin Tankiang's avatar Austin Tankiang
Browse files

Constrain the height of the job progress list

In order to do this, change the inner layout of the panel to a
constraint layout.

This also adds the proper margin/padding around the list.

Bug: 385841754
Test: atest -c 'DocumentsUIGoogleTests:com.android.documentsui.JobPanelUiTest'
Flag: com.android.documentsui.flags.visual_signals_ro

Change-Id: I18035ed2cfc5d9f33fd5b2c770441f576cd91051
parent 24a15be8
Loading
Loading
Loading
Loading
+22 −9
Original line number Diff line number Diff line
@@ -17,27 +17,40 @@

<FrameLayout
    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="wrap_content">
    <com.google.android.material.card.MaterialCardView
        style="@style/JobProgressPanelStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
            android:orientation="vertical">
        android:layout_marginStart="@dimen/job_progress_panel_margin"
        android:layout_marginBottom="@dimen/job_progress_panel_margin">
        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <TextView
                android:id="@+id/job_progress_panel_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/job_progress_panel_title"
                android:layout_margin="@dimen/job_progress_panel_header_margin"
                android:text="@string/job_progress_panel_title"
                android:textAppearance="@style/JobProgressPanelHeaderText"
                android:layout_margin="@dimen/job_progress_panel_header_margin" />
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintBottom_toTopOf="@id/job_progress_list" />
            <androidx.recyclerview.widget.RecyclerView
                android:layout_width="match_parent"
                android:id="@+id/job_progress_list"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:id="@+id/job_progress_list" />
        </LinearLayout>
                android:layout_marginHorizontal="@dimen/job_progress_list_margin"
                android:paddingBottom="@dimen/job_progress_list_margin"
                android:clipToPadding="false"
                app:layout_constraintHeight_max="@dimen/job_progress_list_max_height"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@id/job_progress_panel_title"
                app:layout_constraintBottom_toBottomOf="parent" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </com.google.android.material.card.MaterialCardView>
</FrameLayout>
+4 −0
Original line number Diff line number Diff line
@@ -252,4 +252,8 @@
    <dimen name="job_progress_panel_width">360dp</dimen>
    <dimen name="job_progress_panel_margin">@dimen/space_small_1</dimen>
    <dimen name="job_progress_panel_header_margin">@dimen/space_small_1</dimen>

    <!-- 360dp - 2 * header margin (16dp) - header line height (24dp) -->
    <dimen name="job_progress_list_max_height">304dp</dimen>
    <dimen name="job_progress_list_margin">@dimen/space_extra_small_6</dimen>
</resources>
+0 −2
Original line number Diff line number Diff line
@@ -189,8 +189,6 @@
    </style>

    <style name="JobProgressPanelStyle" parent="@style/Widget.Material3.CardView.Elevated">
        <item name="android:layout_marginStart">@dimen/job_progress_panel_margin</item>
        <item name="android:layout_marginBottom">@dimen/job_progress_panel_margin</item>
        <item name="cardElevation">1dp</item>
        <item name="cardBackgroundColor">?attr/colorSurfaceDim</item>
    </style>