user441918
user441918

Reputation: 165

Android ApiDemos - Rotate3dAnimation

I am newbie to android development and currently I am studying the 3D animation by going through the file Rotate3dAnimation in ApiDemos project. This class shows the image in reverse order, I am trying to display this control to display the image in actual order but my bad luck continues. Could you please advice me which line that shows the image in reverse order?

Thanks, Shan

Upvotes: 3

Views: 1260

Answers (1)

Warpzit
Warpzit

Reputation: 28152

The answer is simple you change the applyed rotations to:

applyRotation(-1, 0, 90); and applyRotation(1, 0, 90);

this is when you first call it and when you call it for the second half you use following:

        if (mPosition > -1) {
            mStartView.setVisibility(View.GONE);
            mEndView.setVisibility(View.VISIBLE);
            mEndView.requestFocus();

            //rotation = new Rotate3dAnimation(90, 180, centerX, centerY, 310.0f, false);
            rotation = new Rotate3dAnimation(-90, 0, centerX, centerY, 310.0f, false);
        } else {
            mEndView.setVisibility(View.GONE);
            mStartView.setVisibility(View.VISIBLE);
            mStartView.requestFocus();

            rotation = new Rotate3dAnimation(-90, 0, centerX, centerY, 310.0f, false);
            //rotation = new Rotate3dAnimation(90, 0, centerX, centerY, 310.0f, false);
        }

I've commented out the old implementation.

Upvotes: 3

Related Questions