@Override public View getView(int i, View view, ViewGroup viewGroup) { View convertView = mInnerAdapter.getView(i, view, viewGroup); mViewToItemIdMap.put(convertView, getItemId(i)); mHeaderIdToViewMap.add((int) getHeaderId(i), convertView); if (mCollapseHeaderIds.contains(getHeaderId(i))) { convertView.setVisibility(View.GONE); } else { convertView.setVisibility(View.VISIBLE); } return convertView; }
public long findItemIdByView(View view) { return mViewToItemIdMap.get(view); }
public View findViewByItemId(long itemId) { return mViewToItemIdMap.getKey(itemId); }