enter image description here

Tell me how to make 2 such buttons.

Is it a TabLayout or what? I am most confused by the white bar above the active button

  • this is not a toolbar, but a tabhost . The strip, apparently, is still under the "button". - pavlofff
  • 2
    In general, I added ToolBar along with TabLayout, it works fine, just like in the picture - Andro

1 answer 1

The picture shows TabLayout - here is a good example fully implemented and intuitive with explanations and comments, and most importantly made in the style of material design as you have in the example.

PS There is a lot of necessary and there is no sense in showing one piece of code, so please do not delete this answer :)

  • one
    TabHost is outdated and is now replaced by TabLayout) - Yuriy SPb 6:26 pm
  • one
    @YurySpb thanks for saying) corrected the answer, The link is implemented via TabLayout. I generally use navigtionview, Tabhost worked a long time ago and therefore I remembered it. - iFr0z
  • one
    @ Yuriy SPb which you are categorical. ListView outdated, TabHost outdated, while in the API neither one nor the other is declared Deprecated and neither RecyclerView nor TabLayout is recommended TabLayout - each widget has its own application. ListView much more appropriate in simple lists, with one / two lines of text, like a dialog box with items, like a spinner. TabHost does not use the adapter and for simple "pages" is also much more appropriate. Everything has its place and do not need to do more difficult where it is easier. - pavlofff