material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.37k stars 3.07k forks source link

[BottomNavigationView] Wrapping long labels #1698

Open pchmielowski opened 4 years ago

pchmielowski commented 4 years ago

Is your feature request related to a problem? Please describe. I'd like to have an option which makes long labels on BottomNavigationView be wrapped instead of ellipsized, like in this example: obraz

Describe the solution you'd like Possible solution would be to add new view attributes, such as:

app:onLabelOverflow="ellipsize"
app:onLabelOverflow="wrap"
wcshi commented 4 years ago

The spec explicitly recommends against truncating / ellipsizing text and cautions to avoid wrapping text.

https://material.io/components/bottom-navigation#anatomy

pchmielowski commented 4 years ago

@wcshi Yes, exactly - that's why this setting would be useful. I've suggested a possibility to set app:onLabelOverflow="ellipsize" because this is a default behaviour right now and it would be nice to keep the backward compatibility.

Papashkin commented 4 years ago

The same question for me. I need similar solution because I need to translate application to other languages, and in some cases, menu label may be ellipsized in the end and look ugly.