ogaclejapan / SmartTabLayout

A custom ViewPager title strip which gives continuous feedback to the user when scrolling
Apache License 2.0
7.09k stars 1.34k forks source link

new feature with only bare interface without using viewpager altogether. #62

Closed jjhesk closed 8 years ago

jjhesk commented 9 years ago

is this possible give me an bare interface so that I can only implement the smarttablayout without sticking with the viewpager? because to some extend i dont need the viewpager to do the interact with the smart tab layout. Nice library btw!

ogaclejapan commented 9 years ago

Hi, @jjhesk Thank you for your ideas.

I’ll consider it. :+1:

jjhesk commented 9 years ago

I have been working on another library and I really appreciate that you have done such amazing job resolving the problems on adding pagers dynamically. Would u teach me more about how to use the utils-v13 library to remove and add fragment dynamically in the viewpager. I have the problems related this kind of issue. In your library I couldn't find such overrides for

@Override
public int getItemPosition(Object object) {
    return POSITION_NONE;
}

I think u can give me a shortcut from going through all the problems.

thank you so much! @ogaclejapan

ogaclejapan commented 9 years ago

Hi, @jjhesk

If you want to delete, you will need to override the getItemPosition(xx). It is like this:

    FragmentStatePagerItemAdapter adapter = new FragmentStatePagerItemAdapter(
        getSupportFragmentManager(), pages) {
      @Override
      public int getItemPosition(Object object) {
        return POSITION_NONE;
      }
    };

Maybe, it will works.