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


Java Animator.isRunning方法代碼示例

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


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

示例1: addIndicator

import android.animation.Animator; //導入方法依賴的package包/類
private void addIndicator(int orientation, @DrawableRes int backgroundDrawableId,
        Animator animator) {
    if (animator.isRunning()) {
        animator.end();
        animator.cancel();
    }

    View Indicator = new View(getContext());
    Indicator.setBackgroundResource(backgroundDrawableId);
    addView(Indicator, mIndicatorWidth, mIndicatorHeight);
    LayoutParams lp = (LayoutParams) Indicator.getLayoutParams();

    if (orientation == HORIZONTAL) {
        lp.leftMargin = mIndicatorMargin;
        lp.rightMargin = mIndicatorMargin;
    } else {
        lp.topMargin = mIndicatorMargin;
        lp.bottomMargin = mIndicatorMargin;
    }

    Indicator.setLayoutParams(lp);

    animator.setTarget(Indicator);
    animator.start();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:26,代碼來源:CircleIndicator.java

示例2: setAnimationStatus

import android.animation.Animator; //導入方法依賴的package包/類
/**
 * make animation to start or end when target
 * view was be Visible or Gone or Invisible.
 * make animation to cancel when target view
 * be onDetachedFromWindow.
 * @param animStatus
 */
public void setAnimationStatus(AnimStatus animStatus){
    if (mAnimators==null){
        return;
    }
    int count=mAnimators.size();
    for (int i = 0; i < count; i++) {
        Animator animator=mAnimators.get(i);
        boolean isRunning=animator.isRunning();
        switch (animStatus){
            case START:
                if (!isRunning){
                    animator.start();
                }
                break;
            case END:
                if (isRunning){
                    animator.end();
                }
                break;
            case CANCEL:
                if (isRunning){
                    animator.cancel();
                }
                break;
        }
    }
}
 
開發者ID:Mrqinlei,項目名稱:ImitateZHRB,代碼行數:35,代碼來源:BaseIndicatorController.java

示例3: deleteAnimator

import android.animation.Animator; //導入方法依賴的package包/類
/**
 * 刪除動畫
 * @param animator
 */
public static void deleteAnimator(Animator animator) {
    if (animator != null && animator.isRunning()) {
        animator.cancel();
    }
    animator = null;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:AnimateHelper.java

示例4: onDestroyActivity

import android.animation.Animator; //導入方法依賴的package包/類
static void onDestroyActivity() {
    HashSet<Animator> animators = new HashSet<Animator>(sAnimators.keySet());
    for (Animator a : animators) {
        if (a.isRunning()) {
            a.cancel();
        }
        sAnimators.remove(a);
    }
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:10,代碼來源:LauncherAnimUtils.java

示例5: isAnimatorCurrentlyRunning

import android.animation.Animator; //導入方法依賴的package包/類
boolean isAnimatorCurrentlyRunning(Animator animator) {
    if (animator != null
            && animator.isStarted()
            && animator.isRunning()
            && !animator.isPaused()) {
        return true;
    } else {
        return false;
    }
}
 
開發者ID:anmingyu11,項目名稱:OverScrollableRecyclerView-Method1,代碼行數:11,代碼來源:AnimatorController.java

示例6: isRunning

import android.animation.Animator; //導入方法依賴的package包/類
/**
 * 是否運行
 *
 * @param animator
 * @return
 */
public static boolean isRunning(Animator animator) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        LogUtil.d(animator.isStarted(), animator.isPaused(), animator.isRunning());
    }
    return animator != null && animator.isRunning();
}
 
開發者ID:alibaba,項目名稱:LuaViewPlayground,代碼行數:13,代碼來源:AnimatorUtil.java

示例7: setAnimationStatus

import android.animation.Animator; //導入方法依賴的package包/類
public void setAnimationStatus(BallSpinFadeLoadingView.AnimStatus status) {
    if (mAnimators == null) {
        return;
    }
    int count = mAnimators.size();
    for (int i = 0; i < count; i++) {
        Animator animator = mAnimators.get(i);
        boolean isRunning = animator.isRunning();
        switch (status) {
            case START:
                if (!isRunning) {
                    animator.start();
                }
                break;
            case END:
                if (isRunning) {
                    animator.end();
                }
                break;
            case CANCEL:
                if (isRunning) {
                    animator.cancel();
                }
                break;
        }
    }
}
 
開發者ID:wuhighway,項目名稱:DailyStudy,代碼行數:28,代碼來源:BallPulseLoadingView.java

示例8: addIndicator

import android.animation.Animator; //導入方法依賴的package包/類
private void addIndicator(@DrawableRes int backgroundDrawableId, Animator animator) {
    if (animator.isRunning()) animator.end();

    View Indicator = new View(getContext());
    Indicator.setBackgroundResource(backgroundDrawableId);
    addView(Indicator, mIndicatorWidth, mIndicatorHeight);
    LayoutParams lp = (LayoutParams) Indicator.getLayoutParams();
    lp.leftMargin = mIndicatorMargin;
    lp.rightMargin = mIndicatorMargin;
    Indicator.setLayoutParams(lp);

    animator.setTarget(Indicator);
    animator.start();
}
 
開發者ID:SkylineLabs,項目名稱:FindX,代碼行數:15,代碼來源:CircleIndicator.java

示例9: setAnimationStatus

import android.animation.Animator; //導入方法依賴的package包/類
/**
 * make animation to start or end when target
 * view was be Visible or Gone or Invisible.
 * make animation to cancel when target view
 * be onDetachedFromWindow.
 *
 * @param animStatus
 */
public void setAnimationStatus(AnimStatus animStatus) {
    if (mAnimators == null) {
        return;
    }
    int count = mAnimators.size();
    for (int i = 0; i < count; i++) {
        Animator animator = mAnimators.get(i);
        boolean isRunning = animator.isRunning();
        switch (animStatus) {
            case START:
                if (!isRunning) {
                    animator.start();
                }
                break;
            case END:
                if (isRunning) {
                    animator.end();
                }
                break;
            case CANCEL:
                if (isRunning) {
                    animator.cancel();
                }
                break;
        }
    }
}
 
開發者ID:Sugarya,項目名稱:Closet,代碼行數:36,代碼來源:BaseIndicatorController.java

示例10: startAnimator

import android.animation.Animator; //導入方法依賴的package包/類
/**
 * 啟動動畫
 * @param animator
 */
public static void startAnimator(Animator animator) {
    if (animator != null && !animator.isRunning()) {
        animator.start();
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:AnimateHelper.java

示例11: stopAnimator

import android.animation.Animator; //導入方法依賴的package包/類
/**
 * 停止動畫
 * @param animator
 */
public static void stopAnimator(Animator animator) {
    if (animator != null && animator.isRunning()) {
        animator.cancel();
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:AnimateHelper.java

示例12: isRunning

import android.animation.Animator; //導入方法依賴的package包/類
@Override
public boolean isRunning() {
    Animator a = mAnimator.get();
    return a != null && a.isRunning();
}
 
開發者ID:aliumujib,項目名稱:Nibo,代碼行數:6,代碼來源:SupportAnimatorPreL.java

示例13: stop

import android.animation.Animator; //導入方法依賴的package包/類
public static void stop(Animator animator) {
    if (animator != null && !animator.isRunning()) {
        animator.end();
    }
}
 
開發者ID:liuwei1993,項目名稱:AndroidAnimationTools,代碼行數:6,代碼來源:AnimUtils.java

示例14: isRunning

import android.animation.Animator; //導入方法依賴的package包/類
/**
 * 動畫是否在運行
 * @param animator
 */
public static boolean isRunning(Animator animator) {
    return animator != null && animator.isRunning();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:AnimateHelper.java


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