Java 类com.nineoldandroids.animation.TimeAnimator 实例源码

项目:DemoForPropertyAnimation    文件:AnimationDetailFragment.java   
public void showTimeAnimator(final View view) {
    if (mItem != null) {
        int type = Integer.valueOf(mItem.id);
        switch (type) {
        case DummyContent.ID_OLD_ANIMATIONS:
            Toast.makeText(getActivity(),
                    "The animation is not for View Animation",
                    Toast.LENGTH_SHORT).show();
            break;

        case DummyContent.ID_PROPERTY_ANIMATIONS:

            if (!isMoveStart) {
                TimeDrawView mTimeDrawView = (TimeDrawView) view
                        .findViewById(1204);

                mTimeAnimator = new android.animation.TimeAnimator();
                mTimeAnimator.setTimeListener(mTimeDrawView);
                mTimeAnimator.start();
                isMoveStart = true;
            } else {
                isMoveStart = false;
                mTimeAnimator.cancel();
            }

            break;

        case DummyContent.ID_PROPERTY_ANIMATIONS_FOR_V4:

            if (!isMoveStart) {
                TimeDrawViewV4 mTimeDrawView2 = (TimeDrawViewV4) view
                        .findViewById(1204);

                mTimeAnimator2 = new TimeAnimator();
                mTimeAnimator2.setTimeListener(mTimeDrawView2);
                mTimeAnimator2.start();
                isMoveStart = true;

            } else {
                isMoveStart = false;
                mTimeAnimator2.cancel();
            }
            break;

        case DummyContent.ID_KITKAT_TRANSITIONS:
            Toast.makeText(getActivity(), "No use!", Toast.LENGTH_SHORT)
                    .show();
            break;
        }
    }
}
项目:DemoForPropertyAnimation    文件:TimeDrawViewV4.java   
@Override
public void onTimeUpdate(TimeAnimator arg0, long totalTime,
        long deltaTime) {

    invalidate();

}