-
Notifications
You must be signed in to change notification settings - Fork 24
Description
First of all, thank you for this library. It has been really helpful!
I do have a number of suggestions:
- From Google Mobile Ads SDK version 17.0.0 onwards, it is required to add the following to the AndroidManifest
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
-
The widthChanged/heightChanged signals of an AdMobBanner are not sent when a banner is loaded (=> I had to fetch the width/height in the onLoaded signal)
-
The x,y QML properties of an AdMobBanner uses device dependent pixels while the rest of the QML application uses device independent pixels (especially when using
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling))
Hence in order to position the banner at the bottom I had to set
y = parent.height*Screen.devicePixelRatio - banner.height
which is slightly inconvenient. It would be useful if the QML-user could use device independent pixels for x and y (and also get device independent values for the banner width/height; these should be divided by Screen.devicePixelRatiobefore returning them to the user)
-
And we can go even one step further: the x/y currently refer to the global coordinates. So if I want to position an AdMobBanner at the bottom of a QML Item that is not full screen, I first have to do something like
var globalBottom = root.mapToGlobal(0, root.height).y. Again, it would be convenient if this could be handled by the library. By doing so, the user could use both device independent pixels and the local coordinates of the parent Item of the AdMobBanner -
Finally, I had to modify
QtAdMobActivity.GetStatusBarHeightand let it returnstatusBarHeight, otherwise the AdMobBanner was hidden behind the status bar when positioning it at (0,0)