AdView banner is cropped after setRotation

67 views
Skip to first unread message

Gamegen

unread,
Dec 8, 2016, 12:57:03 PM12/8/16
to Google Mobile Ads SDK Developers
Hi!

For some reasons I need to create AdView programmatically and rotate it for 90 with this:
adViewCentral = new AdView(this);
adViewCentral
.setAdSize(AdSize.BANNER);
adViewCentral
.setAdUnitId(Battlefield_free.admob_central_banner);
adViewCentral
.setRotation(90);
But banner is cropped after rotating. It looks like canvas does not rotate. It's well noticed on small angles:


If you rotate banner 90 degrees, it completely disappear. But it still reacts on clicks.

I tried to set pivot center through setPivotX() and setPivotY() - no results.
I tried to create subclass for AdView, but AdView is final class. So, nor any subclasses... :(
I tried to use custom AdSize, but banner only stretches...

I tested it all on two devices.

Any suggestions?

PS: <integer name="google_play_services_version">8487000</integer>

      Device #1:
      Android 4.4.2
      Google Play Services 10.0.84 installed on device

      Device #2:
      Android 4.0.4
      Google Play Services 7.8.99 installed on device

Vu Chau (Mobile Ads SDK Team)

unread,
Dec 8, 2016, 4:42:21 PM12/8/16
to Google Mobile Ads SDK Developers
Hello,

Thanks for writing in about this, but we do not support this use case. All our ads are expected to be displayed unaltered.

Vu Chau
Mobile Ads SDK Team

Gamegen

unread,
Dec 9, 2016, 8:27:25 AM12/9/16
to Google Mobile Ads SDK Developers
Hi.

I do not try to alter banner. I'd like to set needed orientation manually, not automatically. AdView class has method setRotation. What for?
Maybe there are other method to change banner's orientation?

пятница, 9 декабря 2016 г., 2:42:21 UTC+5 пользователь Vu Chau (Mobile Ads SDK Team) написал:

Vu Chau (Mobile Ads SDK Team)

unread,
Dec 9, 2016, 10:02:11 AM12/9/16
to Google Mobile Ads SDK Developers
Hello,

Thanks for getting back on this. 

While there are many ways to change a view's orientation, none of them is an intended and supported use case. That means that even though you can call setRotation() on your AdView instance (or even write a custom rotation animation yourself, which I did), and it might work to a certain extent, it is not a use case we support or maintain tests for. The reason setRotation exists() is simply because an AdView is a custom WebView object, which extends from the View class. While you can rotate the WebView, its content isn't guaranteed to maintain its form.

Vu Chau
Mobile Ads SDK Team

Gamegen

unread,
Dec 9, 2016, 12:39:13 PM12/9/16
to Google Mobile Ads SDK Developers
Thanks a lot. I understood. I've tried custom rotation animation too. No any good results.

пятница, 9 декабря 2016 г., 20:02:11 UTC+5 пользователь Vu Chau (Mobile Ads SDK Team) написал:
Reply all
Reply to author
Forward
0 new messages