|
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.os.Handler
android.view.ViewRoot
final class ViewRoot
The top of a view hierarchy, implementing the needed protocol between View
and the WindowManager. This is for the most part an internal implementation
detail of WindowManagerImpl.
| Nested Class Summary | |
|---|---|
static class |
ViewRoot.CalledFromWrongThreadException
|
(package private) static class |
ViewRoot.RunQueue
|
(package private) static class |
ViewRoot.TrackballAxis
Maintains state information for a single trackball axis, generating discrete (DPAD) movements based on raw trackball motion. |
(package private) static class |
ViewRoot.W
|
| Field Summary | |
|---|---|
(package private) int |
mAddNesting
|
(package private) static int |
MAX_TRACKBALL_DELAY
Maximum time we allow the user to roll the trackball enough to generate a key event, before resetting the counters. |
(package private) ViewRoot.W |
mWindow
|
(package private) static boolean |
PROFILE_DRAWING
|
(package private) static ViewRoot.RunQueue |
sRunQueue
|
(package private) static ThreadLocal<Handler> |
sUiThreads
|
| Constructor Summary | |
|---|---|
ViewRoot()
|
|
| Method Summary | |
|---|---|
void |
bringChildToFront(View child)
Change the z order of the child so it's on top of all other children |
(package private) void |
checkThread()
|
void |
childDrawableStateChanged(View child)
This method is called on the parent when a child's drawable state has changed. |
void |
clearChildFocus(View child)
Called when a child of this parent is giving up focus |
void |
createContextMenu(ContextMenu menu)
Have the parent populate the specified context menu if it has anything to add (and then recurse on its parent). |
void |
debug()
|
void |
die(boolean immediate)
|
void |
dispatchAppVisibility(boolean visible)
|
(package private) void |
dispatchDetachedFromWindow()
|
void |
dispatchGetNewSurface()
|
void |
dispatchKey(KeyEvent event)
|
void |
dispatchPointer(MotionEvent event,
long eventTime)
|
void |
dispatchResized(int w,
int h,
boolean reportDraw)
|
void |
dispatchTrackball(MotionEvent event,
long eventTime)
|
(package private) boolean |
ensureTouchMode(boolean inTouchMode)
Something in the current window tells us we need to change the touch mode. |
protected void |
finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. |
void |
focusableViewAvailable(View v)
Tells the parent that a new focusable view has become available. |
View |
focusSearch(View focused,
int direction)
Find the nearest view in the specified direction that wants to take focus |
boolean |
getChildVisibleRect(View child,
Rect r,
Point offset)
|
(package private) int |
getHostVisibility()
|
static long |
getInstanceCount()
|
(package private) WindowLeaked |
getLocation()
|
ViewParent |
getParent()
Returns the parent if it exists, or null. |
View |
getView()
|
protected Rect |
getWindowFrame()
|
(package private) void |
handleAppVisibility(boolean visible)
|
(package private) void |
handleGetNewSurface()
|
void |
handleMessage(Message msg)
Subclasses must implement this to receive messages. |
void |
invalidateChild(View child,
Rect dirty)
All or part of a child is dirty and needs to be redrawn. |
ViewParent |
invalidateChildInParent(int[] location,
Rect dirty)
All or part of a child is dirty and needs to be redrawn. |
(package private) static boolean |
isDirectional(int keyCode)
|
(package private) static boolean |
isInTouchMode()
Indicates whether we are in touch mode. |
boolean |
isLayoutRequested()
Indicates whether layout was requested on this view parent. |
void |
playSoundEffect(int effectId)
|
void |
profile()
Call this to profile the next traversal call. |
void |
recomputeViewAttributes(View child)
Tell view hierarchy that the global view attributes need to be re-evaluated. |
void |
requestChildFocus(View child,
View focused)
Called when a child of this parent wants focus |
void |
requestDisallowInterceptTouchEvent(boolean disallowIntercept)
Called when a child does not want this parent and its ancestors to intercept touch events with ViewGroup.onInterceptTouchEvent(MotionEvent). |
void |
requestLayout()
Called when something has changed which has invalidated the layout of a child of this view parent. |
void |
requestTransparentRegion(View child)
Called when a child wants the view hierarchy to gather and report transparent regions to the window compositor. |
void |
scheduleTraversals()
|
void |
setLayoutParams(WindowManager.LayoutParams attrs)
|
void |
setView(View view,
WindowManager.LayoutParams attrs,
View panelParentView)
We have one child |
boolean |
showContextMenuForChild(View originalView)
Bring up a context menu for the specified view or its ancestors. |
void |
unscheduleTraversals()
|
void |
windowFocusChanged(boolean hasFocus,
boolean inTouchMode)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final boolean PROFILE_DRAWING
static final int MAX_TRACKBALL_DELAY
static final ThreadLocal<Handler> sUiThreads
static final ViewRoot.RunQueue sRunQueue
final ViewRoot.W mWindow
int mAddNesting
| Constructor Detail |
|---|
public ViewRoot()
| Method Detail |
|---|
protected void finalize()
throws Throwable
ObjectNote: The virtual machine assumes that the implementation in class Object is empty.
finalize in class ObjectThrowable - The virtual machine ignores any exceptions which are
thrown during finalization.public static long getInstanceCount()
public void profile()
static boolean isInTouchMode()
public void setView(View view,
WindowManager.LayoutParams attrs,
View panelParentView)
public View getView()
final WindowLeaked getLocation()
public void setLayoutParams(WindowManager.LayoutParams attrs)
void handleAppVisibility(boolean visible)
void handleGetNewSurface()
public void requestLayout()
requestLayout in interface ViewParentpublic boolean isLayoutRequested()
isLayoutRequested in interface ViewParent
public void invalidateChild(View child,
Rect dirty)
ViewParent
invalidateChild in interface ViewParentchild - The child which is dirtydirty - The area within the child that is invalidpublic ViewParent getParent()
ViewParent
getParent in interface ViewParent
public ViewParent invalidateChildInParent(int[] location,
Rect dirty)
ViewParent
invalidateChildInParent in interface ViewParentlocation - An array of 2 ints containing the left and top
coordinates of the child to invalidatedirty - The area within the child that is invalid
public boolean getChildVisibleRect(View child,
Rect r,
Point offset)
getChildVisibleRect in interface ViewParentpublic void bringChildToFront(View child)
ViewParent
bringChildToFront in interface ViewParentpublic void scheduleTraversals()
public void unscheduleTraversals()
int getHostVisibility()
public void requestTransparentRegion(View child)
ViewParent
requestTransparentRegion in interface ViewParentchild - the view requesting the transparent region computation
public void requestChildFocus(View child,
View focused)
ViewParent
requestChildFocus in interface ViewParentchild - The child of this ViewParent that wants focus. This view
will contain the focused view. It is not necessarily the view that
actually has focus.focused - The view that is a descendant of child that actually has
focuspublic void clearChildFocus(View child)
ViewParent
clearChildFocus in interface ViewParentchild - The view that is giving up focuspublic void focusableViewAvailable(View v)
ViewParent
focusableViewAvailable in interface ViewParentv - The view that has become newly focusablepublic void recomputeViewAttributes(View child)
ViewParent
recomputeViewAttributes in interface ViewParentchild - View whose attributes have changed.void dispatchDetachedFromWindow()
public void handleMessage(Message msg)
Handler
handleMessage in class Handlerboolean ensureTouchMode(boolean inTouchMode)
inTouchMode - Whether we want to be in touch mode.
static boolean isDirectional(int keyCode)
keyCode - The key code
public void playSoundEffect(int effectId)
playSoundEffect in interface View.AttachInfo.SoundEffectPlayer
public View focusSearch(View focused,
int direction)
focusSearch in interface ViewParentfocused - The view that currently has focusdirection - One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHTpublic void debug()
public void die(boolean immediate)
public void dispatchResized(int w,
int h,
boolean reportDraw)
public void dispatchKey(KeyEvent event)
public void dispatchPointer(MotionEvent event,
long eventTime)
public void dispatchTrackball(MotionEvent event,
long eventTime)
public void dispatchAppVisibility(boolean visible)
public void dispatchGetNewSurface()
public void windowFocusChanged(boolean hasFocus,
boolean inTouchMode)
public boolean showContextMenuForChild(View originalView)
ViewParent
In most cases, a subclass does not need to override this. However, if
the subclass is added directly to the window manager (for example,
ViewManager.addView(View, android.view.ViewGroup.LayoutParams))
then it should override this and show the context menu.
showContextMenuForChild in interface ViewParentoriginalView - The source view where the context menu was first invoked
public void createContextMenu(ContextMenu menu)
ViewParent
createContextMenu in interface ViewParentmenu - The menu to populatepublic void childDrawableStateChanged(View child)
ViewParent
childDrawableStateChanged in interface ViewParentchild - The child whose drawable state has changed.protected Rect getWindowFrame()
void checkThread()
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept)
ViewParentViewGroup.onInterceptTouchEvent(MotionEvent).
This parent should pass this call onto its parents. This parent must obey this request for the duration of the touch (that is, only clear the flag after this parent has received an up or a cancel.
requestDisallowInterceptTouchEvent in interface ViewParentdisallowIntercept - True if the child does not want the parent to
intercept touch events.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||