BottomBar
BottomBar copied to clipboard
setUpWithViewPager implementation
I already did a setUpWithViewPage
r 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
inBottomBar.java
, with private memeberviewPager
. -
OnTabSelected()
checks ifviewPager
is notnull
so callviewpager.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.