ViewOverlaypublic class ViewOverlay extends Object An overlay is an extra layer that sits on top of a View (the "host view")
which is drawn after all other content in that view (including children,
if the view is a ViewGroup). Interaction with the overlay layer is done
by adding and removing drawables.
An overlay requested from a ViewGroup is of type {@link ViewGroupOverlay},
which also supports adding and removing views. |
Fields Summary |
---|
OverlayViewGroup | mOverlayViewGroupThe actual container for the drawables (and views, if it's a ViewGroupOverlay).
All of the management and rendering details for the overlay are handled in
OverlayViewGroup. |
Constructors Summary |
---|
ViewOverlay(android.content.Context context, View hostView)
mOverlayViewGroup = new OverlayViewGroup(context, hostView);
|
Methods Summary |
---|
public void | add(android.graphics.drawable.Drawable drawable)Adds a Drawable to the overlay. The bounds of the drawable should be relative to
the host view. Any drawable added to the overlay should be removed when it is no longer
needed or no longer visible.
mOverlayViewGroup.add(drawable);
| public void | clear()Removes all content from the overlay.
mOverlayViewGroup.clear();
| ViewGroup | getOverlayView()Used internally by View and ViewGroup to handle drawing and invalidation
of the overlay
return mOverlayViewGroup;
| boolean | isEmpty()
return mOverlayViewGroup.isEmpty();
| public void | remove(android.graphics.drawable.Drawable drawable)Removes the specified Drawable from the overlay.
mOverlayViewGroup.remove(drawable);
|
|