material-components / material-components-android

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

BottomNavigationView taking full height if no minHeight is set #4247

Closed mikolajefento closed 1 month ago

mikolajefento commented 1 month ago

Description: In this commit new attribute of minHeight was added. The default value is set to 0, and when combined with wrap_content the BottomNavigationView is taking up all free space. The result is that from version 1.5.0 onwards one must set minHeight in order to display BottomNavigationView correctly.

Expected behavior: wrap_content working correctly as in version < 1.5.0 without having to set minHeight

Source code:

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:menu="@menu/app_menu" />

Android API version: 34

Material Library version: 1.12.0 (bug exist from >= 1.5.0)

Device: Emulator & Motorola moto g22

imhappi commented 1 month ago

Hi @mikolajefento ! Recently in 1.13-alpha03, some changes were submitted to change BottomNavigationView to use the minHeight attribute as an actual minimum height, not an exact height. I'm going to close this issue as I believe the issue you are describing should be fixed with that change, but feel free to re-open if it is still happening