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.



Other Threads

1. Making TextView Scrollable

I am displaying text in a textview that appears to be too long to fit
into one screen. I need to make my TextView scrollable. How can i do
that? Here is the code

 final TextView tv = new TextView(this);

        //ScrollView sv;
        //final TextView tv;
        //tv = (TextView)findViewById(;



        tv.setOnTouchListener(new OnTouchListener(){

                public boolean onTouch(View v, MotionEvent e)

                        Random r = new Random();
                        int i = r.nextInt(101);

                        if (e.getAction() == e.ACTION_DOWN)


                return true;





2. Donut (1.6), auto complete text view and ellipsize

@Chris, I can't even get the simple TextView example you posted to
ellipsize - I just immediately get a stack overflow exception. If I
get rid of "singleLine=true", then at least it doesn't crash, however
the ellipsize won't be there! This is the only way I can get ANY
ellipsis to appear - by supplying a string without spaces!:


that just does not seem too useful!


3. Map is not displaying even the settings are correct

4. Work with a part of CameraPreview

5. Memory Problem ? and content media provider died

6. Multiline Buttons..?

7. images from