@Override public void onViewAttachedToWindow(@NonNull final View v) { mIsAttached = true; ViewCompat.postOnAnimation(v, new Runnable() { @Override public void run() { if (mIsAttached && mDrawable != null) { v.invalidateDrawable(mDrawable); ViewCompat.postOnAnimation(v, this); } } }); }
public void start() { if (mStarted) { return; } final RecyclerViewDragDropManager holder = mHolderRef.get(); if (holder == null) { return; } final RecyclerView rv = holder.getRecyclerView(); if (rv == null) { return; } ViewCompat.postOnAnimation(rv, this); mStarted = true; }
@Override public void run() { final RecyclerViewDragDropManager holder = mHolderRef.get(); if (holder == null) { return; } if (!mStarted) { return; } // call scrolling process holder.handleScrollOnDragging(); // re-schedule the process final RecyclerView rv = holder.getRecyclerView(); if (rv != null && mStarted) { ViewCompat.postOnAnimation(rv, this); } else { mStarted = false; } } }
@Override public void run() { if (mSelected != null && scrollIfNecessary()) { if (mSelected != null) { //it might be lost during scrolling moveIfNecessary(mSelected); } mRecyclerView.removeCallbacks(mScrollRunnable); ViewCompat.postOnAnimation(mRecyclerView, this); } } };
ViewCompat.postOnAnimation(mRecyclerView, mCheckItemSwappingRunnable);
ViewCompat.postOnAnimation(this, mEndScrollRunnable); } else { mEndScrollRunnable.run();
private void postOnAnimation() { if (mEatRunOnAnimationRequest) { mReSchedulePostAnimationCallback = true; } else { mView.removeCallbacks(this); ViewCompat.postOnAnimation(mView, this); } }
public void setScrollDir(int dir) { if (mScrollDir == dir) return; if (dir != 0 && mScrollDir == 0) ViewCompat.postOnAnimation(mRecyclerView, this); mScrollDir = dir; mPrevTime = AnimationUtils.currentAnimationTimeMillis(); }
private void postOnAnimation() { if (mEatRunOnAnimationRequest) { mReSchedulePostAnimationCallback = true; } else { mView.removeCallbacks(this); ViewCompat.postOnAnimation(mView, this); } }
private void postOnAnimation() { if (mEatRunOnAnimationRequest) { mReSchedulePostAnimationCallback = true; } else { if (mRecyclerView == null) return; mRecyclerView.removeCallbacks(this); ViewCompat.postOnAnimation(mRecyclerView, this); } }
private void notifyComputeTagEnded() { ViewCompat.postOnAnimation(this, () -> { int count = mComputeTagCallbacks.size(); for (int i = count - 1; i >= 0; i--) { mComputeTagCallbacks.get(i).onComputedTagEnded(); mComputeTagCallbacks.remove(i); } }); }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void enterReveal() { if (AndroidHelper.isLollipopOrGreater()) { ViewCompat.postOnAnimation(mBinding.toolbar, new RevealAnimationRunnable(mBinding.toolbar, mBinding.searchView, true)); } }
private void notifyTagCreated(final Tag tag) { ViewCompat.postOnAnimation(this, () -> { Tag copy = tag.copy(); for (OnTagEventListener cb : mTagEventCallBacks) { cb.onTagCreate(copy); } }); }
private void notifyTagRemoved(final Tag tag) { ViewCompat.postOnAnimation(this, () -> { Tag copy = tag.copy(); for (OnTagEventListener cb : mTagEventCallBacks) { cb.onTagRemove(copy); } }); }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void exitReveal() { if (!AndroidHelper.isLollipopOrGreater()) { finish(); return; } ViewCompat.postOnAnimation(mBinding.toolbar, new RevealAnimationRunnable(mBinding.toolbar, mBinding.searchView, false)); }
@Override public void run() { if (mScrollDir == 0) return; long now = AnimationUtils.currentAnimationTimeMillis(); float delta = (now - mPrevTime) * 0.001f; mPrevTime = now; mRecyclerView.scrollBy(0, (int) (delta * mAutoscrollAmount * mScrollDir)); if (mScrolledListener != null) mScrolledListener.onScrolled(mScrollDir); ViewCompat.postOnAnimation(mRecyclerView, this); }