material-components / material-components-android

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

[NavigationView] strange rectangle appears #3016

Closed manabu-nakamura closed 2 years ago

manabu-nakamura commented 2 years ago

Description: When the device is landscape and fullscreen, a strange rectangle appears on the right edge of the navigation view in the bottom sheet. Catalog (Bottom App Bar): Screenshot_20221012_104905 Editor4: Screenshot_20221011_122533

Expected behavior: The strange rectangle does not appear even when the device is landscape and fullscreen. Editor4: Screenshot_20221011_131653

Source code: Catalog: https://github.com/material-components/material-components-android/blob/master/catalog/java/io/material/catalog/bottomappbar/res/layout/cat_bottomappbar_fragment.xml#L45-L61 https://github.com/material-components/material-components-android/blob/master/catalog/java/io/material/catalog/windowpreferences/WindowPreferencesManager.java#L80-L81 Editor4:

    <LinearLayout
        android:id="@+id/bottomSheet"
        style="@style/Widget.Material3.BottomSheet"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_behavior="@string/bottom_sheet_behavior">
        <com.google.android.material.bottomsheet.BottomSheetDragHandleView
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
        <com.google.android.material.navigation.NavigationView
            android:id="@+id/navigationView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:menu="@menu/sheet" />
    </LinearLayout>
ViewCompat.setOnApplyWindowInsetsListener(getWindow().getDecorView(), (v, insets) -> insets);

Minimal sample app repro: Editor4.zip

Android API version: 32

Material Library version: 1.7.0-rc01

Device: Emulator 31.3.12

manabu-nakamura commented 2 years ago

Thank you very much.