當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectAnimator.cancel方法代碼示例

本文整理匯總了Java中android.animation.ObjectAnimator.cancel方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectAnimator.cancel方法的具體用法?Java ObjectAnimator.cancel怎麽用?Java ObjectAnimator.cancel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.animation.ObjectAnimator的用法示例。


在下文中一共展示了ObjectAnimator.cancel方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: releaseAnimation

import android.animation.ObjectAnimator; //導入方法依賴的package包/類
private void releaseAnimation(){
    ObjectAnimator animator = mAnimator.get();

    if(animator != null){
        animator.cancel();
        mAnimator = new WeakReference<>(null);
    }
}
 
開發者ID:PhoenixDevTeam,項目名稱:Phoenix-for-VK,代碼行數:9,代碼來源:WaveFormView.java

示例2: destroy

import android.animation.ObjectAnimator; //導入方法依賴的package包/類
/**
 * Need to call when Activity or Fragment destroy
 */
public void destroy() {
    for (ObjectAnimator a : animators) {
        a.removeAllListeners();
        a.cancel();
    }
}
 
開發者ID:RahulJanagouda,項目名稱:StatusStories,代碼行數:10,代碼來源:StoryStatusView.java

示例3: 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);
}
 
開發者ID:rkkr,項目名稱:simple-keyboard,代碼行數:16,代碼來源:MainKeyboardView.java

示例4: 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);
}
 
開發者ID:rkkr,項目名稱:simple-keyboard,代碼行數:28,代碼來源:MainKeyboardView.java

示例5: removePetView

import android.animation.ObjectAnimator; //導入方法依賴的package包/類
public void removePetView(int index) {
    if (mPetViews.size() == 0) {
        return;
    }
    PetView petView = mPetViews.get(index);
    ObjectAnimator objectAnimator = petView.getObjectAnimator();
    if (objectAnimator != null) {
        objectAnimator.cancel();
    }
    mWindowManager.removeViewImmediate(petView);
    mPetViews.remove(index);
    mLayoutParams.remove(index);
}
 
開發者ID:Sora-Shiro,項目名稱:LemonYi,代碼行數:14,代碼來源:ViewManager.java

示例6: cancelAnimator

import android.animation.ObjectAnimator; //導入方法依賴的package包/類
private ObjectAnimator cancelAnimator(ObjectAnimator animator) {
    if (animator != null) {
        animator.removeAllListeners();
        animator.cancel();
    }
    return null;
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:8,代碼來源:AllAppsBackgroundDrawable.java

示例7: animatePicker

import android.animation.ObjectAnimator; //導入方法依賴的package包/類
private void animatePicker(boolean hoursToMinutes, long duration) {
    final float target = hoursToMinutes ? HOURS : MINUTES;
    if (mHoursToMinutes == target) {
        // If we have a pending or running animator, cancel it.
        if (mHoursToMinutesAnimator != null && mHoursToMinutesAnimator.isStarted()) {
            mHoursToMinutesAnimator.cancel();
            mHoursToMinutesAnimator = null;
        }

        // We're already showing the correct picker.
        return;
    }

    ObjectAnimator oldHoursToMinutes = mHoursToMinutesAnimator;

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        mHoursToMinutesAnimator = ObjectAnimator.ofFloat(this, HOURS_TO_MINUTES, target);
    } else {
        mHoursToMinutesAnimator = ObjectAnimator.ofFloat(this, HOURS_TO_MINUTES_OLD, target);
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        mHoursToMinutesAnimator.setAutoCancel(true);
    } else {
        if (oldHoursToMinutes != null) {
            oldHoursToMinutes.cancel();
        }
    }
    mHoursToMinutesAnimator.setDuration(duration);
    mHoursToMinutesAnimator.start();
}
 
開發者ID:Gericop,項目名稱:DateTimePicker,代碼行數:31,代碼來源:RadialTimePickerView.java

示例8: cancelAnimator

import android.animation.ObjectAnimator; //導入方法依賴的package包/類
private ObjectAnimator cancelAnimator(ObjectAnimator animator) {
    if (animator != null) {
        animator.cancel();
    }
    return null;
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:7,代碼來源:AllAppsBackgroundDrawable.java

示例9: stopAnim

import android.animation.ObjectAnimator; //導入方法依賴的package包/類
private void stopAnim(ObjectAnimator mRotateAntiClockwiseAnimator) {
    mCurrentPlayTime = mRotateAntiClockwiseAnimator.getCurrentPlayTime();
    mRotateAntiClockwiseAnimator.cancel();
}
 
開發者ID:paradoxie,項目名稱:DizzyPassword,代碼行數:5,代碼來源:MainActivity.java


注:本文中的android.animation.ObjectAnimator.cancel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。