'AppBar scrolling behavior doesn't work properly
Screencast to understand the problem - mp4
This screenshot video explains exactly what's happened. The scrolling behavior is not totally correct, because the scroll should to stop at the end of the last graphical element in the global view.
Here you are the layout used:
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="1dp"
android:theme="@style/ActionBarThemeOverlay"
app:elevation="@dimen/toolbar_elevation">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:collapsedTitleTextColor="@color/theme_primary"
app:contentScrim="@android:color/white"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:scrimAnimationDuration="400">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/images_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_actionbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:subtitleTextAppearance="@style/DarkActionBar.SubtitleText"
app:titleTextAppearance="@style/DarkActionBar.TitleText" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<FrameLayout
android:id="@+id/child_form_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.azeoo.ui.widget.DefaultShimmerPageView
android:id="@+id/default_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.myapp.ui.widget.BottomBarButtonsView
android:id="@+id/bottom_bar_buttons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:visibility="gone"/>
</androidx.constraintlayout.widget.ConstraintLayout>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
