|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | <com.google.android.gms.ads.nativead.NativeAdView xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
3 | 4 | android:layout_width="match_parent" |
4 | 5 | android:layout_height="wrap_content"> |
5 | 6 |
|
6 | | - <LinearLayout |
7 | | - android:id="@+id/ad_host" |
| 7 | + <com.google.android.material.card.MaterialCardView |
| 8 | + android:id="@+id/ad_card" |
| 9 | + style="@style/Widget.Material3.CardView.Outlined" |
8 | 10 | android:layout_width="match_parent" |
9 | 11 | android:layout_height="wrap_content" |
10 | | - android:orientation="vertical" |
11 | | - android:background="?attr/colorSurfaceContainer" |
12 | | - android:paddingStart="16dp" |
13 | | - android:paddingEnd="16dp" |
14 | | - android:paddingTop="12dp" |
15 | | - android:paddingBottom="12dp"> |
16 | | - |
17 | | - <include layout="@layout/ad_attribution" /> |
| 12 | + app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.CardView"> |
18 | 13 |
|
19 | 14 | <LinearLayout |
20 | 15 | android:layout_width="match_parent" |
21 | 16 | android:layout_height="wrap_content" |
22 | | - android:gravity="center_vertical" |
23 | | - android:orientation="horizontal"> |
| 17 | + android:orientation="vertical" |
| 18 | + android:background="?attr/colorSurfaceContainer" |
| 19 | + android:paddingStart="16dp" |
| 20 | + android:paddingEnd="16dp" |
| 21 | + android:paddingTop="12dp" |
| 22 | + android:paddingBottom="12dp"> |
24 | 23 |
|
25 | | - <ImageView |
26 | | - android:id="@+id/ad_app_icon" |
27 | | - android:layout_width="32dp" |
28 | | - android:layout_height="32dp" |
29 | | - android:layout_marginEnd="12dp" /> |
| 24 | + <include layout="@layout/ad_attribution" /> |
30 | 25 |
|
31 | 26 | <LinearLayout |
32 | | - android:layout_width="0dp" |
| 27 | + android:layout_width="match_parent" |
33 | 28 | android:layout_height="wrap_content" |
34 | | - android:layout_weight="1" |
35 | | - android:orientation="vertical"> |
| 29 | + android:gravity="center_vertical" |
| 30 | + android:orientation="horizontal"> |
36 | 31 |
|
37 | | - <TextView |
38 | | - android:id="@+id/ad_headline" |
39 | | - android:layout_width="wrap_content" |
| 32 | + <ImageView |
| 33 | + android:id="@+id/ad_app_icon" |
| 34 | + android:layout_width="32dp" |
| 35 | + android:layout_height="32dp" |
| 36 | + android:layout_marginEnd="12dp" /> |
| 37 | + |
| 38 | + <LinearLayout |
| 39 | + android:layout_width="0dp" |
40 | 40 | android:layout_height="wrap_content" |
41 | | - android:ellipsize="end" |
42 | | - android:maxLines="1" |
43 | | - android:textAppearance="@style/TextAppearance.Material3.BodyMedium" /> |
| 41 | + android:layout_weight="1" |
| 42 | + android:orientation="vertical"> |
| 43 | + |
| 44 | + <TextView |
| 45 | + android:id="@+id/ad_headline" |
| 46 | + android:layout_width="wrap_content" |
| 47 | + android:layout_height="wrap_content" |
| 48 | + android:ellipsize="end" |
| 49 | + android:maxLines="1" |
| 50 | + android:textAppearance="@style/TextAppearance.Material3.BodyMedium" /> |
44 | 51 |
|
45 | | - <TextView |
46 | | - android:id="@+id/ad_body" |
| 52 | + <TextView |
| 53 | + android:id="@+id/ad_body" |
| 54 | + android:layout_width="wrap_content" |
| 55 | + android:layout_height="wrap_content" |
| 56 | + android:ellipsize="end" |
| 57 | + android:maxLines="1" |
| 58 | + android:textAppearance="@style/TextAppearance.Material3.BodySmall" /> |
| 59 | + </LinearLayout> |
| 60 | + |
| 61 | + <com.google.android.material.button.MaterialButton |
| 62 | + android:id="@+id/ad_call_to_action" |
| 63 | + style="@style/Widget.Material3.Button.TextButton" |
47 | 64 | android:layout_width="wrap_content" |
48 | 65 | android:layout_height="wrap_content" |
49 | | - android:ellipsize="end" |
50 | | - android:maxLines="1" |
51 | | - android:textAppearance="@style/TextAppearance.Material3.BodySmall" /> |
| 66 | + android:minWidth="88dp" |
| 67 | + android:minHeight="40dp" |
| 68 | + android:layout_marginStart="8dp" /> |
52 | 69 | </LinearLayout> |
53 | | - |
54 | | - <com.google.android.material.button.MaterialButton |
55 | | - android:id="@+id/ad_call_to_action" |
56 | | - style="@style/Widget.Material3.Button.TextButton" |
57 | | - android:layout_width="wrap_content" |
58 | | - android:layout_height="wrap_content" |
59 | | - android:minWidth="88dp" |
60 | | - android:minHeight="40dp" |
61 | | - android:layout_marginStart="8dp" /> |
62 | 70 | </LinearLayout> |
63 | | - </LinearLayout> |
| 71 | + </com.google.android.material.card.MaterialCardView> |
64 | 72 | </com.google.android.gms.ads.nativead.NativeAdView> |
0 commit comments