Package com.naver.ads.util
Object ViewUtils
-
-
Method Summary
Modifier and Type Method Description final static ViewGroupgetParent(View view)Returns the parent that inherits the ViewGroup of the given view. final static UnitremoveFromParent(View view)Removes the given view form its parent. final static UnitaddOnPreDrawListener(View view, Runnable runnable)Registers a callback to be invoked when the view tree is about to be drawn. final static ViewgetTopmostView(View view)Finds the topmost view in the current activity or current view hierarchy. -
-
Method Detail
-
removeFromParent
final static Unit removeFromParent(View view)
Removes the given view form its parent.
- Parameters:
view- the view to remove.
-
addOnPreDrawListener
final static Unit addOnPreDrawListener(View view, Runnable runnable)
Registers a callback to be invoked when the view tree is about to be drawn.
When ViewTreeObserver.OnPreDrawListener.onPreDraw is fired, it automatically fires
removeOnPreDrawListener.- Parameters:
view- the view to observe.runnable- the action when the view tree is about to be drawn.
-
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.
-
-
-
-