当前位置: 首页>>代码示例>>Java>>正文


Java ViewCompat.postOnAnimationDelayed方法代码示例

本文整理汇总了Java中android.support.v4.view.ViewCompat.postOnAnimationDelayed方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.postOnAnimationDelayed方法的具体用法?Java ViewCompat.postOnAnimationDelayed怎么用?Java ViewCompat.postOnAnimationDelayed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.view.ViewCompat的用法示例。


在下文中一共展示了ViewCompat.postOnAnimationDelayed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: runMoveAnimation

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void runMoveAnimation(boolean removalsPending, boolean movesPending) {
	if (movesPending) {
		final ArrayList<MoveInfo> moves = new ArrayList<>();
		moves.addAll(mPendingMoves);
		mMovesList.add(moves);
		mPendingMoves.clear();
		Runnable mover = new Runnable() {
			@Override
			public void run() {
				for (MoveInfo moveInfo : moves) {
					animateMoveImpl(moveInfo.holder, moveInfo.fromX, moveInfo.fromY,
							moveInfo.toX, moveInfo.toY);
				}
				moves.clear();
				mMovesList.remove(moves);
			}
		};
		if (removalsPending) {
			View view = moves.get(0).holder.itemView;
			ViewCompat.postOnAnimationDelayed(view, mover, getRemoveDuration());
		} else {
			mover.run();
		}
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:FlexibleItemAnimator.java

示例2: runChangeAnimation

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void runChangeAnimation(boolean removalsPending, boolean changesPending) {
	// Change animation to run in parallel with move animations
	if (changesPending) {
		final ArrayList<ChangeInfo> changes = new ArrayList<>();
		changes.addAll(mPendingChanges);
		mChangesList.add(changes);
		mPendingChanges.clear();
		Runnable changer = new Runnable() {
			@Override
			public void run() {
				for (ChangeInfo change : changes) {
					animateChangeImpl(change);
				}
				changes.clear();
				mChangesList.remove(changes);
			}
		};
		if (removalsPending) {
			ViewHolder holder = changes.get(0).oldHolder;
			ViewCompat.postOnAnimationDelayed(holder.itemView, changer, getRemoveDuration());
		} else {
			changer.run();
		}
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:FlexibleItemAnimator.java

示例3: runAddAnimation

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void runAddAnimation(boolean removalsPending, boolean changesPending,
							 boolean movesPending, boolean additionsPending) {
	if (additionsPending) {
		final ArrayList<ViewHolder> additions = new ArrayList<>();
		// Sorting addition animations based on it's original layout position
		Collections.sort(mPendingAdditions, new Comparator<ViewHolder>() {
			@Override
			public int compare(ViewHolder vh1, ViewHolder vh2) {
				return vh1.getLayoutPosition() - vh2.getLayoutPosition();
			}
		});
		additions.addAll(mPendingAdditions);
		mAdditionsList.add(additions);
		mPendingAdditions.clear();
		Runnable adder = new Runnable() {
			public void run() {
				int index = 0;
				for (ViewHolder holder : additions) {
					doAnimateAdd(holder, index++);
				}
				additions.clear();
				mAdditionsList.remove(additions);
			}
		};
		if (removalsPending || movesPending || changesPending) {
			long removeDuration = removalsPending ? getRemoveDuration() : 0;
			long moveDuration = movesPending ? getMoveDuration() : 0;
			long changeDuration = changesPending ? getChangeDuration() : 0;
			long totalDelay = removeDuration + Math.max(moveDuration, changeDuration);
			View view = additions.get(0).itemView;
			ViewCompat.postOnAnimationDelayed(view, adder, totalDelay);
		} else {
			adder.run();
		}
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:FlexibleItemAnimator.java

示例4: startDelayed

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void startDelayed(long delayMillis) {
    View v = viewRef.get();
    if (v != null) {
        ViewCompat.postOnAnimationDelayed(v, this, delayMillis);
    }
}
 
开发者ID:xyzxqs,项目名称:XphotoView,代码行数:8,代码来源:ImageMatrixAnimator.java

示例5: startAnimating

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void startAnimating() {
    if (this.mRunnable == null) {
        this.mRunnable = new ScrollAnimationRunnable();
    }
    this.mAnimating = true;
    this.mNeedsReset = true;
    if (this.mAlreadyDelayed || this.mActivationDelay <= 0) {
        this.mRunnable.run();
    } else {
        ViewCompat.postOnAnimationDelayed(this.mTarget, this.mRunnable, (long) this.mActivationDelay);
    }
    this.mAlreadyDelayed = true;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:14,代码来源:AutoScrollHelper.java


注:本文中的android.support.v4.view.ViewCompat.postOnAnimationDelayed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。