Loading tests/VectorDrawableTest/AndroidManifest.xml +20 −13 Original line number Diff line number Diff line Loading @@ -22,37 +22,44 @@ <application android:hardwareAccelerated="true" android:label="vector" > <activity android:name="VectorDrawableTest" android:label="Vector Icon" > android:name="VectorDrawablePerformance" android:label="Vector Performance" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="com.android.test.dynamic.TEST" /> </intent-filter> </activity> <activity android:name="VectorDrawable01" android:label="VectorTest1" > android:name="VectorDrawableAnimation" android:label="VectorTestAnimation" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="com.android.test.dynamic.TEST" /> </intent-filter> </activity> <activity android:name="VectorDrawableTest" android:label="Vector Icon" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="VectorDrawablePerformance" android:label="Vector Performance" > android:name="VectorDrawable01" android:label="VectorTest1" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="com.android.test.dynamic.TEST" /> </intent-filter> </activity> <activity android:name="VectorDrawableDupPerf" android:label="Vector Performance of clones" > Loading tests/VectorDrawableTest/res/drawable/animation_drawable_vector.xml 0 → 100644 +36 −0 Original line number Diff line number Diff line <!-- 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. --> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/animation_drawable_vector" android:oneshot="false"> <item android:drawable="@drawable/vector_drawable01" android:duration="300" /> <item android:drawable="@drawable/vector_drawable02" android:duration="300" /> <item android:drawable="@drawable/vector_drawable03" android:duration="300" /> <item android:drawable="@drawable/vector_drawable04" android:duration="300" /> <item android:drawable="@drawable/vector_drawable05" android:duration="300" /> <item android:drawable="@drawable/vector_drawable06" android:duration="300" /> <item android:drawable="@drawable/vector_drawable07" android:duration="300" /> <item android:drawable="@drawable/vector_drawable08" android:duration="300" /> <item android:drawable="@drawable/vector_drawable09" android:duration="300" /> <item android:drawable="@drawable/vector_drawable10" android:duration="300" /> <item android:drawable="@drawable/vector_drawable11" android:duration="300" /> <item android:drawable="@drawable/vector_drawable12" android:duration="300" /> <item android:drawable="@drawable/vector_drawable13" android:duration="300" /> <item android:drawable="@drawable/vector_drawable14" android:duration="300" /> <item android:drawable="@drawable/vector_drawable15" android:duration="300" /> <item android:drawable="@drawable/vector_drawable16" android:duration="300" /> <item android:drawable="@drawable/vector_drawable17" android:duration="300" /> <item android:drawable="@drawable/vector_drawable18" android:duration="300" /> </animation-list> tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableAnimation.java 0 → 100644 +45 −0 Original line number Diff line number Diff line /* * 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.AnimationDrawable; import android.os.Bundle; import android.view.View; import android.widget.Button; public class VectorDrawableAnimation extends Activity { private static final String LOGCAT = "VectorDrawableAnimation"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Button button = new Button(this); button.setBackgroundResource(R.drawable.animation_drawable_vector); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AnimationDrawable frameAnimation = (AnimationDrawable) v.getBackground(); // Start the animation (looped playback by default). frameAnimation.start(); } }); setContentView(button); } } Loading
tests/VectorDrawableTest/AndroidManifest.xml +20 −13 Original line number Diff line number Diff line Loading @@ -22,37 +22,44 @@ <application android:hardwareAccelerated="true" android:label="vector" > <activity android:name="VectorDrawableTest" android:label="Vector Icon" > android:name="VectorDrawablePerformance" android:label="Vector Performance" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="com.android.test.dynamic.TEST" /> </intent-filter> </activity> <activity android:name="VectorDrawable01" android:label="VectorTest1" > android:name="VectorDrawableAnimation" android:label="VectorTestAnimation" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="com.android.test.dynamic.TEST" /> </intent-filter> </activity> <activity android:name="VectorDrawableTest" android:label="Vector Icon" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="VectorDrawablePerformance" android:label="Vector Performance" > android:name="VectorDrawable01" android:label="VectorTest1" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="com.android.test.dynamic.TEST" /> </intent-filter> </activity> <activity android:name="VectorDrawableDupPerf" android:label="Vector Performance of clones" > Loading
tests/VectorDrawableTest/res/drawable/animation_drawable_vector.xml 0 → 100644 +36 −0 Original line number Diff line number Diff line <!-- 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. --> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/animation_drawable_vector" android:oneshot="false"> <item android:drawable="@drawable/vector_drawable01" android:duration="300" /> <item android:drawable="@drawable/vector_drawable02" android:duration="300" /> <item android:drawable="@drawable/vector_drawable03" android:duration="300" /> <item android:drawable="@drawable/vector_drawable04" android:duration="300" /> <item android:drawable="@drawable/vector_drawable05" android:duration="300" /> <item android:drawable="@drawable/vector_drawable06" android:duration="300" /> <item android:drawable="@drawable/vector_drawable07" android:duration="300" /> <item android:drawable="@drawable/vector_drawable08" android:duration="300" /> <item android:drawable="@drawable/vector_drawable09" android:duration="300" /> <item android:drawable="@drawable/vector_drawable10" android:duration="300" /> <item android:drawable="@drawable/vector_drawable11" android:duration="300" /> <item android:drawable="@drawable/vector_drawable12" android:duration="300" /> <item android:drawable="@drawable/vector_drawable13" android:duration="300" /> <item android:drawable="@drawable/vector_drawable14" android:duration="300" /> <item android:drawable="@drawable/vector_drawable15" android:duration="300" /> <item android:drawable="@drawable/vector_drawable16" android:duration="300" /> <item android:drawable="@drawable/vector_drawable17" android:duration="300" /> <item android:drawable="@drawable/vector_drawable18" android:duration="300" /> </animation-list>
tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableAnimation.java 0 → 100644 +45 −0 Original line number Diff line number Diff line /* * 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.AnimationDrawable; import android.os.Bundle; import android.view.View; import android.widget.Button; public class VectorDrawableAnimation extends Activity { private static final String LOGCAT = "VectorDrawableAnimation"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Button button = new Button(this); button.setBackgroundResource(R.drawable.animation_drawable_vector); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AnimationDrawable frameAnimation = (AnimationDrawable) v.getBackground(); // Start the animation (looped playback by default). frameAnimation.start(); } }); setContentView(button); } }