Android ApiDemos - Rotate3dAnimation

I am new to Android development and am currently studying 3D animation by viewing the Rotate3dAnimation file in the ApiDemos project. This class shows the image in reverse order, I'm trying to display this control to display the image in real order, but my failure continues. Could you please advise me which line shows the image in reverse order?

Thank you Shan

+3
source share
1 answer

The answer is simple, you changed the applied rotations to:

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

this is when you first call it, and when you call it in the second half, you use the 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);
        }

.

+3

Source: https://habr.com/ru/post/1780313/


All Articles