Object ViewUtils

  • All Implemented Interfaces:

    
    public class ViewUtils
    
                        

    Miscellaneous View utility methods.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static ViewUtils INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static ViewGroup getParent(View view) Returns the parent that inherits the ViewGroup of the given view.
      final static Unit removeFromParent(View view) Removes the given view form its parent.
      final static Unit addOnPreDrawListener(View view, Runnable runnable) Registers a callback to be invoked when the view tree is about to be drawn.
      final static View getTopmostView(View view) Finds the topmost view in the current activity or current view hierarchy.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getParent

         final static ViewGroup getParent(View view)

        Returns the parent that inherits the ViewGroup of the given view.

        Parameters:
        view - the view for which to return the parent.
        Returns:

        the parent that inherits the ViewGroup of the given view.

      • removeFromParent

         final static Unit removeFromParent(View view)

        Removes the given view form its parent.

        Parameters:
        view - the view to remove.
      • getTopmostView

         final static View getTopmostView(View view)

        Finds the topmost view in the current activity or current view hierarchy.

        Parameters:
        view - a view in the currently displayed view hierarchy.
        Returns:

        the topmost view in the current activity or current view hierarchy. Null if no applicable View can be found.