TabLayout provides a horizontal layout to display tabs.
Population of the tabs to display is done through TabLayout.Tab instances. You create tabs via newTab(). From there you can change the tab's label or icon via setText(int) and setIcon(int) respectively. To display the tab, you need to add it to the layout via one of the addTab(Tab) methods. For example:
TabLayout tabLayout = ...;
tabLayout.addTab(tabLayout.newTab().setText("Tab 1"));
tabLayout.addTab(tabLayout.newTab().setText("Tab 2"));
tabLayout.addTab(tabLayout.newTab().setText("Tab 3"));
material design dependency-
implementation 'com.google.android.material:material:1.2.0-alpha06'
Watch video how to make scrollable tabs in android studio online without registration, duration hours minute second in high quality. This video was added by user Android Development Tutorials 19 May 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,343 once and liked it 10 people.