Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:taskAffinity=""
android:theme="@style/Theme.AppCompat.Light">
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.fragment.app.FragmentManager;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdLoader;
Expand Down Expand Up @@ -47,9 +51,22 @@ public NativeAd getNativeAd() {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Enable edge-to-edge display
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);

ActivityMainBinding binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());

// Apply insets to the root view to avoid overlap with system bars.
ViewCompat.setOnApplyWindowInsetsListener(
binding.fragmentContainerView,
(v, windowInsets) -> {
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(insets.left, insets.top, insets.right, insets.bottom);
return WindowInsetsCompat.CONSUMED;
});

Log.d(TAG, "Google Mobile Ads SDK Version: " + MobileAds.getVersion());

googleMobileAdsConsentManager =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Light.NoTitleBar.Fullscreen">
<!-- Customize your theme here. -->
</style>

<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar" />
<style name="AppTheme.AdAttribution">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
Expand All @@ -16,5 +11,4 @@
<item name="android:width">15dp</item>
<item name="android:height">15dp</item>
</style>

</resources>