View measurement optimization
If a view hasn't explicitly requested layout and it's asked to measure
with MeasureSpec.EXACTLY in both dimensions and sizes that match its
current measured size, the measure operation is a no-op.
This helps out a number of ViewGroups that perform initial speculative
measurements with AT_MOST or UNSPECIFIED followed by looping over
child views and measuring EXACTLY to lock in the final measurement
with perhaps some extra leftover space distributed. In practice this
happens a fair bit, especially for views high up in the view
hierarchy. This optimization allows ViewGroup measurement code to be a
little cleaner in not having to keep track of this on its own.
Change-Id: I88ff46a7d37aeda7a4cd16204b68cab0d051b341
1 file changed