/** Register a callback function. This callback function is called when the focus status in a view tree changes.
* Callback function to be added with the listener Parameter
* Exception illegalstateexception if isalive () returns false
*/
Public void addonglobalfocuschangelistener (viewtreeobserver. onglobalfocuschangelistener listener)
/** Registers a callback function. This callback function is called when the global layout of a view tree changes or the visual status of a view in the view tree changes.
* Callback function to be added with the listener Parameter
* Exception illegalstateexception if isalive () returns false
*/
Public void addongloballayoutlistener (viewtreeobserver. ongloballayoutlistener listener)
/** Register a callback function, which is called when a view tree is to be drawn.
* Callback function to be added with the listener Parameter
* Exception illegalstateexception if isalive () returns false
*/
Public void addonpredrawlistener (viewtreeobserver. onpredrawlistener listener)
/** Register a callback function, which is called when a view is rolled.
* Callback function to be added with the listener Parameter
* Exception illegalstateexception if isalive () returns false
*/
Public void addonscrollchangedlistener (viewtreeobserver. onscrollchangedlistener listener)
/** Register a callback function, which is called when the touch mode changes.
* Callback function to be added with the listener Parameter
* Exception illegalstateexception if isalive () returns false
*/
Public void addontouchmodechangelistener (viewtreeobserver. ontouchmodechangelistener listener)
// Notify the corresponding registration listener when the entire layout changes. If you force the view layout or a view that is not attached to a window or in the gone status, it can be manually called
Public final void dispatchongloballayout ()
/** Notify the corresponding registration listener when a view tree is to be drawn. If the listener returns true, the painting will be canceled and rescheduled. If you force a view layout or a view hierarchy that is not attached to a window, or in a gone state, it can be manually called
* If the current painting can be canceled and rescheduled, true is returned; otherwise, false is returned.
*/
Public final Boolean dispatchonpredraw ()
/** Indicates whether the current viewtreeobserver is available (alive ). When the observer is unavailable, any method call (except this method) will throw an exception. If an application maintains a long reference with viewtreeobserver, it always needs to detect the return value of this method before calling other methods.
* Return value. If this object is available, true is returned. Otherwise, false is returned.
*/
Public Boolean isalive ()
/** Remove the previously registered global layout callback function.
* Callback function with the victim parameter to be removed
* Exception illegalstateexception if isalive () returns false
*/
Public void removeglobalonlayoutlistener (viewtreeobserver. ongloballayoutlistener victim)
/** Remove the previously registered focus change callback function.
* Callback function with the victim parameter to be removed
* Exception illegalstateexception if isalive () returns false
*/
Public void removeonglobalfocuschangelistener (viewtreeobserver. onglobalfocuschangelistener victim)
/** Remove the previously registered pre-drawn callback function.
* Callback function with the victim parameter to be removed
* Exception illegalstateexception if isalive () returns false
*/
Public void removeonpredrawlistener (viewtreeobserver. onpredrawlistener victim)
/** Remove the previously registered rolling change callback function.
* Callback function with the victim parameter to be removed
* Exception illegalstateexception if isalive () returns false
*/
Public void removeonscrollchangedlistener (viewtreeobserver. onscrollchangedlistener victim)
/** Remove the previously registered touch mode change callback function
* Callback function with the victim parameter to be removed
* Exception illegalstateexception if isalive () returns false
*/
Public void removeontouchmodechangelistener (viewtreeobserver. ontouchmodechangelistener victim)
overview of viewtreeobserver