First, thank for the article. A question though:

> So you delegate the animation to the next frame and cross your fingers that the view will be ready.

I believe postDelayed() doesn’t mean “perform this thing on next frame”. By reading the post I got an impression, that you claim, that postDelayed() gives us a guarantee that an action will be performed on the next frame, which I believe is not quite correct statement. Instead, it will simply add a Message to a MessageQueue . Layout inflation might also be considered as set ofMessage s that are post ed on MessageQueue . What this boils down to is following: if you are postDelay ing a Message then you have a guarantee that it will be executed *after* layout hierarchy has been laid out, which in turn means, that in the Runnable of postDelayed you have a guarantee, that the view has successfully been laid out and its sizes are able to be retrieved.

Let me know if I’m missing something.

Android enthusiast, Google Certified Android developer, Stackoverflower

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store