コード例 #1
0
 @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));
 }
コード例 #2
0
 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();
   }
 }