Skip to content

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

Description

@Aima09

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);

        }
    });`

Activity

  1. segunmicheal27 commented on May 10, 2018

    @segunmicheal27

    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) {
            
          }
    
       });
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions