diff options
Diffstat (limited to 'testapps/customPropAnimTest/src')
2 files changed, 46 insertions, 0 deletions
diff --git a/testapps/customPropAnimTest/src/com/android/custompropertyanimation/CustomPropertyAnimationActivity.java b/testapps/customPropAnimTest/src/com/android/custompropertyanimation/CustomPropertyAnimationActivity.java new file mode 100644 index 0000000..b1b91b9 --- /dev/null +++ b/testapps/customPropAnimTest/src/com/android/custompropertyanimation/CustomPropertyAnimationActivity.java @@ -0,0 +1,22 @@ +package com.android.custompropertyanimation; + +import android.animation.ObjectAnimator; +import android.app.Activity; +import android.os.Bundle; +import android.widget.LinearLayout; + +public class CustomPropertyAnimationActivity extends Activity { + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + LinearLayout container = (LinearLayout) findViewById(R.id.container); + + MyView view = new MyView(this); + container.addView(view); + + ObjectAnimator anim = ObjectAnimator.ofFloat(view, "foo", 1); + anim.start(); + } +}
\ No newline at end of file diff --git a/testapps/customPropAnimTest/src/com/android/custompropertyanimation/MyView.java b/testapps/customPropAnimTest/src/com/android/custompropertyanimation/MyView.java new file mode 100644 index 0000000..e557fda --- /dev/null +++ b/testapps/customPropAnimTest/src/com/android/custompropertyanimation/MyView.java @@ -0,0 +1,24 @@ +package com.android.custompropertyanimation; + +import android.content.Context; +import android.view.View; + +public class MyView extends View { + + float mFoo = 0; + + public MyView(Context context) { + super(context); + } + + public void setFoo(float foo) { + System.out.println("foo = " + foo); + mFoo = foo; + } + + public float getFoo() { + System.out.println("getFoo() returning " + mFoo); + return mFoo; + } + +} |