Shows ripple effect inside CardPreference's rounded rectangle

contextual_card_background is a drawable which shows ripple.
Sets contextual_card_background as the foreground of
MaterialCardView.

Bug: 191617809
Test: manual visual
Change-Id: I09ee886fe56e443626042682381560ed0f32d51d
This commit is contained in:
Arc Wang
2021-06-25 16:18:03 +08:00
parent 73f539ed3f
commit 465560d388

View File

@@ -15,20 +15,19 @@
limitations under the License.
-->
<FrameLayout
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.card.MaterialCardView
android:id="@+id/container"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:foreground="@drawable/contextual_card_background"
android:clickable="true"
style="@style/ContextualCardStyle">
<include
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
style="@style/ContextualCardStyle">
<include
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="-8dp"
layout="@layout/settingslib_preference" />
</com.google.android.material.card.MaterialCardView>
</FrameLayout>
android:layout_marginStart="-8dp"
layout="@layout/settingslib_preference"/>
</com.google.android.material.card.MaterialCardView>