本文整理汇总了Java中android.animation.Animator.end方法的典型用法代码示例。如果您正苦于以下问题:Java Animator.end方法的具体用法?Java Animator.end怎么用?Java Animator.end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.Animator
的用法示例。
在下文中一共展示了Animator.end方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cancelExistingAnimation
import android.animation.Animator; //导入方法依赖的package包/类
/**
* Cancels any existing animations for given View.
*/
public void cancelExistingAnimation(@NonNull final View view) {
int hashCode = view.hashCode();
Animator animator = mAnimators.get(hashCode);
if (animator != null) {
animator.end();
mAnimators.remove(hashCode);
}
}
示例2: 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();
}
示例3: 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;
}
}
}
示例4: end
import android.animation.Animator; //导入方法依赖的package包/类
/**
* call function and end
*
* @param animator
* @return
*/
public static boolean end(Animator animator) {
if (animator != null && animator.isStarted()) {
animator.end();
return true;
}
return false;
}
示例5: 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();
}
示例6: 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;
}
}
}
示例7: end
import android.animation.Animator; //导入方法依赖的package包/类
@Override
public void end() {
Animator a = mAnimator.get();
if (a != null) {
a.end();
}
}
示例8: end
import android.animation.Animator; //导入方法依赖的package包/类
@Override
public void end() {
Animator a = mAnimator.get();
if(a != null){
a.end();
}
}
示例9: endAnimations
import android.animation.Animator; //导入方法依赖的package包/类
@Override
public void endAnimations() {
final List<Animator> animatorList = new ArrayList<>(mAnimators.values());
for (Animator animator : animatorList) {
animator.end();
}
dispatchFinishedWhenDone();
}
示例10: setAnimationStatus
import android.animation.Animator; //导入方法依赖的package包/类
public void setAnimationStatus(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;
}
}
}
示例11: 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;
}
}
}
示例12: cancelExistingAnimation
import android.animation.Animator; //导入方法依赖的package包/类
/**
* Cancels any existing animations for given View. Useful when fling.
*/
private void cancelExistingAnimation(final int hashCode) {
Animator animator = mAnimators.get(hashCode);
if (animator != null) animator.end();
}