Skip to content

Commit 279e18f

Browse files
Refactor native ad layout and update dependencies
The native ad layout has been refactored for a cleaner look and improved user experience. The ad media is now displayed in a MaterialCardView with rounded corners, and the call to action button is styled using MaterialButton. The following dependencies have been updated: - Room from 2.7.2 to 2.8.0 - Navigation from 2.9.3 to 2.9.4
1 parent 7bd5c77 commit 279e18f

File tree

3 files changed

+35
-29
lines changed

3 files changed

+35
-29
lines changed

.idea/workspace.xml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
android:layout_height="wrap_content">
66

77
<com.google.android.material.card.MaterialCardView
8+
style="@style/Widget.Material3.CardView.Outlined"
89
android:layout_width="match_parent"
910
android:layout_height="wrap_content"
10-
style="@style/Widget.Material3.CardView.Outlined"
11-
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.CardView">
11+
app:cardCornerRadius="24dp">
1212

1313
<LinearLayout
1414
android:layout_width="match_parent"
@@ -23,19 +23,26 @@
2323
android:text="@string/ad"
2424
android:textAppearance="@style/TextAppearance.Material3.LabelSmall" />
2525

26-
<com.google.android.gms.ads.nativead.MediaView
27-
android:id="@+id/ad_media"
26+
<com.google.android.material.card.MaterialCardView
27+
style="@style/Widget.Material3.CardView.Filled"
2828
android:layout_width="match_parent"
2929
android:layout_height="180dp"
30-
android:minWidth="120dp"
31-
android:minHeight="120dp"
32-
android:visibility="gone" />
30+
android:layout_marginTop="8dp"
31+
android:layout_marginBottom="8dp"
32+
app:cardCornerRadius="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+
android:scaleType="centerCrop" />
39+
</com.google.android.material.card.MaterialCardView>
3340

3441
<LinearLayout
3542
android:layout_width="match_parent"
3643
android:layout_height="wrap_content"
37-
android:orientation="horizontal"
38-
android:gravity="center_vertical">
44+
android:gravity="center_vertical"
45+
android:orientation="horizontal">
3946

4047
<ImageView
4148
android:id="@+id/ad_app_icon"
@@ -58,11 +65,11 @@
5865
android:layout_marginTop="4dp"
5966
android:textAppearance="@style/TextAppearance.Material3.BodySmall" />
6067

61-
<Button
68+
<com.google.android.material.button.MaterialButton
6269
android:id="@+id/ad_call_to_action"
63-
style="@style/Widget.Material3.Button"
6470
android:layout_width="wrap_content"
6571
android:layout_height="wrap_content"
72+
android:layout_gravity="end"
6673
android:layout_marginTop="8dp" />
6774
</LinearLayout>
6875
</com.google.android.material.card.MaterialCardView>

gradle/libs.versions.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ lifecycle = "2.9.3"
1818
lottie = "6.6.7"
1919
mockitoCore = "5.19.0"
2020
mockitoInline = "5.2.0"
21-
navigationFragment = "2.9.3"
22-
navigationUi = "2.9.3"
21+
navigationUi = "2.9.4"
2322
preference = "1.2.1"
2423
review = "2.0.2"
2524
volley = "1.2.1"
@@ -29,7 +28,7 @@ multidex = "2.0.1"
2928
playServicesAds = "24.6.0"
3029
codeview = "1.3.9"
3130
hilt = "2.57.1"
32-
room = "2.7.2"
31+
room = "2.8.0"
3332
glide = "5.0.4"
3433
retrofit = "3.0.0"
3534

@@ -46,7 +45,7 @@ androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process",
4645
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime", version.ref = "lifecycle" }
4746
androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle" }
4847
androidx-multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
49-
androidx-navigation-fragment = { module = "androidx.navigation:navigation-fragment", version.ref = "navigationFragment" }
48+
androidx-navigation-fragment = { module = "androidx.navigation:navigation-fragment", version.ref = "navigationUi" }
5049
androidx-preference = { module = "androidx.preference:preference", version.ref = "preference" }
5150
androidx-navigation-ui = { module = "androidx.navigation:navigation-ui", version.ref = "navigationUi" }
5251
app-update = { module = "com.google.android.play:app-update", version.ref = "appUpdate" }

0 commit comments

Comments
 (0)