'Android moving BottomNavigationView labels

I want to make my labels of BottomNavigationView movable because some of labels are cut off.

Here is what I've tried:

<style name="Theme.abc.BottomNavigationView.Label" parent="Widget.MaterialComponents.BottomNavigationView">
    <item name="android:singleLine">true</item>
    <item name="android:marqueeRepeatLimit">marquee_forever</item>
    <item name="android:ellipsize">marquee</item>
    <item name="android:scrollHorizontally">true</item>
    <item name="android:focusable">true</item>
    <item name="android:focusableInTouchMode">true</item>
    <item name="android:freezesText">true</item>
</style>

and main_activity.xml

<com.google.android.material.bottomnavigation.BottomNavigationView
    android:id="@+id/bottom_navigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorBottomNavigationViewBg"
    app:itemTextColor="?attr/colorBottomNavigationViewItem"
    style="@style/Theme.abc.BottomNavigationView.Label"
    app:layout_constraintBottom_toBottomOf="parent"
    app:menu="@menu/menu_bottom_navigation" />

unfortunately my text fields in BottomNavigationView are still not moving. How to add such feature? Thanks in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source