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

[Navigation Rail] Unwanted Left Padding

Offen
#4,355 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@imhappi arbeitet bereits daran.

Seit 24.10.2024.

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

Beschreibung

Description:
In my app ui, when in landscape mode, I use NavigationRail. It works finely for my purpose but it has an issue of unwanted left/start padding.

Expected behavior:
No useless left padding should've been there

Source code:

  <ScrollView
        android:id="@+id/navigationContainer"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:focusable="false"
        android:layout_alignParentStart="true"
        android:layout_centerVertical="true"
        android:scrollbars="none">

        <com.google.android.material.navigationrail.NavigationRailView
            android:id="@+id/navigationView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@color/background"
            app:elevation="0dp"
            app:itemIconSize="27dp"
            app:labelVisibilityMode="labeled"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:menu="@menu/menu_bottom_nav"
            tools:ignore="VisualLintBottomNav" />

    </ScrollView>
navigationView.apply {
   setOnApplyWindowInsetsListener(null)
   setPadding(0, 0, 0, 0)
}

Android API version: Android API 34

Material Library version: Material Android Library version 1.12.0

Device: Realme GT Neo 3T

Sample Image
image

Note: This issue doesn't occur when app is run on an Android TV

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.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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