danger.ui
Class ActiveListView

java.lang.Object
  extended by danger.app.Listener
      extended by danger.ui.View
          extended by danger.ui.ActiveListView
All Implemented Interfaces:
ToolTipOwner, ActiveList.Delegate


public class ActiveListView
extends View
implements ActiveList.Delegate, ToolTipOwner

This class is a UI object that manages and draws the contents of an ActiveList (typically a StdActiveList).

This handles much of the expected human interaction. The arrow keys and the wheel can be used to navigate up and down through the list in the usual fashion.

If you want customized drawing to take place you will need to subclass and override paintItemLine(danger.ui.Pen, int, int, int, int, boolean, java.lang.Object) and/or paintEmptyList(danger.ui.Pen, int, int).

If you want to actually do something when focus changes, then you will need to override itemFocused(java.lang.Object). If you want to do something when an item is activated (by pressing the button or return key), then you will need to override itemActivated(java.lang.Object).

Alternatively, you can override the usual event methods to catch these things before this class gets a crack at them.


Field Summary
protected  CharSequence mToolTip
           
protected  int mToolTipY
           
 
Fields inherited from class danger.ui.View
DEFAULT_SCROLL_FOCUS_MARGIN, FOCUS_DEFAULT, FOCUS_DOWNWARD, FOCUS_LEFTWARD, FOCUS_NONE, FOCUS_RIGHTWARD, FOCUS_UPWARD, mOriginX, mOriginY, mStyle, POSITION_ABOVE, POSITION_ALIGN_BASELINE, POSITION_ALIGN_BOTTOM, POSITION_ALIGN_HORIZONTALLY, POSITION_ALIGN_LEFT, POSITION_ALIGN_PARENT_BOTTOM, POSITION_ALIGN_PARENT_RIGHT, POSITION_ALIGN_RIGHT, POSITION_ALIGN_TOP, POSITION_ALIGN_VERTICALLY, POSITION_BELOW, POSITION_CENTER_HORIZONTALLY, POSITION_CENTER_VERTICALLY, POSITION_TO_LEFT, POSITION_TO_RIGHT, PREFER_DIRECTION_NONE, PREFER_HORIZONTAL_DIRECTION, PREFER_VERTICAL_DIRECTION, STATE_AT_AND_SPACE_PAGE, STATE_CAN_FOCUS, STATE_DEBUG_BOUNDS, STATE_ENABLED, STATE_FOCUSED, STATE_MAKE_DING, STATE_PARTIAL_FOCUS_OK, STATE_TRANSPARENT, STATE_VISIBLE, WIDTH_FILL_TO_RIGHT
 
Constructor Summary
ActiveListView()
          Construct a new instance at (0, 0) with 0 width and height.
ActiveListView(int left, int top, int right, int bottom)
          Construct a new instance with the given bounds.
ActiveListView(Rect bounds)
          Construct a new instance with the given bounds.
 
Method Summary
 boolean eventKeyUp(char inChar, Event event)
          This method is called when the user releases a key.
 boolean eventShortcut(char c, Event e)
          Handle a shortcut key.
 boolean eventWidgetDown(int inWhichWidget, Event event)
           
 boolean eventWidgetUp(int inWhichWidget, Event event)
           
 boolean getAutoResize()
          Get whether or not this instance automatically resizes its height when items are added to or removed from the list being viewed.
protected  int getContentWidth()
          Get the usable width for content in this instance.
protected  int getFirstVisibleItemIndex()
           
 int getFocus()
          Get the index of the currently focused item, if any.
 Object getFocusedItem()
          Get the currently focused item, if any.
 boolean getHasBorder()
          Get whether or not this instance has a visible border.
 boolean getHasScrollbar()
          Get whether or not this instance has a scrollbar.
 Rect getInterestingRect(Rect rect)
          Store into the given Rect the area of this instance that is most "interesting" (typically, an area of focus if the instance has one), in the local coordinates of the instance itself.
 ActiveList getList()
          Get the list of this instance.
protected  int getListSize()
          Get the size of the list.
 int getMaxToolTipLines(int maxLines)
          Get the maximum number of lines to show in a tool tip.
protected  int getMaxVisibleItems()
          Get the maximum number of visible items, rounded down if the height isn't an even multiple of the item height (and assuming it's not the case that two partial items are shown).
protected  CharSequence getToolTipForItem(Object item)
          Get the tooltip text to show for the currently focused item.
 boolean hasToolTip()
          Returns whether a custom tooltip has been set for this view.
protected  void itemActivated(Object item)
          Indicate that the given item was just activated (via button press or return key).
protected  void itemFocused(Object item)
          Indicate that the given item just gained focus or, if passed null, that no item has focus.
protected  boolean itemIsFocused(int index)
           
protected  void itemUpdated(Object item, boolean isFocused)
          Indicate that the given item just got updated.
 void loseFocus()
          This method is called when this view loses its previous status as the focused child of a container.
protected  boolean moveFocus(int amount)
          Move the focus.
 void onHide()
          This method is called when this view is hidden, via the method View.hide().
 void onItemAdded(ActiveList list, Object item, int index)
          This method is called whenever an item is added to an ActiveList instance.
 void onItemRemoved(ActiveList list, Object item, int index)
          This method is called whenever an individual item is removed from an ActiveList instance.
 void onItemsReordered(ActiveList list)
          This method is called whenever items get reordered in an ActiveList instance.
 void onItemUpdated(ActiveList list, Object item, int index)
          This method is called whenever an item is updated.
 void onRangeAdded(ActiveList list, Object[] items, int start)
          This method is called whenever a contiguous range of items is added to an ActiveList instance.
 void onRangeRemoved(ActiveList list, Object[] items, int start)
          This method is called whenever a range of items is removed from an ActiveList instance.
 boolean pageToEnd()
          Page to the bottom of this view.
 boolean pageToHome()
          Page to the top of this view.
 void paint(Pen p)
          Draw the contents of this View.
protected  void paintEmptyList(Pen p, int width, int height)
          This is called to paint this instance when there are no items in its list.
protected  void paintItemLine(Pen p, int left, int top, int right, int bottom, boolean focused, Object item)
          Paint the given item at the given coordinates.
protected  void paintSelection(Pen p, int left, int top, int right, int bottom)
          Fill a round-rect around the given area, as if it is focused.
 void setAutoResize(boolean autoResize)
          Set whether or not this instance automatically resizes its height when items are added to or removed from the list being viewed.
 void setFocus(int index)
          Set the focus to be at the given index.
 boolean setFocusedItem(Object item)
          Set the focus to be the given item, if found in the list being viewed as compared with ==.
 void setHasBorder(boolean hasBorder)
          Set whether or not this instance has a visible border.
 void setHasScrollbar(boolean hasScrollbar)
          Set whether or not to display a scrollbar.
 void setItemHeight(int height)
          Set the height of the items.
 void setList(ActiveList list)
          Set the list of this instance, or set this instance to no longer have a list (if passed null).
 void setMaxToolTipLines(int maxLines)
          Set the maximum number of lines to show in a tool tip.
 void setToolTip(CharSequence inToolTip)
          Sets the tooltip text for this menu item.
 void showToolTip()
          Show the tool tip for this view.
 void snapHeight()
          Resize the height of this instance to fit all elements currently in the list it views.
 void takeFocus(boolean inFromAbove)
          This method is called when this view is set as the focused child of a container through Container.setFocusedChild(danger.ui.View, boolean).
 
Methods inherited from class danger.ui.View
boundsIntersect, boundsIntersect, canLoseFocus, clear, clear, copyStyle, disable, enable, eventKeyDown, eventKeyHeld, eventKeyRepeat, eventPeriodicPulse, eventRawKeyDown, eventRawKeyHeld, eventRawKeyRepeat, eventRawKeyUp, eventWidgetHeld, getAcceptFocus, getBackgroundColor, getBottom, getBounds, getBounds, getFocusTraversalDirection, getFocusTraversalFrom, getFocusTraversalPolicy, getFrame, getFrame, getGlobalBottom, getGlobalLeft, getGlobalRight, getGlobalTop, getHeight, getID, getInterestingRect, getLabelFont, getLabelFont, getLeft, getOrigin, getOrigin, getOriginX, getOriginY, getParent, getParentContainer, getPartialFocusOK, getRight, getScrollFocusMargin, getSibling, getState, getStyle, getStyleColor, getStyleFont, getTop, getWidth, getWindow, globalToLocal, globalToLocalH, globalToLocalV, hide, invalidate, invalidate, invalidate, invalidateIndependentOfOrigin, invalidateIndependentOfOrigin, isEnabled, isFocusable, isFocused, isOnScreen, isTransparent, isVisible, isVisibleInHierarchy, isVisibleOnScreen, justSetVisible, localToGlobal, localToGlobal, localToGlobalH, localToGlobalV, localToWindow, moveBy, notifyWhenParentSizeChanges, notifyWhenPositionChanges, notifyWhenSizeChanges, offsetOrigin, offsetOrigin, onAddedToParent, onDecoded, onEnabledStateChanged, onPeriodicPulse, onPositionChanged, onRemovedFromParent, onShortcut, onShortcut, onShortcutConsumed, onShow, onSizeChanged, onStyleChanged, onViewPositionChanged, onViewSizeChanged, onWindowPaint, playLimitSound, receiveEventInternal, resetOrigin, sendEventToWindow, setAcceptFocus, setAtAndSpacePage, setBackground, setBackgroundColor, setBottom, setDebugBounds, setDynamicPosition, setDynamicWidth, setEnabled, setFocusTraversalDirection, setFocusTraversalFrom, setFocusTraversalPolicy, setFrame, setHeight, setKeyedValue, setLabelFont, setLeft, setMakeLimitNoise, setOrigin, setOrigin, setPartialFocusOK, setPosition, setPreferredDirection, setRight, setScrollFocusMargin, setSize, setStyle, setStyleColor, setStyleFont, setStyleFrameColor, setTop, setTransparent, setVisible, setWidth, setWindow, shouldDropEvent, show, showContextMenu, styleIsDefault, swapStyleColors, willFocusWithin, willFocusWithin, windowToLocal
 
Methods inherited from class danger.app.Listener
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, receiveEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mToolTip

protected CharSequence mToolTip

mToolTipY

protected int mToolTipY
Constructor Detail

ActiveListView

public ActiveListView()
Construct a new instance at (0, 0) with 0 width and height. It is initially unattached to an ActiveList, set to accept focus, set not to auto-resize, has an item height of 12, and has a scrollbar and a border.


ActiveListView

public ActiveListView(Rect bounds)
Construct a new instance with the given bounds. It is initially unattached to an ActiveList, set to accept focus, set not to auto-resize, has an item height of 12, and has a scrollbar and a border.

Parameters:
bounds - non-null; the bounds for the instance

ActiveListView

public ActiveListView(int left,
                      int top,
                      int right,
                      int bottom)
Construct a new instance with the given bounds. It is initially unattached to an ActiveList. It is initially unattached to an ActiveList, set to accept focus, set not to auto-resize, has an item height of 12, and has a scrollbar and a border.

Parameters:
left - the left coordinate of the bounds
top - the top coordinate of the bounds
right - the right coordinate of the bounds
bottom - the bottom coordinate of the bounds
Method Detail

getList

public final ActiveList getList()
Get the list of this instance.

Returns:
null-ok; the list that this instance is a view of

setList

public final void setList(ActiveList list)
Set the list of this instance, or set this instance to no longer have a list (if passed null). If non-null, this will call ActiveList.removeDelegate(danger.util.ActiveList.Delegate) on the old list and ActiveList.addDelegate(danger.util.ActiveList.Delegate) on the new one, to remove this instance as the old list's delegate and set this instance as the new list's delegate.

Parameters:
list - null-ok; the list to render

setItemHeight

public final void setItemHeight(int height)
Set the height of the items.

Parameters:
height - > 0; the height of each item

setHasScrollbar

public final void setHasScrollbar(boolean hasScrollbar)
Set whether or not to display a scrollbar.

Note: It doesn't make sense to have an instance that both has a scrollbar and auto-resizes, so if a call to this method turns on the scrollbar, it will automatically force off auto-resize.

Parameters:
hasScrollbar - whether or not to display a scrollbar

getHasScrollbar

public final boolean getHasScrollbar()
Get whether or not this instance has a scrollbar.

Returns:
whether or not this instance has a scrollbar

setHasBorder

public final void setHasBorder(boolean hasBorder)
Set whether or not this instance has a visible border.

Parameters:
hasBorder - whether or not this instance has a visible border

getHasBorder

public final boolean getHasBorder()
Get whether or not this instance has a visible border.

Returns:
whether or not this instance has a visible border

setAutoResize

public final void setAutoResize(boolean autoResize)
Set whether or not this instance automatically resizes its height when items are added to or removed from the list being viewed. If called to turn on auto-resize, this will in fact immediately resize the instance if needed. If you are using an instance of this class within a ScrollView, then it may make sense to have auto-resize on; if, however, you are relying on this class to manage its own scrolling, then you should not have auto-resize on.

Note: It doesn't make sense to have an instance that both has a scrollbar and auto-resizes, so if a call to this method turns on auto-resize, it will automatically force the scrollbar to be off.

Parameters:
autoResize - whether or not to auto-resize

getAutoResize

public final boolean getAutoResize()
Get whether or not this instance automatically resizes its height when items are added to or removed from the list being viewed.

Returns:
whether or not this instance auto-resizes

snapHeight

public final void snapHeight()
Resize the height of this instance to fit all elements currently in the list it views.


getFocusedItem

public final Object getFocusedItem()
Get the currently focused item, if any.

Returns:
null-ok; the currently focused item or null if there is no currently focused item

setFocusedItem

public final boolean setFocusedItem(Object item)
Set the focus to be the given item, if found in the list being viewed as compared with ==. If the item isn't found, then the focus isn't changed.

Parameters:
item - null-ok; the item to focus
Returns:
true iff the item was found and focused

getFocus

public final int getFocus()
Get the index of the currently focused item, if any.

Returns:
>= -1; index of the the currently focused item, or -1 if no item has focus.

setFocus

public final void setFocus(int index)
Set the focus to be at the given index. This will throw if asked to focus out of the range of the list being viewed.

Parameters:
index - >= 0 && < size, where size is the size of the list being viewed; the index for the focused item
Throws:
IndexOutOfBoundsException - thrown if index is out of range

eventWidgetDown

public boolean eventWidgetDown(int inWhichWidget,
                               Event event)
Overrides:
eventWidgetDown in class View

eventWidgetUp

public boolean eventWidgetUp(int inWhichWidget,
                             Event event)
Overrides:
eventWidgetUp in class View

eventKeyUp

public boolean eventKeyUp(char inChar,
                          Event event)
Description copied from class: View
This method is called when the user releases a key. The default implementation returns false.

Overrides:
eventKeyUp in class View

eventShortcut

public boolean eventShortcut(char c,
                             Event e)
Description copied from class: View
Handle a shortcut key. Returns true if the shortcut was handled. Override this method if you want to handle this event yourself. event is currently always null. However, in a future release the actual event will be included so you can determine which modifier keys were held. The default View.eventShortcut handles the MENU+WHEEL shortcut for context menus. See ScreenWindow, DialogWindow, BaseMenuWindow.

Overrides:
eventShortcut in class View
Parameters:
c - the key that was pressed
e - the event associated with the key press
Returns:
true if the shortcut was handled

pageToHome

public boolean pageToHome()
Description copied from class: View
Page to the top of this view. Returns false if it's already at the top, or it doesn't know how to page. This method may be called by ScrollView if the user pages up in a scroll view that's already at the top. This default implementation does nothing.

Overrides:
pageToHome in class View

pageToEnd

public boolean pageToEnd()
Description copied from class: View
Page to the bottom of this view. Returns false if it's already at the bottom, or it doesn't know how to page. This method may be called by ScrollView if the user pages down in a scroll view that's already at the bottom. This default implementation does nothing.

Overrides:
pageToEnd in class View

paint

public void paint(Pen p)
Description copied from class: View
Draw the contents of this View. This method is called by the graphics system when the View needs to be repainted. A Pen will be provided which is appropriately clipped and translated for drawing on this View.

The implementation of this method in this class will merely call clear() pen, if this View is opaque (not transparent), and will do nothing otherwise. If you don't need this behavior, then there is no point in calling super.paint() in an overriding method.

Overrides:
paint in class View
Parameters:
p - non-null; the pen to use for drawing operations

itemIsFocused

protected boolean itemIsFocused(int index)

getInterestingRect

public Rect getInterestingRect(Rect rect)
Description copied from class: View
Store into the given Rect the area of this instance that is most "interesting" (typically, an area of focus if the instance has one), in the local coordinates of the instance itself. (E.g., (0,0) represents the top-left of this instance.) This method returns whatever object was passed in. By default, this instance sets the rect's values to be the full bounds of this instance, but you may override this behavior in a subclass that has a more interesting area.

Overrides:
getInterestingRect in class View
Parameters:
rect - non-null; the Rect to store the interesting values into
Returns:
rect, always

onItemUpdated

public void onItemUpdated(ActiveList list,
                          Object item,
                          int index)
Description copied from interface: ActiveList.Delegate
This method is called whenever an item is updated. That is, this is called when an item in an ActiveList instance notifies this instance that is was updated via its update mechanism.

Specified by:
onItemUpdated in interface ActiveList.Delegate
Parameters:
list - non-null; the list which was notified
item - null-ok; the item that was updated
index - >= 0; the index that the item is at

onItemAdded

public void onItemAdded(ActiveList list,
                        Object item,
                        int index)
Description copied from interface: ActiveList.Delegate
This method is called whenever an item is added to an ActiveList instance.

Specified by:
onItemAdded in interface ActiveList.Delegate
Parameters:
list - non-null; the list which was modified
item - null-ok; the item that was added
index - >= 0; the index that the item was added (inserted) at

onRangeAdded

public void onRangeAdded(ActiveList list,
                         Object[] items,
                         int start)
Description copied from interface: ActiveList.Delegate
This method is called whenever a contiguous range of items is added to an ActiveList instance.

Specified by:
onRangeAdded in interface ActiveList.Delegate
Parameters:
list - non-null; the list which was modified
items - non-null; array containing the items that were added
start - >= 0; the start index that the range was added (inserted) at

onItemRemoved

public void onItemRemoved(ActiveList list,
                          Object item,
                          int index)
Description copied from interface: ActiveList.Delegate
This method is called whenever an individual item is removed from an ActiveList instance. For example, StdActiveList.removeItem(java.lang.Object) or and StdActiveList.removeItemAt(int) are two concrete methods that remove individual items from an instance.

Specified by:
onItemRemoved in interface ActiveList.Delegate
Parameters:
list - non-null; the list which was modified
item - null-ok; the item that was removed
index - >= 0; the index that the item was removed from

onRangeRemoved

public void onRangeRemoved(ActiveList list,
                           Object[] items,
                           int start)
Description copied from interface: ActiveList.Delegate
This method is called whenever a range of items is removed from an ActiveList instance. For example, StdActiveList.removeRange(int, int) and StdActiveList.removeAllItems() are two concrete methods that remove ranges of items from an instance.

Specified by:
onRangeRemoved in interface ActiveList.Delegate
Parameters:
list - non-null; the list which was modified
items - non-null; array containing the removed items
start - >= 0; the start index that the items were removed from

onItemsReordered

public void onItemsReordered(ActiveList list)
Description copied from interface: ActiveList.Delegate
This method is called whenever items get reordered in an ActiveList instance. For example, StdActiveList.sort(java.util.Comparator) is a concrete method that reorders the items of an instance.

Specified by:
onItemsReordered in interface ActiveList.Delegate
Parameters:
list - non-null; the list which was modified

getContentWidth

protected final int getContentWidth()
Get the usable width for content in this instance.

Returns:
the content width

paintEmptyList

protected void paintEmptyList(Pen p,
                              int width,
                              int height)
This is called to paint this instance when there are no items in its list. By the time this is called, the area will have been cleared. By default, this just draws a border around the area if this instance is set to have a border and otherwise is a no-op.

Parameters:
p - non-null; the pen to use for drawing
width - the width of the area to draw in
height - the width of the area to draw in

paintItemLine

protected void paintItemLine(Pen p,
                             int left,
                             int top,
                             int right,
                             int bottom,
                             boolean focused,
                             Object item)
Paint the given item at the given coordinates. By default, this does the following: If the item is focused, this will first call paintSelection(danger.ui.Pen, int, int, int, int). Then, this simply draws the string form of the item vertically centered in its area and left justified with a margin of 2 pixels, in the BACKGROUND_COLOR if focused or the FOREGROUND_COLOR if not.

Parameters:
p - non-null; the pen to use for drawing
left - the left of the area to draw in
top - the top of the area to draw in
right - the right of the area to draw in
bottom - the bottom of the area to draw in
focused - whether or not the item is currenctly focused
item - non-null; the item to draw

paintSelection

protected void paintSelection(Pen p,
                              int left,
                              int top,
                              int right,
                              int bottom)
Fill a round-rect around the given area, as if it is focused.

Parameters:
p - non-null; the pen to use for drawing
left - the left of the area to draw in
top - the top of the area to draw in
right - the right of the area to draw in
bottom - the bottom of the area to draw in

itemActivated

protected void itemActivated(Object item)
Indicate that the given item was just activated (via button press or return key). This will get passed null if an activation action happened without any item in focus.

Parameters:
item - null-ok; the item that was just activated

itemFocused

protected void itemFocused(Object item)
Indicate that the given item just gained focus or, if passed null, that no item has focus. This method does nothing by default; it exists so subclasses can override it to do something useful whenever the focus changes.

Parameters:
item - null-ok; the item that just got focused

itemUpdated

protected void itemUpdated(Object item,
                           boolean isFocused)
Indicate that the given item just got updated. This method does nothing by default; it exists so subclasses can override it to do something useful whenever an item gets updated.

Parameters:
item - non-null; the item that just got updated
isFocused - whether or not the item currently has focus

getMaxVisibleItems

protected int getMaxVisibleItems()
Get the maximum number of visible items, rounded down if the height isn't an even multiple of the item height (and assuming it's not the case that two partial items are shown).

Returns:
the maximum number of visible items

getListSize

protected int getListSize()
Get the size of the list.

Returns:
the list size

moveFocus

protected boolean moveFocus(int amount)
Move the focus.

Parameters:
amount - the amount to move (negative for up, positive for down)
Returns:
whether the focus actually moved

getFirstVisibleItemIndex

protected int getFirstVisibleItemIndex()

setToolTip

public final void setToolTip(CharSequence inToolTip)
Sets the tooltip text for this menu item. This is the text that is displayed if the selection hovers over this item.

Parameters:
inToolTip - the text to display to the user

hasToolTip

public final boolean hasToolTip()
Returns whether a custom tooltip has been set for this view.


showToolTip

public void showToolTip()
Show the tool tip for this view. This implements a method in the ToolTipOwner interface. Generally, you will not need to call or override this method, as it is called automatically. You can specify the content of the tool tip by using setToolTip(java.lang.CharSequence).

Specified by:
showToolTip in interface ToolTipOwner

setMaxToolTipLines

public void setMaxToolTipLines(int maxLines)
Set the maximum number of lines to show in a tool tip. A value of 0 means there is no maximum. See getMaxToolTipLines(int).


getMaxToolTipLines

public final int getMaxToolTipLines(int maxLines)
Get the maximum number of lines to show in a tool tip. A value of 0 means there is no maximum. See setMaxToolTipLines(int).


takeFocus

public void takeFocus(boolean inFromAbove)
Description copied from class: View
This method is called when this view is set as the focused child of a container through Container.setFocusedChild(danger.ui.View, boolean). If you need to do anything special when taking focus, you should override this method. If you need to know the direction the focus is changing (left/right/up/down), you can call View.getFocusTraversalDirection(boolean) from within takeFocus. In the rare occasion that you need to call this method yourself, you should call View.setFocusTraversalDirection(int) and View.setFocusTraversalFrom(danger.ui.View) immediately before calling this method.

Overrides:
takeFocus in class View
Parameters:
inFromAbove - whether the focus was entered into this view from above

loseFocus

public void loseFocus()
Description copied from class: View

This method is called when this view loses its previous status as the focused child of a container.

You generally wouldn't call this method yourself, but instead would override it if you wanted to know when the view is losing focus.

If you don't want this view to have focus anymore, you should use Container.setFocusedChild(View) or Container.setFocusedDescendant(View).

Overrides:
loseFocus in class View

onHide

public void onHide()
Description copied from class: View
This method is called when this view is hidden, via the method View.hide(). It is called as the very last thing done by that method, and it is only ever called if the view was not already hidden. Overriding this method is the recommended way to get special behavior when a view gets hidden . The implementation in this class does nothin.

Overrides:
onHide in class View

getToolTipForItem

protected CharSequence getToolTipForItem(Object item)
Get the tooltip text to show for the currently focused item. Null or empty string returned is interpreted as "show no tooltip". Subclasses that wish to use tooltips should override to handle getting tooltips for their specific contents.