BottomBar icon indicating copy to clipboard operation
BottomBar copied to clipboard

setUpWithViewPager implementation

Open talhahasanzia opened this issue 7 years ago • 0 comments

I already did a setUpWithViewPager implementation in my project outside library and I was wondering to add this as a library feature. What I think the steps to do are:

  • A method setUpWithViewPager( ViewPager viewPager); // v4 viewapager in BottomBar.java, with private memeber viewPager.
  • OnTabSelected() checks if viewPager is not null so call viewpager.setCurrentItem() , for eg, 0th fragment for 0th tab,, 1st fragment for 1st tab and so on.
  • I see OnTabSelected() implementation is left for user to implement, I want to "do what user does, and also call viewpager method from private viewpager object". How can I put this concrete implementation in this abstract scenario?
  • Will I have to write unit tests at my end also?

In my project I simply called viewpager.setCurrentItem() in onTabSelected listeners by checking current tabs.

Even if this is not a valid enough feature to be added, I just want to give it a try.

talhahasanzia avatar Jun 20 '17 18:06 talhahasanzia