Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TabLayout] Support better break strategies for tab text. #4616

Open
raffaelgyr opened this issue Feb 20, 2025 · 0 comments
Open

[TabLayout] Support better break strategies for tab text. #4616

raffaelgyr opened this issue Feb 20, 2025 · 0 comments

Comments

@raffaelgyr
Copy link

Is your feature request related to a problem? Please describe.
I have a TabLayout with four items in fixed mode. This means that on some devices, the text of some items ends up being too long and therefore breaks on to a second line. Since the text is only a single word though, it has to break in the middle of a word. With the current behaviour it does so without adding a hyphen/dash and in weird places.

Describe the solution you'd like
I would like to be able to set the break strategy, similar to how it can be set for a TextView.

Describe alternatives you've considered
I have considered making the tabs have 1 line maximum to prevent the line breaks entirely, but as far as I could figure out, the maxLines value is hardcoded in this library and can't be changed from implementors of this library. I have also considered setting the mode to auto or scrollable, however both produce unwanted effects when there would be enough space (these issues are already covered by #650).

Additional context
In this screenshot you can see, that it sometimes puts just a single character on a new line.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants