Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested tabs with viewpager swiping in android?

I've implemented nested tabs with view pager with no problems, but my problem is on the swiping part,

When I do the swiping action the main activity tabs will be switched, but I want the fragment to swipe instead. how can I achieve this?

I've tried implement main tab with tab host and fragment tabhost which doesn't have swiping feature at all, but that disabled whole swipe on the main and fragment together. Description

like image 962
Shaheen Zahedi Avatar asked Feb 21 '17 09:02

Shaheen Zahedi


1 Answers

Instead of custom library you can try to use Bottom navigation view for bottom bar which has been added to version 25 of the Design Support Library. Here is an Article about it.

So android.support.design.widget.BottomNavigationViewin your activity together with android.support.design.widget.TabLayout and ViewPagerin fragment should work the way you want it to work. And this will also provide good UX (similar to one implemented in Google Plus App)

like image 125
dzikovskyy Avatar answered Sep 19 '22 22:09

dzikovskyy