本文整理了Java中android.view.animation.Animation.cancel()
方法的一些代码示例,展示了Animation.cancel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Animation.cancel()
方法的具体详情如下:
包路径:android.view.animation.Animation
类名称:Animation
方法名:cancel
暂无
代码示例来源:origin: sunfusheng/MarqueeView
@Override
public void onAnimationStart(Animation animation) {
if (isAnimStart) {
animation.cancel();
}
isAnimStart = true;
}
代码示例来源:origin: rey5137/material
private void cancelAllAnimations(){
for(Object obj : mAnimations){
if(obj instanceof Animation)
((Animation)obj).cancel();
else if(obj instanceof ValueAnimator)
((ValueAnimator)obj).cancel();
}
mAnimations.clear();
}
代码示例来源:origin: rey5137/material
/**
* Dismiss Dialog immediately without showing out animation.
*/
public void dismissImmediately(){
super.dismiss();
if(mAnimation != null)
mAnimation.cancel();
if(mHandler != null)
mHandler.removeCallbacks(mDismissAction);
}
代码示例来源:origin: Clans/FloatingActionButton
private void playShowAnimation() {
if (mShowAnimation != null) {
mHideAnimation.cancel();
startAnimation(mShowAnimation);
}
}
代码示例来源:origin: Clans/FloatingActionButton
private void playHideAnimation() {
if (mHideAnimation != null) {
mShowAnimation.cancel();
startAnimation(mHideAnimation);
}
}
代码示例来源:origin: Clans/FloatingActionButton
void playHideAnimation() {
mShowAnimation.cancel();
startAnimation(mHideAnimation);
}
代码示例来源:origin: Clans/FloatingActionButton
void playShowAnimation() {
mHideAnimation.cancel();
startAnimation(mShowAnimation);
}
代码示例来源:origin: rey5137/material
mAnimation.cancel();
mAnimation = null;
代码示例来源:origin: rey5137/material
mOutAnimation.cancel();
mOutAnimation.reset();
mOutAnimation.setAnimationListener(new Animation.AnimationListener() {
代码示例来源:origin: rey5137/material
mInAnimation.cancel();
mInAnimation.reset();
mInAnimation.setAnimationListener(new Animation.AnimationListener() {
代码示例来源:origin: Ramotion/expanding-collection-android
public void updateCurrentBackgroundAsync(ECPager pager, final AnimationDirection direction) {
if (mCurrentAnimationTask != null && mCurrentAnimationTask.getStatus().equals(AsyncTask.Status.RUNNING)) {
getInAnimation().cancel();
}
int position = pager.getCurrentPosition();
Integer mainBgImageDrawableResource = pager.getDataFromAdapterDataset(position).getMainBackgroundResource();
if (mainBgImageDrawableResource == null) return;
mCurrentAnimationTask = new BitmapWorkerTask(getResources(), mainBgImageDrawableResource) {
@Override
protected void onPostExecute(Bitmap bitmap) {
super.onPostExecute(bitmap);
setImageBitmapWithAnimation(bitmap, direction);
}
};
mCurrentAnimationTask.execute(position);
}
代码示例来源:origin: chaychan/TouTiao
/**
* 停止首页页签的旋转动画
*/
private void cancelTabLoading(BottomBarItem bottomItem) {
Animation animation = bottomItem.getImageView().getAnimation();
if (animation != null) {
animation.cancel();
}
}
代码示例来源:origin: michael-rapp/ChromeLikeTabSwitcher
@Override
public final void onCancelFling() {
if (flingAnimation != null) {
flingAnimation.cancel();
flingAnimation = null;
getDragHandler().onUp(null);
logger.logVerbose(getClass(), "Canceled fling animation");
}
}
代码示例来源:origin: stackoverflow.com
currentAnimation.cancel();
currentAnimation = null;
} else {
代码示例来源:origin: OCNYang/Android-Animation-Set
private void doAnimation(Animation animation, @Nullable final String animationType) {
Animation oldAnimation = mPuppet.getAnimation();
if (oldAnimation != null) {
if (oldAnimation.hasStarted() || (!oldAnimation.hasEnded())) {
oldAnimation.cancel();
mPuppet.clearAnimation();
}
}
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Log.d(TAG, animationType + " start;");
}
@Override
public void onAnimationEnd(Animation animation) {
Log.d(TAG, animationType + " end;");
}
@Override
public void onAnimationRepeat(Animation animation) {
Log.d(TAG, animationType + " repeat;");
}
});
mPuppet.startAnimation(animation);
}
代码示例来源:origin: stackoverflow.com
view.startAnimation(getAnimation());
} else if (animation != null) {
animation.cancel();
view.setAnimation(null);
代码示例来源:origin: OCNYang/Android-Animation-Set
private void launchRevealAnimation() {
Animation animation = mPuppet.getAnimation();
if (animation != null) {
animation.cancel();
代码示例来源:origin: michael-rapp/ChromeLikeTabSwitcher
/**
* Animates the visibility of a tab's close button.
*
* @param viewHolder
* The view holder, which holds a reference to the close button, whose visibility should
* be animated, as an instance of the class {@link AbstractTabViewHolder}. The view
* holder may not be null
* @param show
* True, if the close button should be shown, false otherwise
*/
private void animateCloseButtonVisibility(@NonNull final AbstractTabViewHolder viewHolder,
final boolean show) {
ImageButton closeButton = viewHolder.closeButton;
Boolean visible = (Boolean) closeButton.getTag(R.id.tag_visibility);
if (visible == null || visible != show) {
closeButton.setTag(R.id.tag_visibility, show);
if (closeButton.getAnimation() != null) {
closeButton.getAnimation().cancel();
}
ViewPropertyAnimator animation = closeButton.animate();
animation.setListener(createCloseButtonVisibilityAnimationListener(viewHolder, show));
animation.alpha(show ? 1 : 0);
animation.setStartDelay(0);
animation.setDuration(closeButtonVisibilityAnimationDuration);
animation.start();
}
}
代码示例来源:origin: stackoverflow.com
ta.cancel();
ta = null;
代码示例来源:origin: Blankeer/MDWechat
private void playHideAnimation() {
if (mHideAnimation != null) {
mShowAnimation.cancel();
startAnimation(mHideAnimation);
}
}
内容来源于网络,如有侵权,请联系作者删除!