Search code examples
javaandroidgoogle-mapsandroid-viewpagerpagertabstrip

Showing pagerSlidingTabStrip on the layout without viewPagerAdapter on Android 5.0+


I would like to develop an android app's UI looks like the Uber's but booking rooms.

I want to implement the function about showing the option's description, from users who are clicking the PagerSlidingTabStrip items which shown on the bottom. The fragment page will be shown when the user click the fragment tab (PagerSlidingTabStrip), also the chosen option will be selected.

I feel puzzled and confused when I am implementing this function, and concern the pagerSlidingTabStrip can trigger events by setOnClickListner or not. Also I don't willing to show the fragment page on the main page once users logged on the page by default.

Thank you.

Main Page Layout

Layout after clicking the PagerSlidingTabStrip's option


Solution

  • Its better if you use TabLayout instead of PagerSlidingTabStrip

    That will help you to get click of the Tab selected as well as reselected and on that click event you can hide and show your Bottom Views which holding fragments