Created
March 28, 2019 21:27
-
-
Save Dimezis/900ffe1b1c68b13610b54ed0ceb93027 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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