Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b4512ef authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Prevent possible NPE in TextureView"

parents c2e0a1f1 1ec3a58b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ public class TextureView extends View {
    public void setOpaque(boolean opaque) {
        if (opaque != mOpaque) {
            mOpaque = opaque;
            updateLayer();
            if (mLayer != null) updateLayer();
        }
    }

+5 −5
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class TextureViewActivity extends Activity implements TextureView.Surface
            @Override
            public void onClick(View v) {
                if (mAdded) {
                    mAnimatorSet.cancel();
                    if (mAnimatorSet != null) mAnimatorSet.cancel();
                    mContent.removeView(mTextureView);
                } else {
                    mContent.addView(mTextureView);
@@ -84,10 +84,10 @@ public class TextureViewActivity extends Activity implements TextureView.Surface

        mTextureView.setCameraDistance(5000);

        ObjectAnimator rotationY = ObjectAnimator.ofFloat(mTextureView, "rotationY", 0.0f, 360.0f);
        rotationY.setRepeatMode(ObjectAnimator.REVERSE);
        rotationY.setRepeatCount(ObjectAnimator.INFINITE);
        rotationY.setDuration(4000);
//        ObjectAnimator rotationY = ObjectAnimator.ofFloat(mTextureView, "rotationY", 0.0f, 360.0f);
//        rotationY.setRepeatMode(ObjectAnimator.REVERSE);
//        rotationY.setRepeatCount(ObjectAnimator.INFINITE);
//        rotationY.setDuration(4000);

//        ObjectAnimator alpha = ObjectAnimator.ofFloat(mTextureView, "alpha", 1.0f, 0.0f);
//        alpha.setRepeatMode(ObjectAnimator.REVERSE);