本文整理汇总了Java中android.animation.Animator.AnimatorListener方法的典型用法代码示例。如果您正苦于以下问题:Java Animator.AnimatorListener方法的具体用法?Java Animator.AnimatorListener怎么用?Java Animator.AnimatorListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.Animator
的用法示例。
在下文中一共展示了Animator.AnimatorListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initAnimatorListener
import android.animation.Animator; //导入方法依赖的package包/类
private void initAnimatorListener() {
mAnimatorListener = new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
isBottomMenuAnimShowing = true;
}
@Override
public void onAnimationEnd(Animator animation) {
isBottomMenuAnimShowing = false;
}
@Override
public void onAnimationCancel(Animator animation) {
isBottomMenuAnimShowing = false;
}
@Override
public void onAnimationRepeat(Animator animation) {
}
};
}
示例2: createAnimatorListener
import android.animation.Animator; //导入方法依赖的package包/类
private
@Nullable
Animator.AnimatorListener createAnimatorListener(final WXSDKInstance instance, @Nullable final String callBack) {
if (!TextUtils.isEmpty(callBack)) {
return new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (instance == null || instance.isDestroy()) {
WXLogUtils.e("RenderActionContextImpl-onAnimationEnd WXSDKInstance == null NPE or instance is destroyed");
} else {
WXSDKManager.getInstance().callback(instance.getInstanceId(),
callBack,
new HashMap<String, Object>());
}
}
};
} else {
return null;
}
}
示例3: endAnimation
import android.animation.Animator; //导入方法依赖的package包/类
@Override
public void endAnimation(DynamicWeatherView dynamicWeatherView, Animator.AnimatorListener listener) {
super.endAnimation(dynamicWeatherView, listener);
ValueAnimator animator = ValueAnimator.ofFloat(1, -1);
animator.setDuration(1000);
animator.setRepeatCount(0);
animator.setInterpolator(new AccelerateInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
hillTransFactor = (float) animation.getAnimatedValue();
}
});
if (listener != null) {
animator.addListener(listener);
}
animator.start();
}
示例4: fabAnimate
import android.animation.Animator; //导入方法依赖的package包/类
private void fabAnimate(int scale, Animator.AnimatorListener listener) {
if (scale == fab.getAlpha()) {
return;
}
ViewPropertyAnimator animator = fab.animate()
.scaleX(scale)
.scaleY(scale)
.alpha(scale)
.setDuration(300);
if (listener != null) {
animator.setListener(listener);
}
animator.start();
}
示例5: forEnd
import android.animation.Animator; //导入方法依赖的package包/类
@Contract("_ -> !null")
public static Animator.AnimatorListener forEnd(final OnAnimationEndListener endListener) {
return new SimpleAnimatorListener() {
@Override
public void onAnimationEnd(Animator animation) {
endListener.onAnimationEnd(animation);
}
};
}
示例6: forStart
import android.animation.Animator; //导入方法依赖的package包/类
@Contract("_ -> !null")
public static Animator.AnimatorListener forStart(final OnAnimationStartListener startListener) {
return new SimpleAnimatorListener() {
@Override
public void onAnimationStart(final Animator animation) {
startListener.onAnimationStart(animation);
}
};
}
示例7: playCombined
import android.animation.Animator; //导入方法依赖的package包/类
private void playCombined() {
int longestMorphos = getLongestMorphos();
int index = 0;
if (this.swarmListener != null) {
swarmListener.onSwarmStart();
}
for (Morpho m : swarm) {
if (longestMorphos == index) {
internalListener = new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
if (swarmListener != null) {
swarmListener.onSwarmEnd();
}
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
};
}
index += 1;
m.play(true, internalListener);
}
}
示例8: forCancel
import android.animation.Animator; //导入方法依赖的package包/类
@Contract("_ -> !null")
public static Animator.AnimatorListener forCancel(final OnAnimationCancelListener cancelListener) {
return new SimpleAnimatorListener() {
@Override
public void onAnimationCancel(Animator animation) {
cancelListener.onAnimationCancel(animation);
}
};
}
示例9: play
import android.animation.Animator; //导入方法依赖的package包/类
private BaseViewAnimator play() {
animator.setTarget(target);
if (pivotX == YoYo.CENTER_PIVOT) {
ViewCompat.setPivotX(target, target.getMeasuredWidth() / 2.0f);
} else {
target.setPivotX(pivotX);
}
if (pivotY == YoYo.CENTER_PIVOT) {
ViewCompat.setPivotY(target, target.getMeasuredHeight() / 2.0f);
} else {
target.setPivotY(pivotY);
}
animator.setDuration(duration)
.setRepeatTimes(repeatTimes)
.setRepeatMode(repeatMode)
.setInterpolator(interpolator)
.setStartDelay(delay);
if (callbacks.size() > 0) {
for (Animator.AnimatorListener callback : callbacks) {
animator.addAnimatorListener(callback);
}
}
animator.animate();
return animator;
}
示例10: waterLoggingAlpha
import android.animation.Animator; //导入方法依赖的package包/类
public static void waterLoggingAlpha(final View view, final Animator.AnimatorListener listener) {
ObjectAnimator anim = ObjectAnimator.ofFloat(view, "alpha", 0.1f, 1f);
anim.setDuration(1200);// 动画持续时间
if(listener!=null) {
anim.addListener(listener);
}
anim.start();
}
示例11: setAnimatorListener
import android.animation.Animator; //导入方法依赖的package包/类
public FriskyShimmer setAnimatorListener(Animator.AnimatorListener animatorListener) {
this.animatorListener = animatorListener;
return this;
}
示例12: removeListener
import android.animation.Animator; //导入方法依赖的package包/类
@Override
public FAnimatorSet removeListener(Animator.AnimatorListener listener)
{
return (FAnimatorSet) super.removeListener(listener);
}
示例13: removeAnimatorListener
import android.animation.Animator; //导入方法依赖的package包/类
@SuppressWarnings("WeakerAccess") public void removeAnimatorListener(Animator.AnimatorListener listener) {
animator.removeListener(listener);
}
示例14: AnimatorListenerWrapper
import android.animation.Animator; //导入方法依赖的package包/类
public AnimatorListenerWrapper(Animator animator,
Animator.AnimatorListener listener) {
mAnimator = animator;
mListener = listener;
}
示例15: withListener
import android.animation.Animator; //导入方法依赖的package包/类
public AnimationComposer withListener(Animator.AnimatorListener listener) {
callbacks.add(listener);
return this;
}