Search code examples
androidandroid-viewpagermaterial-designandroid-tabsandroid-tablayout

How to add a dropdown to tab in viewpager sliding tabs?


I have 8 tabs in my app and i would like to provide easier access to the last 4 tabs which otherwise have to be scrolled till the end to reach.

According to Material design guidelines , we can use dropdown in tabs , by giving an option "more" as the last tab , and if the user selects a dropdown item , that item will appear on the penultimate tab and will be highlighted as the selected tab.

How to achieve this ? there are no documentation on how to do this ? only images are provided.

Here's the link to material design guidelines for tabs

Here's an image of tabs with an option "more"


Solution

  • I will answer my own question , it might save someone's time if they decide to go on this road.Here's what i found out:-

    I had posted a similar question on tabs about overflow pagination in TabLayout and recieved an answer from @ianhanniballake in which he mentioned that these features are for Desktop tabs and not supported in TabLayout.

    Here's the link to the question