Admob adview animation makes glsurfaceview linger

I'm having trouble getting a standard adView banner to “play well” with my GLSurfaceView.

When adView changes state (switches between its three appearances), this leads to a noticeable decrease in frame rate in GLSurfaceView.

Here is the code for my xml layout (XXXXXX = censored info :)):

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffffff"
tools:context=".MainActivity" >

<com.google.ads.AdView
    android:id="@+id/adViewX"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    ads:adSize="BANNER"
    ads:adUnitId="XXXXXXXXXXXXXXXX"
    ads:loadAdOnCreate="true"
    ads:testDevices="TEST_EMULATOR, XXXXXXXXXXXX" />

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginTop="50dp"
    android:background="#ffffffff" >

    <XXXXXXXXXXXXXXXXXXXXX.FunSurface
        android:id="@+id/funSurface"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true" />

</RelativeLayout>

In addition to setContentView (xml layout file); nothing is done programmatically.

If I remove the ad unit from the layout, my GLSurfaceView (FunSurface) will be silky.

Anyone have any ideas to fix this problem?

NOTE. GLSurfaceView uses OpenGL ES 1.1

+4
source share

Source: https://habr.com/ru/post/1531174/


All Articles