diff options
author | Alan Viverette <alanv@google.com> | 2014-07-03 19:03:21 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-07-03 19:03:21 -0700 |
commit | f456b1f078639a422f966ef2e9376cbd5ae3d274 (patch) | |
tree | a1848ffd77785c40daeb286232ea12ba5f1d18e3 /tests/VectorDrawableTest/src/com | |
parent | 40d43b27b4f5fba75b040c24f95a170959811fd8 (diff) | |
download | frameworks_base-f456b1f078639a422f966ef2e9376cbd5ae3d274.zip frameworks_base-f456b1f078639a422f966ef2e9376cbd5ae3d274.tar.gz frameworks_base-f456b1f078639a422f966ef2e9376cbd5ae3d274.tar.bz2 |
Update AnimatedStateListDrawable to work with Animatable drawables
BUG: 16016730
Change-Id: I6d02a1235c0aecd7e62f12226f3689372d043ddd
Diffstat (limited to 'tests/VectorDrawableTest/src/com')
-rw-r--r-- | tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java new file mode 100644 index 0000000..0ae0136 --- /dev/null +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.android.test.dynamic; + +import android.app.Activity; +import android.graphics.drawable.AnimatedVectorDrawable; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.GridLayout; +import android.widget.ScrollView; + +public class AnimatedStateVectorDrawableTest extends Activity { + private static final String LOGCAT = "AnimatedStateVectorDrawableTest"; + + protected int[] icon = { + R.drawable.state_animation_vector_drawable + }; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + ScrollView scrollView = new ScrollView(this); + GridLayout container = new GridLayout(this); + scrollView.addView(container); + container.setColumnCount(1); + + for (int i = 0; i < icon.length; i++) { + CheckBox button = new CheckBox(this); + button.setWidth(400); + button.setHeight(400); + button.setBackgroundResource(icon[i]); + container.addView(button); + } + + setContentView(scrollView); + } +} |