IT. Expert System.

Android Reference

ViewRootImpl


android.view

Class ViewRootImpl

  • All Implemented Interfaces:
    ViewParent


    public final class ViewRootImpl
    extends Object
    implements ViewParent
    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 WindowManagerGlobal.
    • Field Detail

      • mInputEventConsistencyVerifier

        protected final InputEventConsistencyVerifier mInputEventConsistencyVerifier
        Consistency verifier for debugging purposes.
    • Constructor Detail

    • Method Detail

      • addFirstDrawHandler

        public static void addFirstDrawHandler(Runnable callback)
      • profile

        public void profile()
        Call this to profile the next traversal call. FIXME for perf testing only. Remove eventually
      • attachFunctor

        public boolean attachFunctor(int functor)
      • detachFunctor

        public void detachFunctor(int functor)
      • getView

        public View getView()
      • requestLayout

        public void requestLayout()
        Description copied from interface: ViewParent
        Called when something has changed which has invalidated the layout of a child of this view parent. This will schedule a layout pass of the view tree.
        Specified by:
        requestLayout in interface ViewParent
      • isLayoutRequested

        public boolean isLayoutRequested()
        Description copied from interface: ViewParent
        Indicates whether layout was requested on this view parent.
        Specified by:
        isLayoutRequested in interface ViewParent
        Returns:
        true if layout was requested, false otherwise
      • invalidateChild

        public void invalidateChild(View child,
                           Rect dirty)
        Description copied from interface: ViewParent
        All or part of a child is dirty and needs to be redrawn.
        Specified by:
        invalidateChild in interface ViewParent
        Parameters:
        child - The child which is dirty
        dirty - The area within the child that is invalid
      • invalidateChildInParent

        public ViewParent invalidateChildInParent(int[] location,
                                         Rect dirty)
        Description copied from interface: ViewParent
        All or part of a child is dirty and needs to be redrawn.

        The location array is an array of two int values which respectively define the left and the top position of the dirty child.

        This method must return the parent of this ViewParent if the specified rectangle must be invalidated in the parent. If the specified rectangle does not require invalidation in the parent or if the parent does not exist, this method must return null.

        When this method returns a non-null value, the location array must have been updated with the left and top coordinates of this ViewParent.

        Specified by:
        invalidateChildInParent in interface ViewParent
        Parameters:
        location - An array of 2 ints containing the left and top coordinates of the child to invalidate
        dirty - The area within the child that is invalid
        Returns:
        the parent of this ViewParent or null
      • getParent

        public ViewParent getParent()
        Description copied from interface: ViewParent
        Returns the parent if it exists, or null.
        Specified by:
        getParent in interface ViewParent
        Returns:
        a ViewParent or null if this ViewParent does not have a parent
      • getChildVisibleRect

        public boolean getChildVisibleRect(View child,
                                  Rect r,
                                  Point offset)
        Description copied from interface: ViewParent
        Compute the visible part of a rectangular region defined in terms of a child view's coordinates.

        Returns the clipped visible part of the rectangle r, defined in the child's local coordinate system. r is modified by this method to contain the result, expressed in the global (root) coordinate system.

        The resulting rectangle is always axis aligned. If a rotation is applied to a node in the View hierarchy, the result is the axis-aligned bounding box of the visible rectangle.

        Specified by:
        getChildVisibleRect in interface ViewParent
        Parameters:
        child - A child View, whose rectangular visible region we want to compute
        r - The input rectangle, defined in the child coordinate system. Will be overwritten to contain the resulting visible rectangle, expressed in global (root) coordinates
        offset - The input coordinates of a point, defined in the child coordinate system. As with the r parameter, this will be overwritten to contain the global (root) coordinates of that point. A null value is valid (in case you are not interested in this result)
        Returns:
        true if the resulting rectangle is not empty, false otherwise
      • bringChildToFront

        public void bringChildToFront(View child)
        Description copied from interface: ViewParent
        Change the z order of the child so it's on top of all other children
        Specified by:
        bringChildToFront in interface ViewParent
      • requestTransitionStart

        public void requestTransitionStart(LayoutTransition transition)
        Add LayoutTransition to the list of transitions to be started in the next traversal. This list will be cleared after the transitions on the list are start()'ed. These transitionsa re added by LayoutTransition itself when it sets up animations. The setup happens during the layout phase of traversal, which we want to complete before any of the animations are started (because those animations may side-effect properties that layout depends upon, like the bounding rectangles of the affected views). So we add the transition to the list and it is started just prior to starting the drawing phase of traversal.
        Parameters:
        transition - The LayoutTransition to be started on the next traversal.
      • requestTransparentRegion

        public void requestTransparentRegion(View child)
        Description copied from interface: ViewParent
        Called when a child wants the view hierarchy to gather and report transparent regions to the window compositor. Views that "punch" holes in the view hierarchy, such as SurfaceView can use this API to improve performance of the system. When no such a view is present in the hierarchy, this optimization in unnecessary and might slightly reduce the view hierarchy performance.
        Specified by:
        requestTransparentRegion in interface ViewParent
        Parameters:
        child - the view requesting the transparent region computation
      • onHardwarePreDraw

        public void onHardwarePreDraw(HardwareCanvas canvas)
        Invoked before a view is drawn by a hardware renderer.
        Parameters:
        canvas - The Canvas used to render the view.
      • onHardwarePostDraw

        public void onHardwarePostDraw(HardwareCanvas canvas)
        Invoked after a view is drawn by a hardware renderer.
        Parameters:
        canvas - The Canvas used to render the view.
      • getAccessibilityFocusedHost

        public View getAccessibilityFocusedHost()
      • requestChildFocus

        public void requestChildFocus(View child,
                             View focused)
        Description copied from interface: ViewParent
        Called when a child of this parent wants focus
        Specified by:
        requestChildFocus in interface ViewParent
        Parameters:
        child - 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 focus
      • clearChildFocus

        public void clearChildFocus(View child)
        Description copied from interface: ViewParent
        Called when a child of this parent is giving up focus
        Specified by:
        clearChildFocus in interface ViewParent
        Parameters:
        child - The view that is giving up focus
      • getParentForAccessibility

        public ViewParent getParentForAccessibility()
        Description copied from interface: ViewParent
        Gets the parent of a given View for accessibility. Since some Views are not exposed to the accessibility layer the parent for accessibility is not necessarily the direct parent of the View, rather it is a predecessor.
        Specified by:
        getParentForAccessibility in interface ViewParent
        Returns:
        The parent or null if no such is found.
      • focusableViewAvailable

        public void focusableViewAvailable(View v)
        Description copied from interface: ViewParent
        Tells the parent that a new focusable view has become available. This is to handle transitions from the case where there are no focusable views to the case where the first focusable view appears.
        Specified by:
        focusableViewAvailable in interface ViewParent
        Parameters:
        v - The view that has become newly focusable
      • recomputeViewAttributes

        public void recomputeViewAttributes(View child)
        Description copied from interface: ViewParent
        Tell view hierarchy that the global view attributes need to be re-evaluated.
        Specified by:
        recomputeViewAttributes in interface ViewParent
        Parameters:
        child - View whose attributes have changed.
      • isViewDescendantOf

        public static boolean isViewDescendantOf(View child,
                                 View parent)
        Return true if child is an ancestor of parent, (or equal to the parent).
      • handleDispatchSystemUiVisibilityChanged

        public void handleDispatchSystemUiVisibilityChanged(android.view.ViewRootImpl.SystemUiVisibilityInfo args)
      • handleDispatchDoneAnimating

        public void handleDispatchDoneAnimating()
      • getLastTouchPoint

        public void getLastTouchPoint(Point outLocation)
      • setDragFocus

        public void setDragFocus(View newDragTarget)
      • getAccessibilityInteractionController

        public android.view.AccessibilityInteractionController getAccessibilityInteractionController()
      • playSoundEffect

        public void playSoundEffect(int effectId)
      • performHapticFeedback

        public boolean performHapticFeedback(int effectId,
                                    boolean always)
      • focusSearch

        public View focusSearch(View focused,
                       int direction)
        Find the nearest view in the specified direction that wants to take focus
        Specified by:
        focusSearch in interface ViewParent
        Parameters:
        focused - The view that currently has focus
        direction - One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHT
      • debug

        public void debug()
      • dumpGfxInfo

        public void dumpGfxInfo(int[] info)
      • die

        public void die(boolean immediate)
      • requestUpdateConfiguration

        public void requestUpdateConfiguration(Configuration config)
      • loadSystemProperties

        public void loadSystemProperties()
      • dispatchFinishInputConnection

        public void dispatchFinishInputConnection(InputConnection connection)
      • dispatchResized

        public void dispatchResized(Rect frame,
                           Rect contentInsets,
                           Rect visibleInsets,
                           boolean reportDraw,
                           Configuration newConfig)
      • dispatchMoved

        public void dispatchMoved(int newX,
                         int newY)
      • dispatchInvalidateDelayed

        public void dispatchInvalidateDelayed(View view,
                                     long delayMilliseconds)
      • dispatchInvalidateRectDelayed

        public void dispatchInvalidateRectDelayed(android.view.View.AttachInfo.InvalidateInfo info,
                                         long delayMilliseconds)
      • dispatchInvalidateOnAnimation

        public void dispatchInvalidateOnAnimation(View view)
      • dispatchInvalidateRectOnAnimation

        public void dispatchInvalidateRectOnAnimation(android.view.View.AttachInfo.InvalidateInfo info)
      • enqueueDisplayList

        public void enqueueDisplayList(DisplayList displayList)
      • dequeueDisplayList

        public void dequeueDisplayList(DisplayList displayList)
      • cancelInvalidate

        public void cancelInvalidate(View view)
      • dispatchKey

        public void dispatchKey(KeyEvent event)
      • dispatchKeyFromIme

        public void dispatchKeyFromIme(KeyEvent event)
      • dispatchUnhandledKey

        public void dispatchUnhandledKey(KeyEvent event)
      • dispatchAppVisibility

        public void dispatchAppVisibility(boolean visible)
      • dispatchScreenStateChange

        public void dispatchScreenStateChange(boolean on)
      • dispatchGetNewSurface

        public void dispatchGetNewSurface()
      • windowFocusChanged

        public void windowFocusChanged(boolean hasFocus,
                              boolean inTouchMode)
      • dispatchCloseSystemDialogs

        public void dispatchCloseSystemDialogs(String reason)
      • dispatchDragEvent

        public void dispatchDragEvent(DragEvent event)
      • dispatchSystemUiVisibilityChanged

        public void dispatchSystemUiVisibilityChanged(int seq,
                                             int globalVisibility,
                                             int localValue,
                                             int localChanges)
      • dispatchDoneAnimating

        public void dispatchDoneAnimating()
      • dispatchCheckFocus

        public void dispatchCheckFocus()
      • showContextMenuForChild

        public boolean showContextMenuForChild(View originalView)
        Description copied from interface: ViewParent
        Bring up a context menu for the specified view or its ancestors.

        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.

        Specified by:
        showContextMenuForChild in interface ViewParent
        Parameters:
        originalView - The source view where the context menu was first invoked
        Returns:
        true if a context menu was displayed
      • startActionModeForChild

        public ActionMode startActionModeForChild(View originalView,
                                         ActionMode.Callback callback)
        Description copied from interface: ViewParent
        Start an action mode for the specified view.

        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 start the action mode.

        Specified by:
        startActionModeForChild in interface ViewParent
        Parameters:
        originalView - The source view where the action mode was first invoked
        callback - The callback that will handle lifecycle events for the action mode
        Returns:
        The new action mode if it was started, null otherwise
      • createContextMenu

        public void createContextMenu(ContextMenu menu)
        Description copied from interface: ViewParent
        Have the parent populate the specified context menu if it has anything to add (and then recurse on its parent).
        Specified by:
        createContextMenu in interface ViewParent
        Parameters:
        menu - The menu to populate
      • childDrawableStateChanged

        public void childDrawableStateChanged(View child)
        Description copied from interface: ViewParent
        This method is called on the parent when a child's drawable state has changed.
        Specified by:
        childDrawableStateChanged in interface ViewParent
        Parameters:
        child - The child whose drawable state has changed.
      • requestSendAccessibilityEvent

        public boolean requestSendAccessibilityEvent(View child,
                                            AccessibilityEvent event)
        Description copied from interface: ViewParent
        Called by a child to request from its parent to send an AccessibilityEvent. The child has already populated a record for itself in the event and is delegating to its parent to send the event. The parent can optionally add a record for itself.

        Note: An accessibility event is fired by an individual view which populates the event with a record for its state and requests from its parent to perform the sending. The parent can optionally add a record for itself before dispatching the request to its parent. A parent can also choose not to respect the request for sending the event. The accessibility event is sent by the topmost view in the view tree.

        Specified by:
        requestSendAccessibilityEvent in interface ViewParent
        Parameters:
        child - The child which requests sending the event.
        event - The event to be sent.
        Returns:
        True if the event was sent.
      • childAccessibilityStateChanged

        public void childAccessibilityStateChanged(View child)
        Description copied from interface: ViewParent
        A child notifies its parent that its state for accessibility has changed. That is some of the child properties reported to accessibility services has changed, hence the interested services have to be notified for the new state.
        Specified by:
        childAccessibilityStateChanged in interface ViewParent
      • requestDisallowInterceptTouchEvent

        public void requestDisallowInterceptTouchEvent(boolean disallowIntercept)
        Description copied from interface: ViewParent
        Called when a child does not want this parent and its ancestors to intercept touch events with ViewGroup.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.

        Specified by:
        requestDisallowInterceptTouchEvent in interface ViewParent
        Parameters:
        disallowIntercept - True if the child does not want the parent to intercept touch events.
      • requestChildRectangleOnScreen

        public boolean requestChildRectangleOnScreen(View child,
                                            Rect rectangle,
                                            boolean immediate)
        Description copied from interface: ViewParent
        Called when a child of this group wants a particular rectangle to be positioned onto the screen. ViewGroups overriding this can trust that:
        • child will be a direct child of this group
        • rectangle will be in the child's coordinates

        ViewGroups overriding this should uphold the contract:

        • nothing will change if the rectangle is already visible
        • the view port will be scrolled only just enough to make the rectangle visible
          Specified by:
          requestChildRectangleOnScreen in interface ViewParent
          Parameters:
          child - The direct child making the request.
          rectangle - The rectangle in the child's coordinates the child wishes to be on the screen.
          immediate - True to forbid animated or delayed scrolling, false otherwise
          Returns:
          Whether the group scrolled to handle the operation
        • childHasTransientStateChanged

          public void childHasTransientStateChanged(View child,
                                           boolean hasTransientState)
          Description copied from interface: ViewParent
          Called when a child view now has or no longer is tracking transient state.
          Specified by:
          childHasTransientStateChanged in interface ViewParent
          Parameters:
          child - Child view whose state has changed
          hasTransientState - true if this child has transient state


    Content

    Android Reference

    Java basics

    Java Enterprise Edition (EE)

    Java Standard Edition (SE)

    SQL

    HTML

    PHP

    CSS

    Java Script

    MYSQL

    JQUERY

    VBS

    REGEX

    C

    C++

    C#

    Design patterns

    RFC (standard status)

    RFC (proposed standard status)

    RFC (draft standard status)

    RFC (informational status)

    RFC (experimental status)

    RFC (best current practice status)

    RFC (historic status)

    RFC (unknown status)

    IT dictionary

    License.
    All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
    Copyright 2016 © ELTASK.COM. All rights reserved.
    Site is optimized for mobile devices.
    Downloads: 3719 / . Delta: 0.02538 с