Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edgetoedge full screen ad issue #779

Open
FunkyMuse opened this issue Dec 15, 2024 · 5 comments
Open

edgetoedge full screen ad issue #779

FunkyMuse opened this issue Dec 15, 2024 · 5 comments

Comments

@FunkyMuse
Copy link

when showing a full screen ads, there's an issue with the ad, it's cut out for devices that have the cut out

@Md-Kajol-Ali
Copy link

Use it like this and this problem will be solved......

if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.VANILLA_ICE_CREAM){
EdgeToEdge.enable(this);
}
setContentView(R.layout.activity_main);

        if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.VANILLA_ICE_CREAM) {
            ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
                Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
                v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
                return insets;
            });
        }

@FunkyMuse
Copy link
Author

FunkyMuse commented Dec 20, 2024

Use it like this and this problem will be solved......

if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.VANILLA_ICE_CREAM){ EdgeToEdge.enable(this); } setContentView(R.layout.activity_main);

        if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.VANILLA_ICE_CREAM) {
            ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
                Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
                v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
                return insets;
            });
        }

The app is only Compose code :/

@AndroidDeveloperLB
Copy link

Reported here about all full-screen-ads and ads-inspector, and also a workaround:

https://www.reddit.com/r/androiddev/comments/1hlctq1/google_pushes_for_edgetoedge_on_android_15_but/

@rohitraj-khorwal
Copy link

setOnApplyWindowInsetsListener applies to the current activity that we are using.

Your suggestion is good, but the ad visual is a separate activity that overlays the app's activities.

<activity
   android:name="com.google.android.gms.ads.AdActivity"
    android:theme="@android:style/Theme.Translucent" />

By default, this screen is used, but its theme cannot be changed from the manifest.
We have already tried this method.

@AndroidDeveloperLB
Copy link

@rohitraj-khorwal But I've reproduced it and it's different when using the workaround I've suggested.

Perhaps you are using more ad-sources for Admob mediation, and then you don't notice it.
If so, you can add it to the Activities that they use, and then it's even a larger workaround...

For example, I've collected these (but I don't use them for now, as it's too many):

<activity
    android:name="com.applovin.adview.AppLovinFullscreenActivity"
    android:theme="@style/AdInspectorActivityTheme" tools:replace="android:theme" />

<activity
    android:name="com.chartboost.sdk.view.CBImpressionActivity" android:exported="false"
    android:theme="@style/AdInspectorActivityTheme" tools:replace="android:theme" />

<activity
    android:name="com.chartboost.sdk.internal.clickthrough.EmbeddedBrowserActivity"
    android:exported="false" android:theme="@style/AdInspectorActivityTheme"
    tools:replace="android:theme" />

<activity
    android:name="com.inmobi.ads.rendering.InMobiAdActivity" android:exported="false"
    android:theme="@style/AdInspectorActivityTheme" tools:replace="android:theme" />

<activity
    android:name="com.ironsource.sdk.controller.ControllerActivity" android:exported="false"
    android:theme="@style/AdInspectorActivityTheme" tools:replace="android:theme" />
<activity
    android:name="com.ironsource.sdk.controller.InterstitialActivity"
    android:exported="false" android:theme="@style/AdInspectorActivityTheme"
    tools:replace="android:theme" />
<activity
    android:name="com.ironsource.sdk.controller.OpenUrlActivity" android:exported="false"
    android:theme="@style/AdInspectorActivityTheme" tools:replace="android:theme" />
<activity
    android:name="com.ironsource.mediationsdk.testSuite.TestSuiteActivity"
    android:exported="false" android:theme="@style/AdInspectorActivityTheme"
    tools:replace="android:theme" />

<activity
    android:name="com.vungle.ads.internal.ui.VungleActivity" android:exported="false"
    android:theme="@style/AdInspectorActivityTheme" tools:replace="android:theme" />

<activity
    android:name="com.mbridge.msdk.activity.MBCommonActivity" android:exported="false"
    android:theme="@style/AdInspectorActivityTheme" tools:replace="android:theme" />

<activity
    android:name="com.mbridge.msdk.reward.player.MBRewardVideoActivity"
    android:exported="false" android:theme="@style/AdInspectorActivityTheme"
    tools:replace="android:theme" />

<activity
    android:name="com.mbridge.msdk.newreward.player.MBRewardVideoActivity"
    android:exported="false" android:theme="@style/AdInspectorActivityTheme"
    tools:replace="android:theme" />
<activity
    android:name="com.mbridge.msdk.out.LoadingActivity" android:exported="false"
    android:theme="@style/AdInspectorActivityTheme" tools:replace="android:theme" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants