material-components / material-components/material-components-android

[NavigationView] strange rectangle appears when window overlaps with display cutout in edge-to-edge mode

Offen
#4,571 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
Java
Sterne
17.4k
Forks
3.2k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Description: The strange rectangle appears when the window overlaps with the display cutout in edge-to-edge mode.
Test11
Image
(#3983 or #4576) Catalog app
Image

Expected behavior: The strange rectangle doesn't appear when the window overlaps with the display cutout in edge-to-edge mode.
Test11
Image
(#3983 or #4576) Catalog app
Image

Source code:

<androidx.drawerlayout.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <com.google.android.material.appbar.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fitsSystemWindows="true">
            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/appBar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
        </com.google.android.material.appbar.AppBarLayout>
    </androidx.coordinatorlayout.widget.CoordinatorLayout>
    <com.google.android.material.navigation.NavigationView
        android:layout_width="220dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:menu="@menu/main" />
</androidx.drawerlayout.widget.DrawerLayout>
<resources>
    <style name="Theme.App" parent="Theme.Material3.DynamicColors.DayNight.NoActionBar">
        <item name="android:windowLayoutInDisplayCutoutMode">always</item>
    </style>
</resources>

Minimal sample app repro: Test11.zip

Android API version: 35

Material Library version: 1.13.0-alpha10

Device: Emulator 35.3.11

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem minimalen Beispiel Test11.zip und reproduziere das Rechteck auf dem API 35-Emulator unter Verwendung von Material Library 1.13.0-alpha10. Untersuche die Konfiguration von DrawerLayout, CoordinatorLayout, AppBarLayout, MaterialToolbar und NavigationView zusammen mit den Einstellungen für edge-to-edge und display-cutout. Als erledigt gilt die Aufgabe, wenn das Rechteck nicht mehr erscheint, sobald das Fenster den display-cutout überlappt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android
Bereich
mobile
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.