hi
after the last update i am trying to update all my apps. many old apps do not use b4xpages and i encounter a strange behavior. after 1-2 sec of the app loading the whole ui shifts down.
i think it has something to do with the adviews (admob)
if i remove this lines the ui stays at its position.
but even with those lines removed when the interstitial add is shown and the app returns the ui shifts again. if i leave those lines it happens even before the interstitial ad is shown.
can anyone give me a hint?
thanks
it is hard to see in the video because youtube auto crop it so i upload a screenshots. you can see that the buttons are now behind the navigationbar
after the last update i am trying to update all my apps. many old apps do not use b4xpages and i encounter a strange behavior. after 1-2 sec of the app loading the whole ui shifts down.
i think it has something to do with the adviews (admob)
if i remove this lines the ui stays at its position.
B4X:
'Admob
Dim size As AdSize = GetAdaptiveAdSize
iAd.Initialize("iad","ca-app-pub-xxxxxxxxxxxxxx/xxxxxx")
Adview1.Initialize2("Adview1", "ca-app-pub-xxxxxxxxxxxxxx/xxxxxx", size.Native)' Adview1.SIZE_SMART_BANNER)
Adview2.Initialize2("Adview2", "ca-app-pub-xxxxxxxxxxxxxx/xxxxxx", size.Native)' Adview2.SIZE_SMART_BANNER)
-> If Starter.isShabbat = False And Starter.isFullVersion = False Then
-> iAd.LoadAd'
-> Adview1.LoadAd
-> Adview2.LoadAd
-> settingstop.AddView(Adview1, 0,0,size.Width, size.Height)'100%x,height)
-> page2top.AddView(Adview2,0,0,size.Width, size.Height)'100%x,height)
-> End If
If auth.CurrentUser.IsInitialized Then auth_SignedIn(auth.CurrentUser)
End Sub
Sub GetAdaptiveAdSize As AdSize
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim AdSize As JavaObject
Dim width As Int = 100%x / GetDeviceLayoutValues.Scale
Dim res As AdSize
res.Native = AdSize.InitializeStatic("com.google.android.gms.ads.AdSize").RunMethod("getCurrentOrientationAnchoredAdaptiveBannerAdSize", Array(ctxt, width))
Dim jo As JavaObject = res.Native
res.Width = jo.RunMethod("getWidthInPixels", Array(ctxt))
res.Height = jo.RunMethod("getHeightInPixels", Array(ctxt))
Return res
End Sub
but even with those lines removed when the interstitial add is shown and the app returns the ui shifts again. if i leave those lines it happens even before the interstitial ad is shown.
can anyone give me a hint?
thanks
it is hard to see in the video because youtube auto crop it so i upload a screenshots. you can see that the buttons are now behind the navigationbar
Last edited: