Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Toolbar Tabs with ViewPager in material design

Anyone know anything about how tabs are done in API 21/AppCompat Toolbar?

A lot of materials and articles what I found were old. They used old methods with ActionBar which don`t work now. At this moment I just created toolbar and have no ideas about toolbar tabs. So can anyone give examples or articles about how to make toolbar tabs with viewpager?

like image 473
Nurzhan Nogerbek Avatar asked Dec 17 '14 20:12

Nurzhan Nogerbek


1 Answers

Anyone know anything about how tabs are done in API 21/AppCompat Toolbar?

There are no Toolbar tabs. The pattern of having tabs in the action bar was deprecated by Material Design, and when they created Toolbar, they dropped tabs.

So can anyone give examples or articles about how to make toolbar tabs with viewpager.

There are no Toolbar tabs.

You are welcome to use PagerTabStrip, the TabPageIndicator from the ViewPagerIndicator library, PagerSlidingTabStrip, etc. for your ViewPager tabs.

like image 192
CommonsWare Avatar answered Sep 19 '22 12:09

CommonsWare