Add View methods isAttachedToWindow and hasLayout
isAttachedToWindow does what it says on the label and provides a standard, public API for checking a view's attachment state. This removes the need for tracking this out of band in response to onAttachedToWindow/onDetachedFromWindow in custom view implementations. hasLayout returns true whenever the view has been through at least one call to layout() since the last time it was attached to or detached from a window. This allows for standard checks in code that needs to behave differently if first layout has not completed yet, such as whether or not to no-op an animation in order to set up initial state. Change-Id: I8dab70dcd5a22a32e260ed50987ccdaa4100072b
Loading
Please register or sign in to comment