Skip to content

Commit 480f77e

Browse files
feat: add about page native ad layout
1 parent 6fc315f commit 480f77e

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
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"
4+
android:layout_width="match_parent"
5+
android:layout_height="wrap_content">
6+
7+
<com.google.android.material.card.MaterialCardView
8+
android:id="@+id/ad_card"
9+
style="@style/Widget.Material3.CardView.Outlined"
10+
android:layout_width="match_parent"
11+
android:layout_height="wrap_content"
12+
android:layout_margin="16dp"
13+
app:cardCornerRadius="24dp">
14+
15+
<LinearLayout
16+
android:layout_width="match_parent"
17+
android:layout_height="wrap_content"
18+
android:orientation="vertical"
19+
android:padding="16dp">
20+
21+
<include
22+
android:layout_marginBottom="8dp"
23+
layout="@layout/ad_attribution" />
24+
25+
<com.google.android.gms.ads.nativead.MediaView
26+
android:id="@+id/ad_media"
27+
android:layout_width="match_parent"
28+
android:layout_height="120dp"
29+
android:layout_marginBottom="8dp"
30+
android:scaleType="centerCrop" />
31+
32+
<TextView
33+
android:id="@+id/ad_headline"
34+
android:layout_width="match_parent"
35+
android:layout_height="wrap_content"
36+
android:ellipsize="end"
37+
android:maxLines="1"
38+
android:textAppearance="@style/TextAppearance.Material3.TitleMedium" />
39+
40+
<TextView
41+
android:id="@+id/ad_body"
42+
android:layout_width="match_parent"
43+
android:layout_height="wrap_content"
44+
android:layout_marginTop="4dp"
45+
android:ellipsize="end"
46+
android:maxLines="2"
47+
android:textAppearance="@style/TextAppearance.Material3.BodySmall" />
48+
49+
<com.google.android.material.button.MaterialButton
50+
android:id="@+id/ad_call_to_action"
51+
android:layout_width="wrap_content"
52+
android:layout_height="wrap_content"
53+
android:layout_marginTop="8dp" />
54+
</LinearLayout>
55+
</com.google.android.material.card.MaterialCardView>
56+
</com.google.android.gms.ads.nativead.NativeAdView>

app/src/main/res/layout/fragment_about.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
android:layout_height="wrap_content"
175175
android:layout_marginTop="16dp"
176176
app:layout_constraintTop_toBottomOf="@id/card_view_about"
177-
app:nativeAdLayout="@layout/large_home_banner_native_ad" />
177+
app:nativeAdLayout="@layout/about_native_ad" />
178178

179179
<com.airbnb.lottie.LottieAnimationView
180180
android:id="@+id/animation_about"

0 commit comments

Comments
 (0)