I thought the source of our issue was somewhere in the framework's code. And sure enough, I found some clues :
First, if you look inside the TabWidget
code, you will see that the label you set in setIndicator
is passed to an inner class called LabelIndicatorStrategy
which will take care of inflating the view associated to the top part of the tab. This inflation is done using an xml file tab_indicator.xml. This layout is based on a RelativeLayout
containing an ImageView
and a TextView
. And if you look at the properties of the textview, you will see that it refers to a style in android styles.xml. And here finally, you realize that we have THAT :
<item name="ellipsize">marquee</item>
<item name="singleLine">true</item>
So, now, 2 options :
First, override the style by creating your own style, which in my opinion would be the really painless way and then change these properties to something that suits you better. Though the result might not be very nice. this will require some testing.
Or, put on your gloves and copy the code from the TabWidget class, because another issue here is that the inner class I mentionned is... PRIVATE so, no inheritance possible if I'm not mistaken... SO I think, much much more pain than the styles.xml's way.
Hope this will inspire you, keep me posted of what you get please. I'm still interested.