summaryrefslogtreecommitdiffstats
path: root/tests/HwAccelerationTest
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-12-09 09:07:35 -0800
committerJohn Reck <jreck@google.com>2014-12-09 12:35:12 -0800
commitc47c98be04d602f331e0ea9704d2c11f8c53852d (patch)
treec6a66e5ed45b85915ed7f902210b8d379b8d53ee /tests/HwAccelerationTest
parent6ef76c60df9e68950721f92a14c77a3ecd13607c (diff)
downloadframeworks_base-c47c98be04d602f331e0ea9704d2c11f8c53852d.zip
frameworks_base-c47c98be04d602f331e0ea9704d2c11f8c53852d.tar.gz
frameworks_base-c47c98be04d602f331e0ea9704d2c11f8c53852d.tar.bz2
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
Diffstat (limited to 'tests/HwAccelerationTest')
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/RevealActivity.java28
1 files changed, 28 insertions, 0 deletions
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();
}