Skip to content

Instantly share code, notes, and snippets.

@Dimezis
Created March 28, 2019 21:27
Show Gist options
  • Save Dimezis/900ffe1b1c68b13610b54ed0ceb93027 to your computer and use it in GitHub Desktop.
Save Dimezis/900ffe1b1c68b13610b54ed0ceb93027 to your computer and use it in GitHub Desktop.
@Override
public void onDescendantInvalidated(@NonNull View child, @NonNull View descendant) {
if ((descendant.mPrivateFlags & PFLAG_DRAW_ANIMATION) != 0) {
mIsAnimating = true;
}
invalidate();
}
void invalidate() {
mDirty.set(0, 0, mWidth, mHeight);
if (!mWillDrawSoon) {
scheduleTraversals();
}
}
void scheduleTraversals() {
if (!mTraversalScheduled) {
mTraversalScheduled = true;
mTraversalBarrier = mHandler.getLooper().getQueue().postSyncBarrier();
mChoreographer.postCallback(
Choreographer.CALLBACK_TRAVERSAL, mTraversalRunnable, null);
if (!mUnbufferedInputDispatch) {
scheduleConsumeBatchedInput();
}
notifyRendererOfFramePending();
pokeDrawLockIfNeeded();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment