I want tabMode scrollable with tabFilled with tabs(having single line title). As number of Tab and their title is dynamic in my app. How could I handle them when I set given property. Title of tabs come's in two lines.when number of tab is greater.
app:tabGravity="fill"
app:tabMaxWidth="0dp"
app:tabMode="fixed"
and when number of tabs are less and tabMode is set to scrollable. then extra space shown like below.
how could I make a Tablayout to work in all phones and with one line text . Simply remove spaces for second screen and make single line for 1st Image.
I know I have to change it's tabMode and tabGravity for these two cases
but How could I know when to change it's tabMode and tabGravity. It may be a case that I have only three tab's but their title are long and they are filling entire space. and some time we have 5 tabs with little title . They easily fit's in screen.
where tablayout in xml must have tabGravity Fill and tabMode to Scrollable