本文整理匯總了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;
}