本文整理汇总了Java中android.animation.TimeAnimator.setTimeListener方法的典型用法代码示例。如果您正苦于以下问题:Java TimeAnimator.setTimeListener方法的具体用法?Java TimeAnimator.setTimeListener怎么用?Java TimeAnimator.setTimeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.TimeAnimator
的用法示例。
在下文中一共展示了TimeAnimator.setTimeListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createJBRunnable
import android.animation.TimeAnimator; //导入方法依赖的package包/类
private Runnable createJBRunnable() {
// On JB, we rely on TimeAnimator to send events tied with vsync.
return new Runnable() {
@Override
public void run() {
mTimeAnimator = new TimeAnimator();
mTimeAnimator.setTimeListener(new TimeListener() {
@Override
public void onTimeUpdate(TimeAnimator animation, long totalTime,
long deltaTime) {
if (!sendEvent(mDownTime + totalTime)) {
mTimeAnimator.end();
}
}
});
mTimeAnimator.start();
}
};
}
示例2: createJBRunnable
import android.animation.TimeAnimator; //导入方法依赖的package包/类
private Runnable createJBRunnable() {
// On JB, we rely on TimeAnimator to send events tied with vsync.
return new Runnable() {
@Override
public void run() {
mTimeAnimator = new TimeAnimator();
mTimeAnimator.setTimeListener(new TimeListener() {
@Override
public void onTimeUpdate(TimeAnimator animation, long totalTime,
long deltaTime) {
if (!sendEvent(mStartTime + totalTime)) {
mTimeAnimator.end();
}
}
});
mTimeAnimator.start();
}
};
}
示例3: init
import android.animation.TimeAnimator; //导入方法依赖的package包/类
private void init(Context context) {
animator = new TimeAnimator();
animator.setTimeListener(this);
paint = new Paint();
paint.setColor(Color.WHITE);
density = getResources().getDisplayMetrics().density;
path = new Path();
pathMeasure = new PathMeasure();
position = new PointF();
velocity = new PointF();
}
示例4: SystemClockManager
import android.animation.TimeAnimator; //导入方法依赖的package包/类
public SystemClockManager(SystemClockListener listener, long resolution) {
mListener = listener;
mResolution = resolution;
mAnimator = new TimeAnimator();
mAnimator.setTimeListener(this);
}
示例5: onCreate
import android.animation.TimeAnimator; //导入方法依赖的package包/类
@Override
@SuppressLint("NewApi")
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.property_animations09);
if (android.os.Build.VERSION.SDK_INT >= 19)
{
ImageView someImage = (ImageView) findViewById(R.id.some_image);
ObjectAnimator rotateAnim = ObjectAnimator.ofFloat(someImage, "rotation", 0, 360);
rotateAnim.setDuration(1000);
rotateAnim.setRepeatCount(5);
rotateAnim.setRepeatMode(ObjectAnimator.RESTART);
fpsText = (TextView) findViewById(R.id.fps_text);
FpsTimeListener listener = new FpsTimeListener(fpsText);
final TimeAnimator timeAnim = new TimeAnimator();
timeAnim.setTimeListener(listener);
anim = new AnimatorSet();
anim.play(rotateAnim).with(timeAnim);
rotateAnim.addListener(new AnimatorListenerAdapter()
{
@Override
public void onAnimationEnd(Animator animation)
{
timeAnim.end();
}
});
}
}
示例6: Bouncer
import android.animation.TimeAnimator; //导入方法依赖的package包/类
public Bouncer(Context context, AttributeSet attrs, int flags) {
super(context, attrs, flags);
mAnimator = new TimeAnimator();
mAnimator.setTimeListener(this);
}