diff options
Diffstat (limited to 'tests')
31 files changed, 372 insertions, 599 deletions
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml index 5c2583b..3e9cf43 100644 --- a/tests/HwAccelerationTest/AndroidManifest.xml +++ b/tests/HwAccelerationTest/AndroidManifest.xml @@ -232,6 +232,15 @@ <category android:name="com.android.test.hwui.TEST" /> </intent-filter> </activity> + + <activity + android:name="LooperAcceleration" + android:label="Misc/LooperAcceleration"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="com.android.test.hwui.TEST" /> + </intent-filter> + </activity> <activity android:name="TextFadeActivity" @@ -288,6 +297,15 @@ </activity> <activity + android:name="CirclePropActivity" + android:label="Draw/Circle Props"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="com.android.test.hwui.TEST" /> + </intent-filter> + </activity> + + <activity android:name="ClearActivity" android:label="Window/Clear"> <intent-filter> diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java new file mode 100644 index 0000000..5c273de --- /dev/null +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java @@ -0,0 +1,146 @@ +/* + * 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.hwui; + +import android.app.Activity; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.CanvasProperty; +import android.graphics.Paint; +import android.graphics.Paint.Style; +import android.os.Bundle; +import android.os.Trace; +import android.view.HardwareCanvas; +import android.view.RenderNodeAnimator; +import android.view.View; +import android.webkit.WebChromeClient; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.LinearLayout; +import android.widget.LinearLayout.LayoutParams; +import android.widget.ProgressBar; + +import java.util.ArrayList; + +public class CirclePropActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + final LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + ProgressBar spinner = new ProgressBar(this, null, android.R.attr.progressBarStyleLarge); + layout.addView(spinner, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); + // For testing with a functor in the tree +// WebView wv = new WebView(this); +// wv.setWebViewClient(new WebViewClient()); +// wv.setWebChromeClient(new WebChromeClient()); +// wv.loadUrl("http://theverge.com"); +// layout.addView(wv, new LayoutParams(LayoutParams.MATCH_PARENT, 100)); + + layout.addView(new CircleView(this), + new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); + + setContentView(layout); + } + + static class CircleView extends View { + static final int DURATION = 500; + + private boolean mToggle = false; + ArrayList<RenderNodeAnimator> mRunningAnimations = new ArrayList<RenderNodeAnimator>(); + + CanvasProperty<Float> mX; + CanvasProperty<Float> mY; + CanvasProperty<Float> mRadius; + CanvasProperty<Paint> mPaint; + + CircleView(Context c) { + super(c); + setClickable(true); + + mX = CanvasProperty.createFloat(200.0f); + mY = CanvasProperty.createFloat(200.0f); + mRadius = CanvasProperty.createFloat(150.0f); + + Paint p = new Paint(); + p.setAntiAlias(true); + p.setColor(0xFFFF0000); + p.setStyle(Style.STROKE); + p.setStrokeWidth(60.0f); + mPaint = CanvasProperty.createPaint(p); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + + if (canvas.isHardwareAccelerated()) { + HardwareCanvas hwcanvas = (HardwareCanvas) canvas; + hwcanvas.drawCircle(mX, mY, mRadius, mPaint); + } + } + + @Override + public boolean performClick() { + for (int i = 0; i < mRunningAnimations.size(); i++) { + mRunningAnimations.get(i).cancel(); + } + mRunningAnimations.clear(); + + mToggle = !mToggle; + + mRunningAnimations.add(new RenderNodeAnimator( + mX, RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 400.0f : 200.0f)); + + mRunningAnimations.add(new RenderNodeAnimator( + mY, RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 600.0f : 200.0f)); + + mRunningAnimations.add(new RenderNodeAnimator( + mRadius, RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 250.0f : 150.0f)); + + mRunningAnimations.add(new RenderNodeAnimator( + mPaint, RenderNodeAnimator.PAINT_ALPHA, + RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 64.0f : 255.0f)); + + mRunningAnimations.add(new RenderNodeAnimator( + mPaint, RenderNodeAnimator.PAINT_STROKE_WIDTH, + RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 5.0f : 60.0f)); + + for (int i = 0; i < mRunningAnimations.size(); i++) { + mRunningAnimations.get(i).start(this); + } + + if (mToggle) { + post(new Runnable() { + @Override + public void run() { + Trace.traceBegin(Trace.TRACE_TAG_VIEW, "pretendBusy"); + try { + Thread.sleep(DURATION); + } catch (InterruptedException e) { + } + Trace.traceEnd(Trace.TRACE_TAG_VIEW); + } + }); + } + + return true; + } + } +} diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/LooperAcceleration.java b/tests/HwAccelerationTest/src/com/android/test/hwui/LooperAcceleration.java new file mode 100644 index 0000000..20d8e11 --- /dev/null +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/LooperAcceleration.java @@ -0,0 +1,96 @@ +/* + * 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.hwui; + +import android.app.Activity; +import android.app.Dialog; +import android.content.Context; +import android.content.DialogInterface; +import android.graphics.Canvas; +import android.os.Bundle; +import android.os.Looper; +import android.view.View; +import android.view.ViewGroup.LayoutParams; +import android.webkit.WebChromeClient; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.LinearLayout; + +public class LooperAcceleration extends Activity { + + static final boolean INCLUDE_WEBVIEW = false; + + static class IsAcceleratedView extends View { + + public IsAcceleratedView(Context context) { + super(context); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + if (canvas.isHardwareAccelerated()) { + canvas.drawARGB(0xFF, 0x00, 0xFF, 0x00); + } else { + canvas.drawARGB(0xFF, 0xFF, 0x00, 0x00); + } + } + + } + + private View makeView() { + LinearLayout layout = new LinearLayout(this); + layout.addView(new IsAcceleratedView(this), LayoutParams.MATCH_PARENT, 60); + + if (INCLUDE_WEBVIEW) { + WebView wv = new WebView(this); + wv.setWebViewClient(new WebViewClient()); + wv.setWebChromeClient(new WebChromeClient()); + wv.loadUrl("http://www.webkit.org/blog-files/3d-transforms/poster-circle.html"); + layout.addView(wv, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); + } + return layout; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(makeView()); + + new Thread() { + @Override + public void run() { + Looper.prepare(); + final Context context = LooperAcceleration.this; + Dialog dlg = new Dialog(context); + dlg.addContentView(makeView(), new LayoutParams(300, 400)); + dlg.setCancelable(true); + dlg.setCanceledOnTouchOutside(true); + dlg.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + Looper.myLooper().quit(); + } + }); + dlg.setTitle("Not Looper.getMainLooper() check"); + dlg.show(); + Looper.loop(); + } + }.start(); + } +} diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/SmallCircleActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/SmallCircleActivity.java index 8c02539..a3f4ddc 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/SmallCircleActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/SmallCircleActivity.java @@ -57,7 +57,7 @@ public class SmallCircleActivity extends Activity { mPaint = new Paint(); mPaint.setAntiAlias(true); - mPaint.setColor(0xffffffff); + mPaint.setColor(0xff00ffff); } @Override diff --git a/tests/OneMedia/src/com/android/onemedia/PlayerSession.java b/tests/OneMedia/src/com/android/onemedia/PlayerSession.java index 2e029f0..b7dcef7 100644 --- a/tests/OneMedia/src/com/android/onemedia/PlayerSession.java +++ b/tests/OneMedia/src/com/android/onemedia/PlayerSession.java @@ -84,11 +84,12 @@ public class PlayerSession { Log.d(TAG, "Creating session for package " + mContext.getBasePackageName()); mSession = man.createSession("OneMedia"); mSession.addCallback(mCallback); - mPerformer = mSession.setTransportPerformerEnabled(); + mPerformer = mSession.getTransportPerformer(); mPerformer.addListener(new TransportListener()); mPerformer.setPlaybackState(mPlaybackState); + mSession.setFlags(Session.FLAG_HANDLES_TRANSPORT_CONTROLS); mSession.setRouteOptions(mRouteOptions); - mSession.publish(); + mSession.setActive(true); } public void onDestroy() { diff --git a/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java b/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java index 1d209dd..8f9cf58 100644 --- a/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java +++ b/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java @@ -19,8 +19,6 @@ import java.util.Map; public class MainActivity extends Activity implements OnItemClickListener { - static final int TRANSLATION_Y = 1; - static final int DELTA_TYPE_DELTA = 1; static final int DURATION = 400; static final String KEY_NAME = "name"; @@ -75,7 +73,7 @@ public class MainActivity extends Activity implements OnItemClickListener { float delta = (pos - clickedPosition) * 1.1f; if (delta == 0) delta = -1; RenderNodeAnimator animator = new RenderNodeAnimator( - TRANSLATION_Y, DELTA_TYPE_DELTA, dy * delta); + RenderNodeAnimator.TRANSLATION_Y, RenderNodeAnimator.DELTA_TYPE_DELTA, dy * delta); animator.setDuration(DURATION); animator.start(child); } diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable01.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable01.xml index bb2bebf..d0f2a2d 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable01.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable01.xml @@ -14,7 +14,7 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:trigger="state_checked" android:versionCode="1" > + android:versionCode="1" > <size android:height="48dp" @@ -26,53 +26,11 @@ <group> <path - android:name="check" - android:pathData="m20,200l100,90l180,-180l-35,-35l-145,145l-60,-60l-40,40z" - android:fill="?android:attr/colorControlActivated" /> - </group> - <group> - <path android:name="box1" - android:pathData="m127,171l37,38l33,-31l-37,-40l-1,3l-2,0l-30,30z" + android:pathData="m20,200l100,90l180,-180l-35,-35l-145,145l-60,-60l-40,40z" android:fill="?android:attr/colorControlActivated" android:stroke="?android:attr/colorControlActivated" android:strokeLineCap="round" android:strokeLineJoin="round" /> </group> - <group> - <path - android:name="box2" - android:pathData="m127,171l37,38l33,-31l-37,-40l-1,3l-2,0l-30,30z" - android:rotation="46.757" - android:pivotX="162" - android:pivotY="173.5" - android:fill="?android:attr/colorControlNormal" - android:stroke="?android:attr/colorControlNormal" - android:strokeWidth="3" - android:strokeLineCap="round" - android:strokeLineJoin="round" /> - </group> - <group> - <path - android:name="box3" - android:pathData="m187,147l-1,55l-49,-1l2,-53l48,0z" - android:stroke="?android:attr/colorControlNormal" - android:strokeWidth="10" - android:strokeLineCap="round" - android:strokeLineJoin="round" /> - </group> - <group> - <path - android:name="box4" - android:pathData="m248,74l0,164l-177,0l1,-165l173,-1l3,2z" - android:stroke="?android:attr/colorControlNormal" - android:strokeWidth="30" - android:strokeLineCap="round" - android:strokeLineJoin="round" /> - </group> - - <animation - android:durations="300,100,0,300" - android:sequence="check,box1,box2,box3,box4" /> - </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml index 49906d17..728624a 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml @@ -23,14 +23,6 @@ <group> <path - android:name="arrow" - android:pathData="M 100,225 L 100,115 L 130,115 L 70,15 L 10,115 L 40,115 L 40,225 z" - android:fill="#ffffffff" - android:stroke="#FF00FF00" - android:strokeWidth="1"/> - </group> - <group> - <path android:name="house" android:pathData="M 130,225 L 130,115 L 130,115 L 70,15 L 10,115 L 10,115 L 10,225 z" android:fill="#ff440000" @@ -42,5 +34,4 @@ android:trimPathStart=".1" android:trimPathEnd=".9"/> </group> - <animation android:sequence="arrow,house"/> </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml index 137049d..1792683 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml @@ -71,67 +71,4 @@ android:fill="#ff88ff" /> </group> - <group> - <path - android:name="clip1" - android:pathData=" - M 0, 0 - l 7.3, 0 - l 0, 12.25 - l -7.3, 0 - z" - android:clipToPath="true" - android:rotation="-30" - android:pivotX="3.65" - android:pivotY="6.125" - /> - <path - android:name="one" - android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0,-6.671875 -2.109375,0.421875 0.0,-1.078125 - l 2.09375,-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0 - l -5.046875,0.0 0.0,-1.0Z" - android:fill="#ff88ff" - /> - <path - android:name="clip2" - android:pathData=" - M 0, 12.25 - l 7.3, 0 - l 0, 12.25 - l -7.3, 0 - z" - android:clipToPath="true" - android:rotation="-30" - android:pivotX="3.65" - android:pivotY="6.125" - /> - <path - android:name="two" - android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0 -5.5625,0.0 0.0,-1.0q 0.671875,-0.6875 1.828125,-1.859375 - q 1.1718752,-1.1875 1.4687502,-1.53125 0.578125,-0.625 0.796875,-1.0625 - q 0.234375,-0.453125 0.234375,-0.875 0.0,-0.703125 -0.5,-1.140625 - q -0.484375,-0.4375 -1.2656252,-0.4375 -0.5625,0.0 -1.1875,0.1875 - q -0.609375,0.1875 -1.3125,0.59375l 0.0,-1.203125q 0.71875,-0.28125 1.328125,-0.421875 - q 0.625,-0.15625 1.140625,-0.15625 1.3593752,0.0 2.1718752,0.6875 - q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125 -0.203125,1.015625 - q -0.203125,0.484375 -0.734375,1.140625 -0.15625,0.171875 -0.9375,0.984375 - q -0.78125024,0.8125 -2.2187502,2.265625Z" - android:fill="#ff88ff" - /> - </group> - - - <animation - android:sequence="one,one" - android:durations="4000"/> - <animation - android:sequence="two,two" - android:durations="4000"/> - <animation - android:sequence="clip1,clip1" - android:durations="4000"/> - <animation - android:sequence="clip2,clip2" - android:durations="4000"/> - </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml index cffb73f..90694fb 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml @@ -65,62 +65,4 @@ android:fill="#ff88ff" /> </group> - <group> - <path - android:name="clip1" - android:pathData=" - M 3.65, 6.125 - m -6, 0 - a 6,6 0 1,0 12,0 - a 6,6 0 1,0 -12,0z" - android:clipToPath="true" - android:fill="#332233" - /> - <path - android:name="one" - android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0,-6.671875 -2.109375,0.421875 0.0,-1.078125 - l 2.09375,-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0 - l -5.046875,0.0 0.0,-1.0Z" - android:fill="#ff88ff" - /> - <path - android:name="clip2" - android:pathData=" - M 3.65, 6.125 - m -.001, 0 - a .001,.001 0 1,0 .002,0 - a .001,.001 0 1,0 -.002,0z" - android:clipToPath="true" - android:fill="#662233" - /> - <path - android:name="two" - android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0 -5.5625,0.0 0.0,-1.0q 0.671875,-0.6875 1.828125,-1.859375 - q 1.1718752,-1.1875 1.4687502,-1.53125 0.578125,-0.625 0.796875,-1.0625 - q 0.234375,-0.453125 0.234375,-0.875 0.0,-0.703125 -0.5,-1.140625 - q -0.484375,-0.4375 -1.2656252,-0.4375 -0.5625,0.0 -1.1875,0.1875 - q -0.609375,0.1875 -1.3125,0.59375l 0.0,-1.203125q 0.71875,-0.28125 1.328125,-0.421875 - q 0.625,-0.15625 1.140625,-0.15625 1.3593752,0.0 2.1718752,0.6875 - q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125 -0.203125,1.015625 - q -0.203125,0.484375 -0.734375,1.140625 -0.15625,0.171875 -0.9375,0.984375 - q -0.78125024,0.8125 -2.2187502,2.265625Z" - android:fill="#ff88ff" - /> - </group> - - - - <animation - android:sequence="one,one" - android:durations="4000"/> - <animation - android:sequence="two,two" - android:durations="4000"/> - <animation - android:sequence="clip1,clip1" - android:durations="4000"/> - <animation - android:sequence="clip2,clip2" - android:durations="4000"/> - </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml index 0be6755..c6595fa 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml @@ -44,95 +44,4 @@ q -0.203125,0.484375 -0.734375,1.140625 -0.15625,0.171875 -0.9375,0.984375 q -0.78125024,0.8125 -2.2187502,2.265625Z" /> </group> - <group> - <path - android:name="one" - android:fill="#ffff00" - android:fillOpacity="0" - android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0,-6.671875 -2.109375,0.421875 0.0,-1.078125 -l 2.09375,-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0 -l -5.046875,0.0 0.0,-1.0Z" /> - <path - android:name="two" - android:fill="#ffff00" - android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0 -5.5625,0.0 0.0,-1.0q 0.671875,-0.6875 1.828125,-1.859375 - q 1.1718752,-1.1875 1.4687502,-1.53125 0.578125,-0.625 0.796875,-1.0625 - q 0.234375,-0.453125 0.234375,-0.875 0.0,-0.703125 -0.5,-1.140625 - q -0.484375,-0.4375 -1.2656252,-0.4375 -0.5625,0.0 -1.1875,0.1875 - q -0.609375,0.1875 -1.3125,0.59375l 0.0,-1.203125q 0.71875,-0.28125 1.328125,-0.421875 - q 0.625,-0.15625 1.140625,-0.15625 1.3593752,0.0 2.1718752,0.6875 - q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125 -0.203125,1.015625 - q -0.203125,0.484375 -0.734375,1.140625 -0.15625,0.171875 -0.9375,0.984375 - q -0.78125024,0.8125 -2.2187502,2.265625Z" /> - </group> - <group> - <path - android:name="two" - android:fill="#ffff00" - android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0 -5.5625,0.0 0.0,-1.0q 0.671875,-0.6875 1.828125,-1.859375 - q 1.1718752,-1.1875 1.4687502,-1.53125 0.578125,-0.625 0.796875,-1.0625 - q 0.234375,-0.453125 0.234375,-0.875 0.0,-0.703125 -0.5,-1.140625 - q -0.484375,-0.4375 -1.2656252,-0.4375 -0.5625,0.0 -1.1875,0.1875 - q -0.609375,0.1875 -1.3125,0.59375l 0.0,-1.203125q 0.71875,-0.28125 1.328125,-0.421875 - q 0.625,-0.15625 1.140625,-0.15625 1.3593752,0.0 2.1718752,0.6875 - q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125 -0.203125,1.015625 - q -0.203125,0.484375 -0.734375,1.140625 -0.15625,0.171875 -0.9375,0.984375 - q -0.78125024,0.8125 -2.2187502,2.265625Z" /> - <path - android:name="three" - android:fill="#ffff00" - android:fillOpacity="0" - android:pathData="M 5.103125,6.003125q 0.84375,0.1875 1.3125,0.765625 0.484375,0.5625 0.484375,1.40625 - q 0.0,1.296875 -0.890625,2.015625 -0.890625,0.703125 -2.53125,0.703125 - q -0.546875,0.0 -1.140625,-0.109375 -0.5781251,-0.109375 -1.1875001,-0.328125 - l 0.0,-1.140625q 0.484375,0.28125 1.0625001,0.4375 0.59375,0.140625 1.234375,0.140625 - q 1.109375,0.0 1.6875,-0.4375 0.59375,-0.4375 0.59375,-1.28125 - q 0.0,-0.765625 -0.546875,-1.203125 -0.546875,-0.4375 -1.5,-0.4375 - l -1.03125,0.0 0.0,-0.96875 1.078125,0.0q 0.859375,0.0 1.328125,-0.34375 - q 0.46875,-0.359375 0.46875,-1.015625 0.0,-0.671875 -0.484375,-1.03125 - q -0.46875,-0.359375 -1.359375,-0.359375 -0.5,0.0 -1.0625,0.109375 - q -0.546875,0.09375 -1.2187501,0.3125l 0.0,-1.046875q 0.6875001,-0.1875 1.2656251,-0.28125 - q 0.59375,-0.09375 1.109375,-0.09375 1.359375,0.0 2.140625,0.609375 - q 0.78125,0.609375 0.78125,1.65625 0.0,0.734375 -0.421875,1.234375 - q -0.40625,0.5 -1.171875,0.6875Z" /> - </group> - <group> - <path - android:name="two" - android:fill="#ffff00" - android:fillOpacity="0" - android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0 -5.5625,0.0 0.0,-1.0q 0.671875,-0.6875 1.828125,-1.859375 - q 1.1718752,-1.1875 1.4687502,-1.53125 0.578125,-0.625 0.796875,-1.0625 - q 0.234375,-0.453125 0.234375,-0.875 0.0,-0.703125 -0.5,-1.140625 - q -0.484375,-0.4375 -1.2656252,-0.4375 -0.5625,0.0 -1.1875,0.1875 - q -0.609375,0.1875 -1.3125,0.59375l 0.0,-1.203125q 0.71875,-0.28125 1.328125,-0.421875 - q 0.625,-0.15625 1.140625,-0.15625 1.3593752,0.0 2.1718752,0.6875 - q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125 -0.203125,1.015625 - q -0.203125,0.484375 -0.734375,1.140625 -0.15625,0.171875 -0.9375,0.984375 - q -0.78125024,0.8125 -2.2187502,2.265625Z" /> - <path - android:name="three" - android:fill="#ffff00" - android:pathData="M 5.103125,6.003125q 0.84375,0.1875 1.3125,0.765625 0.484375,0.5625 0.484375,1.40625 - q 0.0,1.296875 -0.890625,2.015625 -0.890625,0.703125 -2.53125,0.703125 - q -0.546875,0.0 -1.140625,-0.109375 -0.5781251,-0.109375 -1.1875001,-0.328125 - l 0.0,-1.140625q 0.484375,0.28125 1.0625001,0.4375 0.59375,0.140625 1.234375,0.140625 - q 1.109375,0.0 1.6875,-0.4375 0.59375,-0.4375 0.59375,-1.28125 - q 0.0,-0.765625 -0.546875,-1.203125 -0.546875,-0.4375 -1.5,-0.4375 - l -1.03125,0.0 0.0,-0.96875 1.078125,0.0q 0.859375,0.0 1.328125,-0.34375 - q 0.46875,-0.359375 0.46875,-1.015625 0.0,-0.671875 -0.484375,-1.03125 - q -0.46875,-0.359375 -1.359375,-0.359375 -0.5,0.0 -1.0625,0.109375 - q -0.546875,0.09375 -1.2187501,0.3125l 0.0,-1.046875q 0.6875001,-0.1875 1.2656251,-0.28125 - q 0.59375,-0.09375 1.109375,-0.09375 1.359375,0.0 2.140625,0.609375 - q 0.78125,0.609375 0.78125,1.65625 0.0,0.734375 -0.421875,1.234375 - q -0.40625,0.5 -1.171875,0.6875Z" /> - </group> - - <animation - android:durations="2000,0,2000" - android:sequence="one,one,three,three" /> - <animation - android:durations="2000,0,2000" - android:sequence="two,two,two,two" /> - </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml index 73ff5e2..850de28 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml @@ -23,29 +23,6 @@ android:viewportHeight="700"/> <group> - </group> - <path android:pathData="M 569.374 461.472L 569.374 160.658L 160.658 160.658L 160.658 461.472L 569.374 461.472z" - android:name="path2451" - android:stroke="#FF000000" - android:strokeWidth="30.65500000000000"/> - <path android:pathData="M 365.015 311.066" - android:name="path2453" - android:stroke="#FF000000" - android:strokeWidth="30.655000000000001"/> - <path android:pathData="M 164.46 164.49L 340.78 343.158C 353.849 356.328 377.63 356.172 390.423 343.278L 566.622 165.928" - android:name="path2455" - android:stroke="#FF000000" - android:fill="#FF0000FF" - android:strokeWidth="30.655000000000001"/> - <path android:pathData="M 170.515 451.566L 305.61 313.46" - android:name="path2457" - android:stroke="#000000" - android:strokeWidth="30.655000000000001"/> - <path android:pathData="M 557.968 449.974L 426.515 315.375" - android:name="path2459" - android:stroke="#000000" - android:strokeWidth="30.655000000000001"/> - <group> <path android:pathData="M 569.374 461.472L 569.374 160.658L 160.658 160.658L 160.658 461.472L 569.374 461.472z" android:name="path2451" android:stroke="#FF000000" @@ -68,9 +45,4 @@ android:stroke="#000000" android:strokeWidth="30.655000000000001"/> </group> - - <animation android:sequence="path2451,path2451" - android:durations="1000"/> - - </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable07.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable07.xml index 99d37ef..7c7e679 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable07.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable07.xml @@ -19,14 +19,7 @@ <viewport android:viewportWidth="140" android:viewportHeight="110"/> - <group> - <path - android:name="menu" - android:pathData="M 20,20 l 100,0 0,10 -100,0 z - M 20,50 l 100,0 0,10 -100,0 z - M 20,80 l 0,-10 100,0 0,10 z" - android:fill="#ffffffff"/> - </group> + <group> <path android:name="back" @@ -34,12 +27,6 @@ M 27,50 l 97,0 0,10 -97,0 z M 20,55 l 7.07,-7.07 35.3,35.3 -7.07,7.07 z" android:fill="#ffffffff" - android:rotation="180" - android:pivotX="70" - android:pivotY="55" /> </group> - <animation android:sequence="menu,back"/> - - </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable08.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable08.xml index f8a03d7..59f7459 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable08.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable08.xml @@ -31,18 +31,4 @@ android:strokeWidth="1"/> </group> - <group> - <path - android:name="pie2" - android:pathData="M564.441,287A280.868,280.868 0 1,1 564.441,285L284.493,286.29Z" - android:fill="#FFccaa00" - android:stroke="#FF000000" - android:strokeWidth="10" - android:pivotX="90" - android:pivotY="100"/> - </group> - - <animation android:sequence="pie1,pie2"/> - - </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml index b3c91a8..2e379d6 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml @@ -25,12 +25,6 @@ <group> <path - android:name="arrow" - android:fill="#ffffffff" - android:pathData="M 20,20 l 60,0 0,140 -60,0 z M 120,20 l 60,0 0,140 -60,0 z" /> - </group> - <group> - <path android:name="house" android:fill="#ffffffff" android:pathData="M 100,20 l 0,0 0,140 -80,0 z M 100,20 l 0,0 80,140 -80,0 z" @@ -39,6 +33,4 @@ android:rotation="90" /> </group> - <animation android:sequence="arrow,house" /> - </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable10.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable10.xml index 7aca169..8484e9e 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable10.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable10.xml @@ -21,8 +21,8 @@ android:width="64dp" /> <viewport - android:viewportHeight="200" - android:viewportWidth="200" /> + android:viewportWidth="200" + android:viewportHeight="200"/> <group> <path @@ -31,24 +31,6 @@ android:pathData="M49.001,60c-5.466,0 -9.899,4.478 -9.899,10s4.434,10,9.899,10c5.468,0,9.899 -4.478,9.899 -10S54.469,60,49.001,60z" /> <path android:name="bar2" - android:fill="#FF555555" - android:pathData="M28.001,48.787l7,7.07c7.731 -7.811,20.269 -7.81,28.001,0l6.999 -7.07C58.403,37.071,39.599,37.071,28.001,48.787z" /> - <path - android:name="bar1" - android:fill="#FF555555" - android:pathData="M14.001,34.645 L21,41.716c15.464 -15.621,40.536 -15.621,56,0l7.001 -7.071C64.672,15.119,33.33,15.119,14.001,34.645z" /> - <path - android:name="bar0" - android:fill="#FF555555" - android:pathData="M0,20.502l6.999,7.071 c23.196 -23.431,60.806 -23.431,84.002,0L98,20.503C70.938 -6.834,27.063 -6.834,0,20.502z" /> - </group> - <group> - <path - android:name="bar3" - android:fill="#FFFFFFFF" - android:pathData="M49.001,60c-5.466,0 -9.899,4.478 -9.899,10s4.434,10,9.899,10c5.468,0,9.899 -4.478,9.899 -10S54.469,60,49.001,60z" /> - <path - android:name="bar2" android:fill="#FFFFFFFF" android:pathData="M28.001,48.787l7,7.07c7.731 -7.811,20.269 -7.81,28.001,0l6.999 -7.07C58.403,37.071,39.599,37.071,28.001,48.787z" /> <path @@ -60,54 +42,5 @@ android:fill="#FF555555" android:pathData="M0,20.502l6.999,7.071 c23.196 -23.431,60.806 -23.431,84.002,0L98,20.503C70.938 -6.834,27.063 -6.834,0,20.502z" /> </group> - <group> - <path - android:name="bar3" - android:fill="#FFFFFFFF" - android:pathData="M49.001,60c-5.466,0 -9.899,4.478 -9.899,10s4.434,10,9.899,10c5.468,0,9.899 -4.478,9.899 -10S54.469,60,49.001,60z" /> - <path - android:name="bar2" - android:fill="#FFFFFFFF" - android:pathData="M28.001,48.787l7,7.07c7.731 -7.811,20.269 -7.81,28.001,0l6.999 -7.07C58.403,37.071,39.599,37.071,28.001,48.787z" /> - <path - android:name="bar1" - android:fill="#FFFFFFFF" - android:pathData="M14.001,34.645 L21,41.716c15.464 -15.621,40.536 -15.621,56,0l7.001 -7.071C64.672,15.119,33.33,15.119,14.001,34.645z" /> - <path - android:name="bar0" - android:fill="#FF555555" - android:pathData="M0,20.502l6.999,7.071 c23.196 -23.431,60.806 -23.431,84.002,0L98,20.503C70.938 -6.834,27.063 -6.834,0,20.502z" /> - </group> - <group> - <path - android:name="bar3" - android:fill="#FFFFFFFF" - android:pathData="M49.001,60c-5.466,0 -9.899,4.478 -9.899,10s4.434,10,9.899,10c5.468,0,9.899 -4.478,9.899 -10S54.469,60,49.001,60z" /> - <path - android:name="bar2" - android:fill="#FFFFFFFF" - android:pathData="M28.001,48.787l7,7.07c7.731 -7.811,20.269 -7.81,28.001,0l6.999 -7.07C58.403,37.071,39.599,37.071,28.001,48.787z" /> - <path - android:name="bar1" - android:fill="#FFFFFFFF" - android:pathData="M14.001,34.645 L21,41.716c15.464 -15.621,40.536 -15.621,56,0l7.001 -7.071C64.672,15.119,33.33,15.119,14.001,34.645z" /> - <path - android:name="bar0" - android:fill="#FFFFFFFF" - android:pathData="M0,20.502l6.999,7.071 c23.196 -23.431,60.806 -23.431,84.002,0L98,20.503C70.938 -6.834,27.063 -6.834,0,20.502z" /> - </group> - - <animation - android:durations="500,500,500" - android:sequence="bar0,bar0,bar0,bar0" /> - <animation - android:durations="500,500,500" - android:sequence="bar1,bar1,bar1,bar1" /> - <animation - android:durations="500,500,500" - android:sequence="bar2,bar2,bar2,bar2" /> - <animation - android:durations="500,500,500" - android:sequence="bar3,bar3,bar3,bar3" /> </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml index a4403c5..2b6c5d3 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml @@ -36,25 +36,5 @@ android:fill="#FFFF0000" android:pathData="M 30,18.031528 L 25.579581,23.421071 L 29.370621,26.765348 L 20.096792,37 L 21.156922,28.014053 L 17,24.902844 L 20.880632,18 L 30,18.031528 z" /> </group> - <group> - <path - android:name="battery" - android:fill="#ff8833" - android:pathData="M 20.28125,2.0000002 C 17.352748,2.0000002 15,4.3527485 15,7.2812502 L 15,8.0000002 L 13.15625,8.0000002 C 9.7507553,8.0000002 7,10.750759 7,14.15625 L 7,39.84375 C 7,43.24924 9.7507558,46 13.15625,46 L 33.84375,46 C 37.249245,46 39.999999,43.24924 40,39.84375 L 40,14.15625 C 40,10.75076 37.249243,8.0000002 33.84375,8.0000002 L 32,8.0000002 L 32,7.2812502 C 32,4.3527485 29.647252,2.0000002 26.71875,2.0000002 L 20.28125,2.0000002 z" - android:rotation="0" - android:stroke="#3388ff" - android:strokeWidth="1" /> - <path - android:name="spark" - android:fill="#FFFF0000" - android:pathData="M 30,18.031528 L 25.579581,23.421071 L 29.370621,26.765348 L 20.096792,37 L 21.156922,28.014053 L 17,24.902844 L 20.880632,18 L 30,18.031528 z" /> - </group> - - <animation - android:durations="2000" - android:sequence="spark,spark" /> - <animation - android:durations="2000" - android:sequence="battery,battery" /> </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml index 207879d..681eb4f 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml @@ -40,48 +40,5 @@ android:pivotY="300" android:rotation="0" /> </group> - <group> - <path - android:name="v" - android:pathData="M300,70 l 0,-70 70,70 -70,70z" - android:pivotX="300" - android:pivotY="300" - android:rotation="360" /> - <path - android:name="pie2" - android:pathData="M300,70 a230,230 0 1,0 1,0 z" - android:pivotX="300" - android:pivotY="300" - android:rotation="360" - android:stroke="#FF00FF00" - android:strokeLineCap="round" - android:strokeWidth="70" - android:trimPathEnd=".5" - android:trimPathOffset="0" - android:trimPathStart="0" /> - </group> - - <animation - android:animate="easeInOut" - android:durations="2000" - android:repeatCount="-1" - android:repeatStyle="forward" - android:sequence="pie1,pie2" - android:startOffset="500" /> - <animation - android:animate="easeInOut" - android:durations="2000" - android:repeatCount="-1" - android:repeatStyle="forward" - android:sequence="v,v" - android:startOffset="500" /> - <animation - android:animate="easeInOut" - android:durations="2800" - android:limitTo="trimPathEnd" - android:repeatCount="-1" - android:repeatStyle="reverse" - android:sequence="pie1,pie2" - android:startOffset="500" /> </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml index 4a2ed90..ef1b8e4 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml @@ -40,40 +40,5 @@ android:stroke="#FF0000FF" android:strokeWidth="5" /> </group> - <group> - <path - android:name="pie2" - android:fill="#ffff0000" - android:pathData="M300,200 h-150 a150,150 0 1,0 150,-150 z" - android:pivotX="300" - android:pivotY="200" - android:rotation="360" - android:stroke="#FF00FF00" - android:strokeWidth="10" /> - <path - android:name="half" - android:fill="#FFFFFF00" - android:pathData="M275,175 v-150 a150,150 0 0,0 -150,150 z" - android:pivotX="300" - android:pivotY="200" - android:rotation="-360" - android:stroke="#FF0000FF" - android:strokeWidth="5" /> - </group> - - <animation - android:animate="easeInOut" - android:durations="1000" - android:repeatCount="2" - android:repeatStyle="forward" - android:sequence="pie1,pie2" - android:startOffset="500" /> - <animation - android:animate="easeInOut" - android:durations="1000" - android:repeatCount="5" - android:repeatStyle="forward" - android:sequence="half,half" - android:startOffset="500" /> </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml index 6ebd56b..77bf723 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml @@ -25,17 +25,6 @@ <group> <path - android:name="pie1" - android:pathData="M200,450 l 50,-25 - a25,25 -30 0,1 100,-50 l 50,-25 - a25,50 -30 0,1 100,-50 l 50,-25 - a25,75 -30 0,1 100,-50 l 50,-25 - a25,100 -30 0,1 100,-50 l 50,-25" - android:stroke="#FF00FF00" - android:strokeWidth="10" /> - </group> - <group> - <path android:name="pie2" android:pathData="M200,350 l 50,-25 a25,12 -30 0,1 100,-50 l 50,-25 @@ -49,6 +38,4 @@ android:strokeWidth="10" /> </group> - <animation android:sequence="pie1,pie2" /> - </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml index 3c92d25..df5838c 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml @@ -25,14 +25,6 @@ <group> <path - android:name="arrow" - android:fill="#ffffffff" - android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" - android:stroke="#FFFF0000" - android:strokeWidth="1" /> - </group> - <group> - <path android:name="house" android:fill="#ff440000" android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" @@ -43,6 +35,4 @@ android:strokeWidth="10" /> </group> - <animation android:sequence="arrow,house" /> - </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml index 7e757a5..0bdcda5 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml @@ -25,13 +25,6 @@ <group> <path - android:name="arrow" - android:pathData="M 100,10 v 180 M 10,100 h 180" - android:stroke="#FF00FF00" - android:strokeWidth="1" /> - </group> - <group> - <path android:name="house" android:pathData="M 100,10 v 90 M 10,100 h 90" android:pivotX="100" @@ -41,6 +34,4 @@ android:strokeWidth="10" /> </group> - <animation android:sequence="arrow,house" /> - </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml index 9427652..4453ae4 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml @@ -23,14 +23,6 @@ <group> <path - android:name="arrow" - android:pathData="M200,300 Q400,50 600,300 T1000,300" - android:stroke="#FF00FF00" - android:strokeWidth="1"/> - </group> - - <group> - <path android:name="house" android:pathData="M200,300 Q400,50 600,300 T1000,300" android:stroke="#FFFF0000" @@ -40,7 +32,4 @@ android:pivotY="300"/> </group> - <animation android:sequence="arrow,house"/> - - </vector> diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml index 69212f5..dfae9ac 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml @@ -25,21 +25,13 @@ <group> <path - android:name="arrow" - android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" - android:stroke="#FFFFFF00" - android:strokeWidth="10" /> - </group> - <group> - <path android:name="house" android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" android:pivotX="250" android:pivotY="200" android:rotation="360" + android:stroke="#FFFFFF00" android:strokeWidth="10" /> </group> - <animation android:sequence="arrow,house" /> - </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml b/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml index 2dca48d..a890fd6 100644 --- a/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml +++ b/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml @@ -25,13 +25,6 @@ <group> <path - android:name="arrow" - android:pathData="M10,300 Q400,50 600,300 T1000,300" - android:stroke="#FF00FFFF" - android:strokeWidth="40" /> - </group> - <group> - <path android:name="house" android:pathData="M10,300 Q400,550 600,300 T1000,300" android:pivotX="90" @@ -40,6 +33,4 @@ android:strokeWidth="60" /> </group> - <animation android:sequence="arrow,house" /> - </vector>
\ No newline at end of file diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java index 88ae398..7ba01b1 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java @@ -22,7 +22,7 @@ import android.widget.Button; import android.widget.GridLayout; @SuppressWarnings({"UnusedDeclaration"}) -public class VectorDrawable01 extends Activity implements View.OnClickListener { +public class VectorDrawable01 extends Activity { private static final String LOGCAT = "VectorDrawable1"; int[] icon = { R.drawable.vector_drawable01, @@ -61,28 +61,10 @@ public class VectorDrawable01 extends Activity implements View.OnClickListener { button.setWidth(200); button.setBackgroundResource(icon[i]); container.addView(button); - button.setOnClickListener(this); } - Button b = new Button(this); - b.setText("Run All"); - b.setOnClickListener(new View.OnClickListener(){ - @Override - public void onClick(View v) { - for (int i = 0; i < bArray.length; i++) { - VectorDrawable d = (VectorDrawable) bArray[i].getBackground(); - d.start(); - } - }}); - container.addView(b); setContentView(container); } - @Override - public void onClick(View v) { - VectorDrawable d = (VectorDrawable) v.getBackground(); - d.start(); - } - } diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java index 3929298..b918cdd 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java @@ -25,7 +25,7 @@ import android.widget.ScrollView; import java.text.DecimalFormat; @SuppressWarnings({"UnusedDeclaration"}) -public class VectorDrawablePerformance extends Activity implements View.OnClickListener { +public class VectorDrawablePerformance extends Activity { private static final String LOGCAT = "VectorDrawable1"; protected int[] icon = { R.drawable.vector_drawable01, @@ -76,7 +76,6 @@ public class VectorDrawablePerformance extends Activity implements View.OnClickL button.setWidth(200); button.setBackgroundResource(icon[i]); container.addView(button); - button.setOnClickListener(this); } setContentView(scrollView); time = android.os.SystemClock.elapsedRealtimeNanos()-time; @@ -85,10 +84,4 @@ public class VectorDrawablePerformance extends Activity implements View.OnClickL t.setBackgroundColor(0xFF000000); container.addView(t); } - - @Override - public void onClick(View v) { - VectorDrawable d = (VectorDrawable) v.getBackground(); - d.start(); - } } diff --git a/tests/VoiceInteraction/res/layout/voice_interaction_session.xml b/tests/VoiceInteraction/res/layout/voice_interaction_session.xml new file mode 100644 index 0000000..9fcbf3e --- /dev/null +++ b/tests/VoiceInteraction/res/layout/voice_interaction_session.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- 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. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:background="#ffffffff" + > + + <TextView android:id="@+id/text" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="32dp" + /> + + <Button android:id="@+id/start" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/start" + /> + +</LinearLayout> + + diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java index 008d97b..d40b05f 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionService.java @@ -17,6 +17,7 @@ package com.android.test.voiceinteraction; import android.content.Intent; +import android.os.Bundle; import android.service.voice.VoiceInteractionService; import android.util.Log; @@ -31,7 +32,9 @@ public class MainInteractionService extends VoiceInteractionService { @Override public int onStartCommand(Intent intent, int flags, int startId) { - startVoiceActivity(new Intent(this, TestInteractionActivity.class), null); + Bundle args = new Bundle(); + args.putParcelable("intent", new Intent(this, TestInteractionActivity.class)); + startSession(args); stopSelf(startId); return START_NOT_STICKY; } diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java index 0fc563b..a3af284 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSession.java @@ -17,18 +17,59 @@ package com.android.test.voiceinteraction; import android.content.Context; +import android.content.Intent; import android.os.Bundle; import android.service.voice.VoiceInteractionSession; import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; -public class MainInteractionSession extends VoiceInteractionSession { +public class MainInteractionSession extends VoiceInteractionSession + implements View.OnClickListener { static final String TAG = "MainInteractionSession"; - final Bundle mArgs; + Intent mStartIntent; + View mContentView; + TextView mText; + Button mStartButton; - MainInteractionSession(Context context, Bundle args) { + Request mPendingRequest; + boolean mPendingConfirm; + + MainInteractionSession(Context context) { super(context); - mArgs = args; + } + + @Override + public void onCreate(Bundle args) { + super.onCreate(args); + showWindow(); + mStartIntent = args.getParcelable("intent"); + } + + @Override + public View onCreateContentView() { + mContentView = getLayoutInflater().inflate(R.layout.voice_interaction_session, null); + mText = (TextView)mContentView.findViewById(R.id.text); + mStartButton = (Button)mContentView.findViewById(R.id.start); + mStartButton.setOnClickListener(this); + return mContentView; + } + + public void onClick(View v) { + if (mPendingRequest == null) { + mStartButton.setEnabled(false); + startVoiceActivity(mStartIntent); + } else { + if (mPendingConfirm) { + mPendingRequest.sendConfirmResult(true, null); + } else { + mPendingRequest.sendCommandResult(true, null); + } + mPendingRequest = null; + mStartButton.setText("Start"); + } } @Override @@ -38,14 +79,22 @@ public class MainInteractionSession extends VoiceInteractionSession { @Override public void onConfirm(Caller caller, Request request, String prompt, Bundle extras) { - Log.i(TAG, "onConform: prompt=" + prompt + " extras=" + extras); - request.sendConfirmResult(true, null); + Log.i(TAG, "onConfirm: prompt=" + prompt + " extras=" + extras); + mText.setText(prompt); + mStartButton.setEnabled(true); + mStartButton.setText("Confirm"); + mPendingRequest = request; + mPendingConfirm = true; } @Override public void onCommand(Caller caller, Request request, String command, Bundle extras) { Log.i(TAG, "onCommand: command=" + command + " extras=" + extras); - request.sendCommandResult(true, null); + mText.setText("Command: " + command); + mStartButton.setEnabled(true); + mStartButton.setText("Finish Command"); + mPendingRequest = request; + mPendingConfirm = false; } @Override diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSessionService.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSessionService.java index 8864d71..7cf8178 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSessionService.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/MainInteractionSessionService.java @@ -23,6 +23,6 @@ import android.service.voice.VoiceInteractionSessionService; public class MainInteractionSessionService extends VoiceInteractionSessionService { @Override public VoiceInteractionSession onNewSession(Bundle args) { - return new MainInteractionSession(this, args); + return new MainInteractionSession(this); } } |