summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2015-01-13 16:21:11 -0800
committerztenghui <ztenghui@google.com>2015-07-17 11:16:41 -0700
commit35289f12d6cb0f0db67489876c805ad4a3cbd5f6 (patch)
tree4f8c82b14b54af261462ca8e7ed79dbc2b8417aa /tests
parentd4b566bf56333de708908ce4accb5fb067be64f0 (diff)
downloadframeworks_base-35289f12d6cb0f0db67489876c805ad4a3cbd5f6.zip
frameworks_base-35289f12d6cb0f0db67489876c805ad4a3cbd5f6.tar.gz
frameworks_base-35289f12d6cb0f0db67489876c805ad4a3cbd5f6.tar.bz2
Scaling (Animated)VectorDrawable inside ImageView
Before, the VectorDrawable is behaving like BitmapDrawable inside a ImageView, and it can be blurry due to scaling. Now apply the scaling information to the cached bitmap, then the size of bitmap will match the ImageView's screen size. Therefore, no blurry any more. b/18185626 Change-Id: I979cef3b5178a9bd37ee6cc776df3361ca47c803
Diffstat (limited to 'tests')
-rw-r--r--tests/VectorDrawableTest/src/com/android/test/dynamic/ScaleDrawableTests.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/ScaleDrawableTests.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/ScaleDrawableTests.java
index 3787843..c5be6c4 100644
--- a/tests/VectorDrawableTest/src/com/android/test/dynamic/ScaleDrawableTests.java
+++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/ScaleDrawableTests.java
@@ -37,8 +37,8 @@ public class ScaleDrawableTests extends Activity {
};
protected int icon = R.drawable.bitmap_drawable01;
-
protected int vector_icon = R.drawable.vector_drawable16;
+ protected int animated_vector_icon = R.drawable.ic_hourglass_animation;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -46,12 +46,12 @@ public class ScaleDrawableTests extends Activity {
ScrollView scrollView = new ScrollView(this);
GridLayout container = new GridLayout(this);
scrollView.addView(container);
- container.setColumnCount(3);
+ container.setColumnCount(4);
container.setBackgroundColor(0xFF888888);
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
- params.width = 400;
- params.height = 300;
+ params.width = 300;
+ params.height = 200;
for (int i = 0; i < scaleTypes.length; i++) {
TextView t = new TextView(this);
@@ -71,6 +71,13 @@ public class ScaleDrawableTests extends Activity {
view.setScaleType(scaleType);
view.setImageResource(vector_icon);
container.addView(view);
+
+ ImageView avd_view = new ImageView(this);
+ avd_view.setLayoutParams(params);
+ avd_view.setScaleType(scaleType);
+ avd_view.setImageResource(animated_vector_icon);
+ container.addView(avd_view);
+
}
setContentView(scrollView);