/** * Stores a reference to the views above and below the item currently * corresponding to the hover cell. It is important to note that if this * item is either at the top or bottom of the list, mAboveItemId or mBelowItemId * may be invalid. */ void updateNeighborViewsForID(long itemID) { int position = getPositionForID(itemID); StableArrayAdapter adapter = (StableArrayAdapter)Adapter; mAboveItemId = adapter.GetItemId(position - 1); mBelowItemId = adapter.GetItemId(position + 1); }
/** Retrieves the view in the list corresponding to itemID */ public View getViewForID(long itemID) { int firstVisiblePosition = FirstVisiblePosition; StableArrayAdapter adapter = (StableArrayAdapter)Adapter; for (int i = 0; i < ChildCount; i++) { View v = GetChildAt(i); int position = firstVisiblePosition + i; long id = adapter.GetItemId(position); if (id == itemID) { return(v); } } return(null); }