@Override public void onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state) { if (parent.isAnimating()) return; final int childCount = parent.getChildCount(); final RecyclerView.LayoutManager lm = parent.getLayoutManager(); for (int i = 0; i < childCount; i++) { final View child = parent.getChildAt(i); RecyclerView.ViewHolder viewHolder = parent.getChildViewHolder(child); if (requiresDivider(viewHolder)) { final int right = lm.getDecoratedRight(child); final int bottom = lm.getDecoratedBottom(child); // draw the bottom divider canvas.drawRect(lm.getDecoratedLeft(child), bottom - dividerSize, right, bottom, paint); // draw the right edge divider canvas.drawRect(right - dividerSize, lm.getDecoratedTop(child), right, bottom - dividerSize, paint); } } }
/** * Returns true if wrapped RecyclerView is currently running some animations. * <p> * If you want to be notified when animations are finished, use * {@link RecyclerView.ItemAnimator#isRunning(RecyclerView.ItemAnimator.ItemAnimatorFinishedListener)}. * * @return True if there are some item animations currently running or waiting to be started. */ @SuppressWarnings("unused") public final boolean isAnimating() { return getRvCategories().isAnimating(); }
@Override public boolean isIdleNow() { if (!mRecyclerView.isAnimating()) { if (mCallback != null) { mCallback.onTransitionToIdle(); } return true; } else { return false; } }
data.put("HasNestedScrollingParent", rv.hasNestedScrollingParent()); data.put("HasPendingAdapterUpdates", rv.hasPendingAdapterUpdates()); data.put("IsAnimating", rv.isAnimating()); data.put("IsAttachedToWindow", rv.isAttachedToWindow()); data.put("IsComputingLayout", rv.isComputingLayout());