コード例 #1
0
ファイル: TabPageIndicator.java プロジェクト: chenjj2048/MLKZ
 public void onClick(View view) {
   TabView tabView = (TabView) view;
   final int oldSelected = mViewPager.getCurrentItem();
   final int newSelected = tabView.getIndex();
   mViewPager.setCurrentItem(newSelected);
   if (oldSelected == newSelected && mTabReselectedListener != null) {
     mTabReselectedListener.onTabReselected(newSelected);
   }
 }
コード例 #2
0
 @Override
 public void onClick(View v) {
   for (int i = 0; i < mIndicators.size(); i++) {
     if ((mIndicators.get(i).id & v.getId()) != 0 && mIndicators.get(i).id == v.getId()) {
       if (mLastTab == i && mActivity instanceof OnTabReselectedListener)
         ((OnTabReselectedListener) mActivity).onTabReselected(i);
       else mViewPager.setCurrentItem(i, true);
     }
   }
 }