Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TextInputLayout] Fix onMeasure() infinite loop bug caused by posting…
… requestLayout() before endLayout is fully rendered. Brief explanation: in TextInputLayout#onMeasure, TextInputLayout will try to send a post to trigger requestLayout() method based on the boolean value returned from updateDummyDrawbles() method, but in shouldUpdateEndDummyDrawable(), we try to get the endLayout.getMeasureWidth() which is not reliable, if the endLayout hasn't rendered fully, the getMeasureWidth() will return 0 making the updateDummyDrawables() to return TRUE to trigger requestLayout() in an infinite loop. To fix this issue, we need to introduce ViewTreeObserver to help us to run posing the requstLayout() after endLayout/startLayout is fully rendered. PiperOrigin-RevId: 571765829
- Loading branch information