AnimatedStateVectorDrawableTest.java revision f456b1f078639a422f966ef2e9376cbd5ae3d274
1/* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 * in compliance with the License. You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software distributed under the License 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 * or implied. See the License for the specific language governing permissions and limitations under 12 * the License. 13 */ 14 15package com.android.test.dynamic; 16 17import android.app.Activity; 18import android.graphics.drawable.AnimatedVectorDrawable; 19import android.os.Bundle; 20import android.view.View; 21import android.widget.Button; 22import android.widget.CheckBox; 23import android.widget.GridLayout; 24import android.widget.ScrollView; 25 26public class AnimatedStateVectorDrawableTest extends Activity { 27 private static final String LOGCAT = "AnimatedStateVectorDrawableTest"; 28 29 protected int[] icon = { 30 R.drawable.state_animation_vector_drawable 31 }; 32 33 @Override 34 protected void onCreate(Bundle savedInstanceState) { 35 super.onCreate(savedInstanceState); 36 37 ScrollView scrollView = new ScrollView(this); 38 GridLayout container = new GridLayout(this); 39 scrollView.addView(container); 40 container.setColumnCount(1); 41 42 for (int i = 0; i < icon.length; i++) { 43 CheckBox button = new CheckBox(this); 44 button.setWidth(400); 45 button.setHeight(400); 46 button.setBackgroundResource(icon[i]); 47 container.addView(button); 48 } 49 50 setContentView(scrollView); 51 } 52} 53