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

Commit 1ec3a58b authored by Romain Guy's avatar Romain Guy
Browse files

Prevent possible NPE in TextureView

Change-Id: I539813d614c7eb1f68dad6b605cbad5b5144c5e9
parent a9489274
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);