Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kotlin/admob/NativeAdvancedExample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.gms:play-services-ads:24.6.0'
implementation 'com.google.android.material:material:1.13.0'
implementation 'com.google.android.ump:user-messaging-platform:3.2.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
mainActivityBinding = ActivityMainBinding.inflate(layoutInflater)
setContentView(mainActivityBinding.root)
setSupportActionBar(mainActivityBinding.toolBar)

// Log the Mobile Ads SDK version.
Log.d(TAG, "Google Mobile Ads SDK Version: " + MobileAds.getVersion())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,73 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.google.android.gms.example.nativeadvancedexample.MainActivity">
tools:context=".MainActivity">

<LinearLayout
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:fitsSystemWindows="true"
android:background="@color/colorPrimaryDark"
app:layout_constraintTop_toTopOf="parent">

<FrameLayout
android:id="@+id/ad_frame"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp" />
android:layout_height="?attr/actionBarSize"
app:titleTextColor="@android:color/white"
app:title="@string/app_name" />

<CheckBox
android:id="@+id/start_muted_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Start video ads muted" />
</com.google.android.material.appbar.AppBarLayout>

<Button
android:id="@+id/refresh_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:text="Refresh Ad"
android:visibility="gone" />

<TextView
android:text="Video status: "
<ScrollView
android:id="@+id/root_view"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/app_bar_layout"
app:layout_constraintBottom_toBottomOf="parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:id="@+id/video_status_text"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
android:orientation="vertical">

<FrameLayout
android:id="@+id/ad_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp" />

<CheckBox
android:id="@+id/start_muted_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Start video ads muted" />

<Button
android:id="@+id/refresh_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:text="Refresh Ad"
android:visibility="gone" />

<TextView
android:id="@+id/video_status_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="Video status: "
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />

</LinearLayout>
</ScrollView>

</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
Expand Down