1

i want to rotate the AdWhirl Banner -90 degrees. The Banner-view should therefore viewed vertical on the left side.

My first idea was to override the onDraw Methode and put in there the logic to rotate, but I didnt found any possibility to override any drawing functionality in adwhirl.

However, i rotated the "com.adwhirl.AdWhirlLayout" with an Animator as follows:

    <com.adwhirl.AdWhirlLayout
android:id="@+id/adwhirl_layout"
android:layout_width="300dp"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:animationCache="false"
android:layout_height="53dp" />

The Rotator XML:

<?xml version="1.0" encoding="utf-8"?>
<rotate
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromDegrees="0"
    android:toDegrees="-90"
    android:pivotX="10%"
    android:pivotY="50%"
    android:duration="0"
    android:fillEnabled="false"
    android:fillAfter="true"/>

Java:

    AdWhirlLayout mAdWhirlLayout = (AdWhirlLayout) findViewById(R.id.adwhirl_layout);   
    Animation animation = AnimationUtils.loadAnimation(this, R.animator.rotate);
    mAdWhirlLayout.setAdWhirlInterface(new CustomEvents(mAdWhirlLayout, this, getApplicationContext()));
    mAdWhirlLayout.startAnimation(animation);

The Problem is, that the first displayed banner looks sometimes good (correct rotated). Following, refreshed banners are only displayed a small piece of it (~25% width of the total graphic). I tried different things, but nothing works well.

Is there any better way to rotate the AdWhirl Banner correctly? Thanks!

Sample graphic 1 Sample graphic 2

funcoder
  • 1,975
  • 20
  • 14
  • AdWhirl only supports a 320x50 ad format, and not 50x320. Therefore, you wouldn't get an ad to show upright. Is showing ads sideways really what you want (what is shown in the image above)? – Eric Leichtenschlag Dec 02 '11 at 02:30
  • Yes, i want rotate the whole AdWhirl-Layout. In the images above is showing the "broken" -90 degrees AdWhirl-Layout. So far is it rotated correct, but the banner is never shown completely. I dont know why... – funcoder Dec 02 '11 at 15:44

1 Answers1

0

I'm not sure exactly what your issue is, but here are a couple things to note:

  1. AdWhirl Ads are usually a 320dp width. I'm not sure how you're even getting ads back with 300dp width, but that may be a part of the reason it doesn't fill the width. I would try changing this to 320dp.

  2. The ad shown in this picture seems to be shifted off the screen. Have you tried playing around with the pivotX and pivotY properties?

Eric Leichtenschlag
  • 8,881
  • 1
  • 28
  • 28