本文整理汇总了Java中android.animation.ObjectAnimator.isStarted方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectAnimator.isStarted方法的具体用法?Java ObjectAnimator.isStarted怎么用?Java ObjectAnimator.isStarted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.ObjectAnimator
的用法示例。
在下文中一共展示了ObjectAnimator.isStarted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cancelAndStartAnimators
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
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);
}
示例2: startDisplayLanguageOnSpacebar
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void startDisplayLanguageOnSpacebar(final boolean subtypeChanged,
final int languageOnSpacebarFormatType,
final boolean hasMultipleEnabledIMEsOrSubtypes) {
if (subtypeChanged) {
KeyPreviewView.clearTextCache();
}
mLanguageOnSpacebarFormatType = languageOnSpacebarFormatType;
mHasMultipleEnabledIMEsOrSubtypes = hasMultipleEnabledIMEsOrSubtypes;
final ObjectAnimator animator = mLanguageOnSpacebarFadeoutAnimator;
if (animator == null) {
mLanguageOnSpacebarFormatType = LanguageOnSpacebarUtils.FORMAT_TYPE_NONE;
} else {
if (subtypeChanged
&& languageOnSpacebarFormatType != LanguageOnSpacebarUtils.FORMAT_TYPE_NONE) {
setLanguageOnSpacebarAnimAlpha(Constants.Color.ALPHA_OPAQUE);
if (animator.isStarted()) {
animator.cancel();
}
animator.start();
} else {
if (!animator.isStarted()) {
mLanguageOnSpacebarAnimAlpha = mLanguageOnSpacebarFinalAlpha;
}
}
}
invalidateKey(mSpaceKey);
}