本文整理匯總了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);
}