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

Commit e0117924 authored by Tony Huang's avatar Tony Huang
Browse files

Use MaterialCardView on grid item to make round corner

Make round corner on grid item looks same as mock

Bug: 112621961
Test: atest DocumentsUITests
Change-Id: I0a6b9539507e723d7195f75995d097e41300c05d
parent 0c375989
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -11,7 +11,8 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \
        androidx.design_design \
        androidx.transition_transition \
        androidx.recyclerview_recyclerview \
        androidx.recyclerview_recyclerview-selection
        androidx.recyclerview_recyclerview-selection \
        com.google.android.material_material

LOCAL_USE_AAPT2 := true

+15 −12
Original line number Diff line number Diff line
@@ -21,19 +21,22 @@
     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 xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
    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"
    android:layout_margin="@dimen/grid_item_margin"
    android:orientation="vertical"
    android:background="@drawable/grid_item_background"
    android:elevation="@dimen/grid_item_elevation"
    android:focusable="true">

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:duplicateParentState="true">
        android:duplicateParentState="true"
        android:background="@drawable/grid_item_background"
        app:cardUseCompatPadding="true"
        app:cardCornerRadius="@dimen/grid_item_radius"
        app:cardElevation="@dimen/grid_item_elevation">

        <!-- The height is 48px.
             paddingTop (9dp) + @dimen/check_icon_size (30dp) + paddingBottom (9dp) -->
@@ -97,6 +100,6 @@
            android:contentDescription="@null"
            android:duplicateParentState="true"/>

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

</LinearLayout>
 No newline at end of file
+129 −119
Original line number Diff line number Diff line
@@ -20,16 +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 xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
    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"
    android:layout_margin="@dimen/grid_item_margin"
    android:orientation="vertical"
    android:background="@drawable/grid_item_background"
    android:elevation="@dimen/grid_item_elevation"
    android:focusable="true">

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/grid_item_background"
        android:focusable="true"
        app:cardUseCompatPadding="true"
        app:cardCornerRadius="@dimen/grid_item_radius"
        app:cardElevation="@dimen/grid_item_elevation">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:duplicateParentState="true">
@@ -164,4 +172,6 @@

        </RelativeLayout>

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

</LinearLayout>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
-->

<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <style name="DocumentsTheme" parent="@style/Theme.AppCompat">
    <style name="DocumentsTheme" parent="@style/Theme.MaterialComponents.NoActionBar">
        <item name="actionBarWidgetTheme">@null</item>
        <item name="actionBarTheme">@style/ActionBarTheme</item>
        <item name="actionBarPopupTheme">@style/ActionBarPopupTheme</item>
+2 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
-->

<resources>
    <dimen name="grid_container_padding">10dp</dimen>
    <dimen name="grid_container_padding">4dp</dimen>
    <dimen name="list_container_padding">0dp</dimen>
    <dimen name="icon_size">40dp</dimen>
    <dimen name="root_icon_size">24dp</dimen>
@@ -41,6 +41,7 @@
    <dimen name="dir_elevation">8dp</dimen>
    <dimen name="drag_shadow_size">120dp</dimen>
    <dimen name="grid_item_elevation">2dp</dimen>
    <dimen name="grid_item_radius">8dp</dimen>
    <dimen name="max_drawer_width">280dp</dimen>

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