Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tabs on top and bottom of the screen

I'm trying to build a view that will have standard tabs on the bottom and action bar tabs in the upper part of the screen.
I've tried using FragmentTabHost together with TabLayout but with no success since they both call getSupportFragmentManager() so one cancels another.
I've also thought about using deprecated TabLayoutActivity but I'm using AppCompat theme so all my activities have to inherit AppCompatActivity.

Is there a way for bottom tab to start activities and upper one fragments, or at least both starting fragments that work?

Exanmple

like image 356
vladexologija Avatar asked Nov 10 '22 05:11

vladexologija


1 Answers

You can have 2 framelayouts (bottom,middle).

On bottom framelayout you will have a fragment with buttons as tabs, when you click on each button you will send back to activity which button clicked.

On middle framelayout you can have a TabLayout fragment and if you prefer also 1 fragment for each tab in the tablayout.

like image 170
gmetax Avatar answered Nov 14 '22 23:11

gmetax