Of course not. We can see the code in ViewRootImpl
void invalidate() { mDirty.set(0, 0, mWidth, mHeight); if (!mWillDrawSoon) { scheduleTraversals(); } }
nullify the set dirty area and call scheduleTraversals, it will call doTraversal.
void doTraversal() { if (mTraversalScheduled) { mTraversalScheduled = false; mHandler.getLooper().getQueue().removeSyncBarrier(mTraversalBarrier); if (mProfile) { Debug.startMethodTracing("ViewAncestor"); } performTraversals(); if (mProfile) { Debug.stopMethodTracing(); mProfile = false; } } }
we can see the mTraversalScheduled flag in the code, if we plan to move, invalidate events triggerd, mTraversalScheduled is false in doTraversal, so the method will return directly. Therefore, NOT every invalid event called performTravel, NOT every invalid event called redraw
source share