本文整理汇总了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();
}
示例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;
}
}
}
示例3: deleteAnimator
import android.animation.Animator; //导入方法依赖的package包/类
/**
* 删除动画
* @param animator
*/
public static void deleteAnimator(Animator animator) {
if (animator != null && animator.isRunning()) {
animator.cancel();
}
animator = null;
}
示例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);
}
}
示例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;
}
}
示例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();
}
示例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;
}
}
}
示例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();
}
示例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;
}
}
}
示例10: startAnimator
import android.animation.Animator; //导入方法依赖的package包/类
/**
* 启动动画
* @param animator
*/
public static void startAnimator(Animator animator) {
if (animator != null && !animator.isRunning()) {
animator.start();
}
}
示例11: stopAnimator
import android.animation.Animator; //导入方法依赖的package包/类
/**
* 停止动画
* @param animator
*/
public static void stopAnimator(Animator animator) {
if (animator != null && animator.isRunning()) {
animator.cancel();
}
}
示例12: isRunning
import android.animation.Animator; //导入方法依赖的package包/类
@Override
public boolean isRunning() {
Animator a = mAnimator.get();
return a != null && a.isRunning();
}
示例13: stop
import android.animation.Animator; //导入方法依赖的package包/类
public static void stop(Animator animator) {
if (animator != null && !animator.isRunning()) {
animator.end();
}
}
示例14: isRunning
import android.animation.Animator; //导入方法依赖的package包/类
/**
* 动画是否在运行
* @param animator
*/
public static boolean isRunning(Animator animator) {
return animator != null && animator.isRunning();
}