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

Commit 2082a258 authored by Tony Huang's avatar Tony Huang
Browse files

Polish card view and directory padding

Polish the card view and directory by design requirement,
to solve layout shift up and down after switching display mode.

Fix: 123401745
Fix: 126181453
Test: visual
Test: atest DocumentsUITests
Change-Id: Ib1d2877cfa25e1adc3440deb2f7a6364016217b7
parent 9e14c9f5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,5 +19,5 @@
    <stroke
        android:width="2dp"
        android:color="@color/item_doc_grid_border"/>
    <corners android:radius="@dimen/grid_item_border_radius"/>
    <corners android:radius="@dimen/grid_item_radius"/>
</shape>
+19 −15
Original line number Diff line number Diff line
@@ -21,20 +21,24 @@
     to focus and selection states, some of which are specific to keyboard
     when touch mode is not enable. So, if you, heroic engineer of the future,
     decide to rip these out, please be sure to check out focus and keyboards. -->
<LinearLayout
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/item_root"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_margin="4dp"
    android:layout_margin="2dp"
    android:focusable="true">

    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="2dp"
        android:duplicateParentState="true">
        android:elevation="0dp"
        android:duplicateParentState="true"
        app:cardElevation="0dp"
        app:strokeWidth="1dp"
        app:strokeColor="@color/item_grid_stroke">

        <!-- The height is 48px.
             paddingTop (9dp) + @dimen/check_icon_size (30dp) + paddingBottom (9dp) -->
@@ -81,22 +85,22 @@
                android:ellipsize="end"
                android:singleLine="true"
                android:textAlignment="viewStart"
                android:textAppearance="@android:style/TextAppearance.Material.Subhead"
                android:textAppearance="@style/CardPrimaryText"
                android:layout_marginBottom="9dp"
                android:layout_marginEnd="12dp"
                android:layout_marginTop="9dp"/>

        </LinearLayout>

        <!-- An overlay that draws the item border when it is focused. -->
    </com.google.android.material.card.MaterialCardView>

    <!-- An overlay that draws the item border when it is focused. -->
    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="1dp"
        android:background="@drawable/item_doc_grid_border_rounded"
        android:contentDescription="@null"
        android:duplicateParentState="true"/>

    </com.google.android.material.card.MaterialCardView>

</LinearLayout>
 No newline at end of file
</FrameLayout>
 No newline at end of file
+19 −18
Original line number Diff line number Diff line
@@ -20,20 +20,24 @@
     to focus and selection states, some of which are specific to keyboard
     when touch mode is not enable. So, if you, heroic engineer of the future,
     decide to rip these out, please be sure to check out focus and keyboards. -->
<LinearLayout
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/item_root"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_margin="4dp"
    android:layout_margin="2dp"
    android:focusable="true">

    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="2dp"
        android:duplicateParentState="true">
        android:elevation="0dp"
        android:duplicateParentState="true"
        app:cardElevation="0dp"
        app:strokeWidth="1dp"
        app:strokeColor="@color/item_grid_stroke">

        <RelativeLayout
            android:layout_width="match_parent"
@@ -148,7 +152,7 @@
                        android:singleLine="true"
                        android:ellipsize="end"
                        android:textAlignment="viewStart"
                        android:textAppearance="?android:attr/textAppearanceListItem"/>
                        android:textAppearance="@style/CardPrimaryText"/>

                    <TextView
                        android:id="@+id/details"
@@ -176,20 +180,17 @@

            </LinearLayout>

        </RelativeLayout>

    </com.google.android.material.card.MaterialCardView>

    <!-- An overlay that draws the item border when it is focused. -->
    <View
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@id/nameplate"
                android:layout_alignTop="@id/thumbnail"
                android:layout_alignLeft="@id/thumbnail"
                android:layout_alignRight="@id/thumbnail"
                android:contentDescription="@null"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="1dp"
        android:background="@drawable/item_doc_grid_border_rounded"
        android:contentDescription="@null"
        android:duplicateParentState="true"/>

        </RelativeLayout>

    </com.google.android.material.card.MaterialCardView>

</LinearLayout>
</FrameLayout>
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@
    <color name="item_doc_droppable_background">#ffe8f0fb</color>
    <color name="item_doc_not_droppable_background">#ffe0e0e0</color>
    <color name="item_grid_tint">#ff127beb</color>
    <color name="item_grid_stroke">#DADCE0</color>

    <color name="item_drag_shadow_background">@android:color/white</color>
    <color name="item_drag_shadow_container_background">@android:color/transparent</color>
+1 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
    <!-- Material design rounded radius -->
    <dimen name="material_round_radius">2dp</dimen>

    <dimen name="grid_container_padding">4dp</dimen>
    <dimen name="grid_container_padding">20dp</dimen>
    <dimen name="list_container_padding">0dp</dimen>
    <dimen name="icon_size">40dp</dimen>
    <dimen name="root_icon_size">24dp</dimen>
@@ -48,7 +48,6 @@
    <dimen name="drag_shadow_size">120dp</dimen>
    <dimen name="grid_item_elevation">2dp</dimen>
    <dimen name="grid_item_radius">2dp</dimen>
    <dimen name="grid_item_border_radius">1dp</dimen>
    <dimen name="max_drawer_width">280dp</dimen>

    <dimen name="drawer_edge_width">12dp</dimen>
Loading