5

I am using OpenGL in a RenderSurface View in my android game. The Game uses landscape as screen orientation but I want to place the ad 90° rotated at the bottom of the phone. (As it would be if I use portrait as screen orientation)

This is the only way I can place the ad without making the game unplayable on small screens. I maneged to do this with:

View.rotate(..)

The problem is that this function is first available with the API Level 11.

  • Is there any workaround to to this with API Level 8?
  • I have already tried a rotate animation but touch events are not delivered correctly. (The adview prevents a workaround)

I would reduce my user base dramatically if my game is only playable with Android 3.0.

Kara
  • 6,115
  • 16
  • 50
  • 57
Wayrunner
  • 121
  • 2
  • 5
  • So you want the ad to appear vertically such that the words are like a book spine? Also it would help to know what Ad SDK you are using. – Morrison Chang Aug 27 '12 at 01:08
  • Have you tried rotate using Matrix OR layoutparams (see http://stackoverflow.com/questions/3444764/rotate-view-hierarchy-90-degrees)? – Edison Aug 30 '12 at 20:25

1 Answers1

1

I wonder if you couldnt do something like this? Sorry I don't have the time to test :/

    LinearLayout layout = new LinearLayout(this);

layout.setOrientation(LinearLayout.HORIZONTAL);

addContentView(layout, new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));

RelativeLayout.LayoutParams adParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);    

adView = new AdView(this);

layout.addView(adView, adParams);

Since you are adding a content view over the opengl surfaceview perhaps.... well anyways like I said, no time to test it. give it a shot?

WIllJBD
  • 6,144
  • 3
  • 34
  • 44