private void saveOffsets() { final int firstVisiblePosition = mDragDropListener.getDragDropListView().getFirstVisiblePosition(); for (int i = 0; i < mDragDropListener.getDragDropListView().getChildCount(); i++) { final View child = mDragDropListener.getDragDropListView().getChildAt(i); final int position = firstVisiblePosition + i; if (!isIndexInBound(position)) { continue; } final long itemId = getItemId(position); // Log.d(TAG, "Saving itemId: " + itemId + " for listview child " + i + " Top: " // + child.getTop() + " Left: " // + child.getLeft()); mItemIdTopMap.put(itemId, child.getTop()); mItemIdLeftMap.put(itemId, child.getLeft()); } }
final long itemId = getItemId(position);