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