From c47c98be04d602f331e0ea9704d2c11f8c53852d Mon Sep 17 00:00:00 2001 From: John Reck Date: Tue, 9 Dec 2014 09:07:35 -0800 Subject: Fix issue with RNA destruction mid-animation Bug: 18521508 Fix an issue where an RNA's native object was destroyed before the java-side object was started Change-Id: I487fb476e0ecdf7000515f4f7320e8cfbc50a52b --- .../src/com/android/test/hwui/RevealActivity.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests/HwAccelerationTest') diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/RevealActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/RevealActivity.java index 256a1d4..1216fc4 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/RevealActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/RevealActivity.java @@ -17,12 +17,14 @@ package com.android.test.hwui; import android.animation.Animator; +import android.animation.Animator.AnimatorListener; import android.animation.AnimatorSet; import android.app.Activity; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.os.Bundle; +import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewAnimationUtils; @@ -37,6 +39,29 @@ public class RevealActivity extends Activity implements OnClickListener { private boolean mShouldBlock; private int mIteration = 0; + private AnimatorListener mListener = new AnimatorListener() { + + @Override + public void onAnimationStart(Animator animation) { + Log.d("Reveal", "onAnimatorStart " + animation); + } + + @Override + public void onAnimationRepeat(Animator animation) { + Log.d("Reveal", "onAnimationRepeat " + animation); + } + + @Override + public void onAnimationEnd(Animator animation) { + Log.d("Reveal", "onAnimationEnd " + animation); + } + + @Override + public void onAnimationCancel(Animator animation) { + Log.d("Reveal", "onAnimationCancel " + animation); + } + }; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -59,6 +84,8 @@ public class RevealActivity extends Activity implements OnClickListener { Animator animator = ViewAnimationUtils.createCircularReveal(view, view.getWidth() / 2, view.getHeight() / 2, 0, Math.max(view.getWidth(), view.getHeight())); + Log.d("Reveal", "Calling start..."); + animator.addListener(mListener); if (mIteration < 2) { animator.setDuration(DURATION); animator.start(); @@ -66,6 +93,7 @@ public class RevealActivity extends Activity implements OnClickListener { AnimatorSet set = new AnimatorSet(); set.playTogether(animator); set.setDuration(DURATION); + set.addListener(mListener); set.start(); } -- cgit v1.1