|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.ViewTreeObserver
public final class ViewTreeObserver
A view tree observer is used to register listeners that can be notified of global
changes in the view tree. Such global events include, but are not limited to,
layout of the whole tree, beginning of the drawing pass, touch mode change....
A ViewTreeObserver should never be instantiated by applications as it is provided
by the views hierarchy. Refer to View.getViewTreeObserver()
for more information.
| Nested Class Summary | |
|---|---|
static interface |
ViewTreeObserver.OnGlobalFocusChangeListener
Interface definition for a callback to be invoked when the focus state within the view tree changes. |
static interface |
ViewTreeObserver.OnGlobalLayoutListener
Interface definition for a callback to be invoked when the global layout state or the visibility of views within the view tree changes. |
static interface |
ViewTreeObserver.OnPreDrawListener
Interface definition for a callback to be invoked when the view tree is about to be drawn. |
static interface |
ViewTreeObserver.OnTouchModeChangeListener
Interface definition for a callback to be invoked when the touch mode changes. |
| Constructor Summary | |
|---|---|
ViewTreeObserver()
Creates a new ViewTreeObserver. |
|
| Method Summary | |
|---|---|
void |
addOnGlobalFocusChangeListener(ViewTreeObserver.OnGlobalFocusChangeListener listener)
Register a callback to be invoked when the focus state within the view tree changes. |
void |
addOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener)
Register a callback to be invoked when the global layout state or the visibility of views within the view tree changes |
void |
addOnPreDrawListener(ViewTreeObserver.OnPreDrawListener listener)
Register a callback to be invoked when the view tree is about to be drawn |
void |
addOnTouchModeChangeListener(ViewTreeObserver.OnTouchModeChangeListener listener)
Register a callback to be invoked when the invoked when the touch mode changes. |
(package private) void |
dispatchOnGlobalFocusChange(View oldFocus,
View newFocus)
Notifies registered listeners that focus has changed. |
void |
dispatchOnGlobalLayout()
Notifies registered listeners that a global layout happened. |
boolean |
dispatchOnPreDraw()
Notifies registered listeners that the drawing pass is about to start. |
(package private) void |
dispatchOnTouchModeChanged(boolean inTouchMode)
Notifies registered listeners that the touch mode has changed. |
boolean |
isAlive()
Indicates whether this ViewTreeObserver is alive. |
(package private) void |
merge(ViewTreeObserver observer)
Merges all the listeners registered on the specified observer with the listeners registered on this object. |
void |
removeGlobalOnLayoutListener(ViewTreeObserver.OnGlobalLayoutListener victim)
Remove a previously installed global layout callback |
void |
removeOnGlobalFocusChangeListener(ViewTreeObserver.OnGlobalFocusChangeListener victim)
Remove a previously installed focus change callback. |
void |
removeOnPreDrawListener(ViewTreeObserver.OnPreDrawListener victim)
Remove a previously installed pre-draw callback |
void |
removeOnTouchModeChangeListener(ViewTreeObserver.OnTouchModeChangeListener victim)
Remove a previously installed touch mode change callback |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
ViewTreeObserver()
| Method Detail |
|---|
void merge(ViewTreeObserver observer)
isAlive() and should not be used anymore.
observer - The ViewTreeObserver whose listeners must be added to this observerpublic void addOnGlobalFocusChangeListener(ViewTreeObserver.OnGlobalFocusChangeListener listener)
listener - The callback to add
IllegalStateException - If isAlive() returns falsepublic void removeOnGlobalFocusChangeListener(ViewTreeObserver.OnGlobalFocusChangeListener victim)
victim - The callback to remove
IllegalStateException - If isAlive() returns falseaddOnGlobalFocusChangeListener(OnGlobalFocusChangeListener)public void addOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener listener)
listener - The callback to add
IllegalStateException - If isAlive() returns falsepublic void removeGlobalOnLayoutListener(ViewTreeObserver.OnGlobalLayoutListener victim)
victim - The callback to remove
IllegalStateException - If isAlive() returns falseaddOnGlobalLayoutListener(OnGlobalLayoutListener)public void addOnPreDrawListener(ViewTreeObserver.OnPreDrawListener listener)
listener - The callback to add
IllegalStateException - If isAlive() returns falsepublic void removeOnPreDrawListener(ViewTreeObserver.OnPreDrawListener victim)
victim - The callback to remove
IllegalStateException - If isAlive() returns falseaddOnPreDrawListener(OnPreDrawListener)public void addOnTouchModeChangeListener(ViewTreeObserver.OnTouchModeChangeListener listener)
listener - The callback to add
IllegalStateException - If isAlive() returns falsepublic void removeOnTouchModeChangeListener(ViewTreeObserver.OnTouchModeChangeListener victim)
victim - The callback to remove
IllegalStateException - If isAlive() returns falseaddOnTouchModeChangeListener(OnTouchModeChangeListener)public boolean isAlive()
final void dispatchOnGlobalFocusChange(View oldFocus,
View newFocus)
public final void dispatchOnGlobalLayout()
public final boolean dispatchOnPreDraw()
final void dispatchOnTouchModeChanged(boolean inTouchMode)
inTouchMode - True if the touch mode is now enabled, false otherwise.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||