1f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette/* 2f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * Copyright (C) 2014 The Android Open Source Project 3f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * 4f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * in compliance with the License. You may obtain a copy of the License at 6f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * 7f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * http://www.apache.org/licenses/LICENSE-2.0 8f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * 9f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * Unless required by applicable law or agreed to in writing, software distributed under the License 10f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * or implied. See the License for the specific language governing permissions and limitations under 12f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette * the License. 13f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette */ 14f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette 15f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverettepackage com.android.test.dynamic; 16f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette 17f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viveretteimport android.app.Activity; 18f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viveretteimport android.graphics.drawable.AnimatedVectorDrawable; 19f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viveretteimport android.os.Bundle; 20f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viveretteimport android.view.View; 21f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viveretteimport android.widget.Button; 22f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viveretteimport android.widget.CheckBox; 23f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viveretteimport android.widget.GridLayout; 24f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viveretteimport android.widget.ScrollView; 25f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette 26f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverettepublic class AnimatedStateVectorDrawableTest extends Activity { 27f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette private static final String LOGCAT = "AnimatedStateVectorDrawableTest"; 28f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette 29f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette protected int[] icon = { 305b84eace6cb79c42fe43480f08c68b7dea4e074aztenghui // These shows pairs of ASLD , the left side set the reversible to true. 315b84eace6cb79c42fe43480f08c68b7dea4e074aztenghui // the right side set to false. 327bc6a3f023ca3e1dde91fc97b6036dee3ba538a2ztenghui R.drawable.state_animation_vector_drawable01, 335b84eace6cb79c42fe43480f08c68b7dea4e074aztenghui R.drawable.state_animation_vector_drawable01_false, 347bc6a3f023ca3e1dde91fc97b6036dee3ba538a2ztenghui R.drawable.state_animation_vector_drawable02, 355b84eace6cb79c42fe43480f08c68b7dea4e074aztenghui R.drawable.state_animation_vector_drawable02_false, 367bc6a3f023ca3e1dde91fc97b6036dee3ba538a2ztenghui R.drawable.state_animation_vector_drawable03, 375b84eace6cb79c42fe43480f08c68b7dea4e074aztenghui R.drawable.state_animation_vector_drawable03_false, 385b84eace6cb79c42fe43480f08c68b7dea4e074aztenghui R.drawable.state_animation_drawable04, 395b84eace6cb79c42fe43480f08c68b7dea4e074aztenghui R.drawable.state_animation_drawable04_false, 40f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette }; 41f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette 42f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette @Override 43f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette protected void onCreate(Bundle savedInstanceState) { 44f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette super.onCreate(savedInstanceState); 45f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette 46f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette ScrollView scrollView = new ScrollView(this); 47f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette GridLayout container = new GridLayout(this); 48f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette scrollView.addView(container); 495b84eace6cb79c42fe43480f08c68b7dea4e074aztenghui container.setColumnCount(2); 50f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette 51f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette for (int i = 0; i < icon.length; i++) { 52f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette CheckBox button = new CheckBox(this); 53f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette button.setWidth(400); 54f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette button.setHeight(400); 55f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette button.setBackgroundResource(icon[i]); 56f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette container.addView(button); 57f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette } 58f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette 59f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette setContentView(scrollView); 60f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette } 61f456b1f078639a422f966ef2e9376cbd5ae3d274Alan Viverette} 62