material-components / material-components/material-components-android
[AppBarLayout] Elevation disappears when AppBarLayout is half visible
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 17.4k
- Forks
- 3.2k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Description: When AppBarLayout has app:liftOnScroll="true" and its sibling has app:layout_scrollFlags="scroll|enterAlways|snap", the elevation disappears if you stop scrolling when the AppBarLayout is half-visible.
The issue is easy to see if after scrolling up and hiding the AppBarLayout you start scrolling down very slowly.
Expected behavior: Elevation should remain visible even if you stop scrolling when AppBarLayout is half-visible.
Source code:
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:liftOnScroll="true"
>
<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways|snap"
/>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
</FrameLayout>
Android API version: The problem is reproducible in APIs 16 through 30.
Material Library version: 1.3.0
Device: Android emulators (APIs 16 through 30) and Pixel 2 (API 30).
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Problem mit dem bereitgestellten AppBarLayout, MaterialToolbar, scrolling flags und der Konfiguration von appbar_scrolling_view_behavior auf einem Android-Emulator nachzustellen. Überprüfe die elevation, während du mit halb sichtbarem AppBarLayout anhältst, und betrachte das Problem als erledigt, wenn die elevation in diesem Zustand über die gemeldeten API-Versionen hinweg sichtbar bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- android
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100