From 498213a265e05134b4a4fbf93dce69de1a47973c Mon Sep 17 00:00:00 2001 From: ztenghui Date: Mon, 5 May 2014 16:26:22 -0700 Subject: First step on API cleaning on the VectorDrawable to disable animation support Cleaning on the API level, and related tests. The animated icon will be only showing the initial state. TODO: Deep clean on the functionality part and attributes. Change-Id: I5723bc5b64f796c3a273d74bde02095751160a88 --- .../com/android/test/dynamic/VectorDrawable01.java | 20 +------------------- .../test/dynamic/VectorDrawablePerformance.java | 9 +-------- 2 files changed, 2 insertions(+), 27 deletions(-) (limited to 'tests') diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java index 88ae398..7ba01b1 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java @@ -22,7 +22,7 @@ import android.widget.Button; import android.widget.GridLayout; @SuppressWarnings({"UnusedDeclaration"}) -public class VectorDrawable01 extends Activity implements View.OnClickListener { +public class VectorDrawable01 extends Activity { private static final String LOGCAT = "VectorDrawable1"; int[] icon = { R.drawable.vector_drawable01, @@ -61,28 +61,10 @@ public class VectorDrawable01 extends Activity implements View.OnClickListener { button.setWidth(200); button.setBackgroundResource(icon[i]); container.addView(button); - button.setOnClickListener(this); } - Button b = new Button(this); - b.setText("Run All"); - b.setOnClickListener(new View.OnClickListener(){ - @Override - public void onClick(View v) { - for (int i = 0; i < bArray.length; i++) { - VectorDrawable d = (VectorDrawable) bArray[i].getBackground(); - d.start(); - } - }}); - container.addView(b); setContentView(container); } - @Override - public void onClick(View v) { - VectorDrawable d = (VectorDrawable) v.getBackground(); - d.start(); - } - } diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java index 3929298..b918cdd 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java @@ -25,7 +25,7 @@ import android.widget.ScrollView; import java.text.DecimalFormat; @SuppressWarnings({"UnusedDeclaration"}) -public class VectorDrawablePerformance extends Activity implements View.OnClickListener { +public class VectorDrawablePerformance extends Activity { private static final String LOGCAT = "VectorDrawable1"; protected int[] icon = { R.drawable.vector_drawable01, @@ -76,7 +76,6 @@ public class VectorDrawablePerformance extends Activity implements View.OnClickL button.setWidth(200); button.setBackgroundResource(icon[i]); container.addView(button); - button.setOnClickListener(this); } setContentView(scrollView); time = android.os.SystemClock.elapsedRealtimeNanos()-time; @@ -85,10 +84,4 @@ public class VectorDrawablePerformance extends Activity implements View.OnClickL t.setBackgroundColor(0xFF000000); container.addView(t); } - - @Override - public void onClick(View v) { - VectorDrawable d = (VectorDrawable) v.getBackground(); - d.start(); - } } -- cgit v1.1