rotate application according orientation

by Jean-FrančŽ½ois Vidal » Thu, 14 Oct 2010 01:35:44 GMT

Sponsored Links
 Hi all,

I am modifying an application to rotate according orientation (like
Ipad) and I am not satisfied with the result.

To apply the rotation I use Animation and Animation.AnimationListener.
My Animation class is a modification of Sample API Rotate3dAnimation
and I have no problem with it. I have two problems :

1)I configure android:screenOrientation="sensor" in AndroidManifest. I
tested calling animation in "public void
onConfigurationChanged(Configuration newConfig)" and
"OrientationEventListener::public void onOrientationChanged (int
orientation)", i both case the orientation occur too late. Android
system already redraw the screen when animation start, the status bar
changed and coordinate for my rotation point are no more correct.

2)My application display text and video with homemade method. I render
video inside SurfaceView that is never animated but switch from
portrait to landscape while Textview is correctly rotate animated. I
tried to replace SurfaceView by ImageView with videoshot before
rotation and restore SurfaceView after, I get image rotation animation
but the switch from Video to Image is not smooth enough (and make my
application unstable :( ).

I have the following questions ?

Is there any existing Android application with rotation animation
according orientation (like Ipad) ?
Is there anyway to play rotation animation before the system redraw
for new orientation ?
Is it possible to rotate a SurfaceView?

I recognize this is not essential for me but I develop application for
a public attracted by eyes candies, animated rotation is almost
mandatory for my application.