Devlight / NavigationTabStrip

Navigation tab strip with smooth interaction.
Apache License 2.0
2.24k stars 313 forks source link

It not worded when I set a onPageChangeListener,and not work with viewpager. #48

Open Aima09 opened 6 years ago

Aima09 commented 6 years ago

what wrong with the problem? `mSubaeraTablayout.setTitles(array); // mSubaeraTablayout.setStripColor(Color.RED); mSubaeraTablayout.setTabIndex(curZoneChannelPos, true);

    mSubaeraTablayout.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
        @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
         //not worked!
            ToastUtil.showShortToast("position"+position);

        }

        @Override public void onPageSelected(int position) {
            ToastUtil.showShortToast("position"+position);
        }

        @Override public void onPageScrollStateChanged(int state) {
            ToastUtil.showShortToast("position"+state);

        }
    });`
segunmicheal27 commented 6 years ago

use this instead

 ```
     mSubaeraTablayout.setOnTabStripSelectedIndexListener(new 
                             mSubaeraTablayout.OnTabStripSelectedIndexListener() {
                            @Override
                         public void onStartTabSelected(String title, int index) {
          T               oastUtil.showShortToast("position"+index);

       }

     @Override
       public void onEndTabSelected(String title, int index) {

      }

   });