本文整理了Java中android.animation.ObjectAnimator.setCurrentPlayTime()
方法的一些代码示例,展示了ObjectAnimator.setCurrentPlayTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObjectAnimator.setCurrentPlayTime()
方法的具体详情如下:
包路径:android.animation.ObjectAnimator
类名称:ObjectAnimator
方法名:setCurrentPlayTime
暂无
代码示例来源:origin: google/android-ui-toolkit-demos
fadeToBlack.setCurrentPlayTime(prevAnimPlayTime);
fadeFromBlack.setCurrentPlayTime(prevAnimPlayTime);
oldTextRotate.setInterpolator(mAccelerateInterpolator);
if (runningInfo != null) {
oldTextRotate.setCurrentPlayTime(prevAnimPlayTime);
if (runningInfo != null && !firstHalf) {
newTextRotate.setCurrentPlayTime(prevAnimPlayTime);
代码示例来源:origin: geniusgithub/MediaPlayer
public void resumeRotateAnimation() {
mRotateAnimator.start();
mRotateAnimator.setCurrentPlayTime(mLastAnimationValue);
}
代码示例来源:origin: TwoWater/CustomizeView
private void seek(long seekTime) {
if (indicatorColorAnim == null) {
createIndicatorColorAnim();
}
indicatorColorAnim.setCurrentPlayTime(seekTime);
}
代码示例来源:origin: xuehuayous/PullToRefresh-Demo
@Override
public void onPull(float scaleOfLayout) {
scaleOfLayout = scaleOfLayout > 1.0f ? 1.0f : scaleOfLayout;
//缩放动画
ViewHelper.setPivotY(mBabyImage, mBabyImage.getMeasuredHeight()); // 设置中心点
ViewHelper.setPivotX(mBabyImage, mBabyImage.getMeasuredWidth() / 2);
ObjectAnimator animPX = ObjectAnimator.ofFloat(mBabyImage, "scaleX", 0, 1).setDuration(300);
animPX.setCurrentPlayTime((long) (scaleOfLayout * 300));
ObjectAnimator animPY = ObjectAnimator.ofFloat(mBabyImage, "scaleY", 0, 1).setDuration(300);
animPY.setCurrentPlayTime((long) (scaleOfLayout * 300));
}
代码示例来源:origin: stackoverflow.com
private ObjectAnimator mObjectAnimator;
private long mAnimationTime;
private void stopAnimation() {
if(mObjectAnimator != null) {
mAnimationTime = mObjectAnimator.getCurrentPlayTime();
mObjectAnimator.cancel();
}
}
private void playAnimation() {
if (mObjectAnimator != null) {
mObjectAnimator.start();
mObjectAnimator.setCurrentPlayTime(mAnimationTime);
}
}
代码示例来源:origin: iammert/MaskProgressView
/**
* Start animation horizontally
*/
public void start() {
if(mWidth == 0){
startRequested = true;
return;
}
if (mStatus == Status.PLAYING)
return;
if (mStatus == Status.IDLE || mStatus == Status.STOPPED || mCurrentProgressPosition == 0.0f)
objectAnimatorProgress.start();
else {
if (Build.VERSION.SDK_INT < 19) {
objectAnimatorProgress.setCurrentPlayTime(mCurrentSeconds * 1000);
objectAnimatorProgress.start();
} else {
if (isProgressCancelled) {
objectAnimatorProgress.start();
isProgressCancelled = false;
} else
objectAnimatorProgress.resume();
}
}
mStatus = Status.PLAYING;
}
代码示例来源:origin: crvv/android_wubi_input
private static void cancelAndStartAnimators(final ObjectAnimator animatorToCancel,
final ObjectAnimator animatorToStart) {
if (animatorToCancel == null || animatorToStart == null) {
// TODO: Stop using null as a no-operation animator.
return;
}
float startFraction = 0.0f;
if (animatorToCancel.isStarted()) {
animatorToCancel.cancel();
startFraction = 1.0f - animatorToCancel.getAnimatedFraction();
}
final long startTime = (long)(animatorToStart.getDuration() * startFraction);
animatorToStart.start();
animatorToStart.setCurrentPlayTime(startTime);
}
代码示例来源:origin: rkkr/simple-keyboard
private static void cancelAndStartAnimators(final ObjectAnimator animatorToCancel,
final ObjectAnimator animatorToStart) {
if (animatorToCancel == null || animatorToStart == null) {
// TODO: Stop using null as a no-operation animator.
return;
}
float startFraction = 0.0f;
if (animatorToCancel.isStarted()) {
animatorToCancel.cancel();
startFraction = 1.0f - animatorToCancel.getAnimatedFraction();
}
final long startTime = (long)(animatorToStart.getDuration() * startFraction);
animatorToStart.start();
animatorToStart.setCurrentPlayTime(startTime);
}
代码示例来源:origin: wasdennnoch/AndroidN-ify
mStartAnimationRect.top = previousStartValue;
mEndAnimationRect.top = newEndValue;
previousAnimator.setCurrentPlayTime(previousAnimator.getCurrentPlayTime());
return;
} else {
代码示例来源:origin: wasdennnoch/AndroidN-ify
mStartAnimationRect.bottom = previousStartValue;
mEndAnimationRect.bottom = newEndValue;
previousAnimator.setCurrentPlayTime(previousAnimator.getCurrentPlayTime());
return;
} else {
代码示例来源:origin: luhaoaimama1/zone-sdk
if (objAni.isRunning())
objAni.cancel();
objAni.setCurrentPlayTime(objAni.getDuration() / 2);
break;
内容来源于网络,如有侵权,请联系作者删除!