@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mController.tryVibrate(); if (position != mSelectedPosition) { mSelectedPosition = position; mAdapter.notifyDataSetChanged(); } mController.onYearSelected(mAdapter.getItem(position)); }
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mController.tryVibrate(); TextViewWithCircularIndicator clickedView = (TextViewWithCircularIndicator) view; if (clickedView != null) { if (clickedView != mSelectedView) { if (mSelectedView != null) { mSelectedView.drawIndicator(false); mSelectedView.requestLayout(); } clickedView.drawIndicator(true); clickedView.requestLayout(); mSelectedView = clickedView; } mController.onYearSelected(getYearFromTextView(clickedView)); mAdapter.notifyDataSetChanged(); } }