|
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 | | - <androidx.appcompat.widget.LinearLayoutCompat |
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:background="?attr/colorSurfaceContainer" |
11 | | - android:orientation="vertical" |
12 | | - android:paddingHorizontal="16dp"> |
13 | | - |
14 | | - <include |
15 | | - layout="@layout/ad_attribution" |
16 | | - android:layout_width="wrap_content" |
17 | | - android:layout_height="wrap_content" |
18 | | - android:layout_marginTop="4dp" /> |
| 12 | + app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.CardViewTopRounded"> |
19 | 13 |
|
20 | 14 | <androidx.appcompat.widget.LinearLayoutCompat |
21 | 15 | android:layout_width="match_parent" |
22 | 16 | android:layout_height="wrap_content" |
23 | | - android:gravity="center_vertical" |
24 | | - android:orientation="horizontal"> |
| 17 | + android:orientation="vertical" |
| 18 | + android:padding="16dp"> |
25 | 19 |
|
26 | | - <androidx.appcompat.widget.AppCompatImageView |
27 | | - android:id="@+id/ad_app_icon" |
28 | | - android:layout_width="32dp" |
29 | | - android:layout_height="32dp" |
30 | | - android:layout_marginEnd="12dp" /> |
| 20 | + <include layout="@layout/ad_attribution" /> |
31 | 21 |
|
32 | 22 | <androidx.appcompat.widget.LinearLayoutCompat |
33 | | - android:layout_width="0dp" |
| 23 | + android:layout_width="match_parent" |
34 | 24 | android:layout_height="wrap_content" |
35 | | - android:layout_weight="1" |
36 | | - android:orientation="vertical"> |
| 25 | + android:layout_marginTop="8dp" |
| 26 | + android:gravity="center_vertical" |
| 27 | + android:orientation="horizontal"> |
37 | 28 |
|
38 | | - <com.google.android.material.textview.MaterialTextView |
39 | | - android:id="@+id/ad_headline" |
40 | | - android:layout_width="wrap_content" |
| 29 | + <FrameLayout |
| 30 | + android:layout_width="40dp" |
| 31 | + android:layout_height="40dp" |
| 32 | + android:layout_marginEnd="12dp"> |
| 33 | + |
| 34 | + <com.google.android.gms.ads.nativead.MediaView |
| 35 | + android:id="@+id/ad_media" |
| 36 | + android:layout_width="match_parent" |
| 37 | + android:layout_height="match_parent" /> |
| 38 | + |
| 39 | + <androidx.appcompat.widget.AppCompatImageView |
| 40 | + android:id="@+id/ad_app_icon" |
| 41 | + android:layout_width="match_parent" |
| 42 | + android:layout_height="match_parent" |
| 43 | + android:visibility="gone" /> |
| 44 | + </FrameLayout> |
| 45 | + |
| 46 | + <androidx.appcompat.widget.LinearLayoutCompat |
| 47 | + android:layout_width="0dp" |
41 | 48 | android:layout_height="wrap_content" |
42 | | - android:ellipsize="end" |
43 | | - android:maxLines="1" |
44 | | - android:textAppearance="@style/TextAppearance.Material3.BodyMedium" /> |
| 49 | + android:layout_weight="1" |
| 50 | + android:orientation="vertical"> |
45 | 51 |
|
46 | | - <com.google.android.material.textview.MaterialTextView |
47 | | - android:id="@+id/ad_body" |
| 52 | + <com.google.android.material.textview.MaterialTextView |
| 53 | + android:id="@+id/ad_headline" |
| 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.BodyMedium" /> |
| 59 | + |
| 60 | + <com.google.android.material.textview.MaterialTextView |
| 61 | + android:id="@+id/ad_body" |
| 62 | + android:layout_width="wrap_content" |
| 63 | + android:layout_height="wrap_content" |
| 64 | + android:ellipsize="end" |
| 65 | + android:maxLines="1" |
| 66 | + android:textAppearance="@style/TextAppearance.Material3.BodySmall" /> |
| 67 | + </androidx.appcompat.widget.LinearLayoutCompat> |
| 68 | + |
| 69 | + <com.google.android.material.button.MaterialButton |
| 70 | + android:id="@+id/ad_call_to_action" |
| 71 | + style="@style/Widget.Material3.Button.TextButton" |
48 | 72 | android:layout_width="wrap_content" |
49 | 73 | android:layout_height="wrap_content" |
50 | | - android:ellipsize="end" |
51 | | - android:maxLines="1" |
52 | | - android:textAppearance="@style/TextAppearance.Material3.BodySmall" /> |
| 74 | + android:layout_marginStart="8dp" |
| 75 | + android:minWidth="88dp" |
| 76 | + android:minHeight="40dp" /> |
53 | 77 | </androidx.appcompat.widget.LinearLayoutCompat> |
54 | | - |
55 | | - <com.google.android.material.button.MaterialButton |
56 | | - android:id="@+id/ad_call_to_action" |
57 | | - style="@style/Widget.Material3.Button.TextButton" |
58 | | - android:layout_width="wrap_content" |
59 | | - android:layout_height="wrap_content" |
60 | | - android:layout_marginStart="8dp" |
61 | | - android:minWidth="88dp" |
62 | | - android:minHeight="40dp" /> |
63 | 78 | </androidx.appcompat.widget.LinearLayoutCompat> |
64 | | - </androidx.appcompat.widget.LinearLayoutCompat> |
| 79 | + </com.google.android.material.card.MaterialCardView> |
65 | 80 | </com.google.android.gms.ads.nativead.NativeAdView> |
| 81 | + |
0 commit comments