android.support.v7.widget.RecyclerView.ItemAnimator Java Examples
The following examples show how to use
android.support.v7.widget.RecyclerView.ItemAnimator.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ItemTouchHelper.java From letv with Apache License 2.0 | 5 votes |
private void postDispatchSwipe(final RecoverAnimation anim, final int swipeDir) { this.mRecyclerView.post(new Runnable() { public void run() { if (ItemTouchHelper.this.mRecyclerView != null && ItemTouchHelper.this.mRecyclerView.isAttachedToWindow() && !anim.mOverridden && anim.mViewHolder.getAdapterPosition() != -1) { ItemAnimator animator = ItemTouchHelper.this.mRecyclerView.getItemAnimator(); if ((animator == null || !animator.isRunning(null)) && !ItemTouchHelper.this.hasRunningRecoverAnim()) { ItemTouchHelper.this.mCallback.onSwiped(anim.mViewHolder, swipeDir); } else { ItemTouchHelper.this.mRecyclerView.post(this); } } } }); }
Example #2
Source File: ItemTouchHelper.java From letv with Apache License 2.0 | 4 votes |
public long getAnimationDuration(RecyclerView recyclerView, int animationType, float animateDx, float animateDy) { ItemAnimator itemAnimator = recyclerView.getItemAnimator(); return itemAnimator == null ? animationType == 8 ? 200 : 250 : animationType == 8 ? itemAnimator.getMoveDuration() : itemAnimator.getRemoveDuration(); }