2

我的折叠工具栏有问题。当我向上滚动(工具栏正在折叠)时,它会平滑滚动。不幸的是,当我向下滚动(工具栏正在扩展)时,滚动停止等待嵌套滚动视图完全滚动。我想你会通过这个 GIF 理解它:

在此处输入图像描述

这是我的 XML:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/vDrawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/vCoordinator"
        style="@style/Layout.Coordinator"
        tools:context="io.stepuplabs.settleup.ui.main.MainActivity">

        <io.stepuplabs.settleup.ui.main.StateAwareAppBar
            android:id="@+id/vAppBar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fitsSystemWindows="true"
            android:theme="@style/AppTheme.AppBarOverlay">

            <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/vCollapsingToolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fitsSystemWindows="true"
                app:contentScrim="?attr/colorAccent"
                app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed|exitUntilCollapsed|snap">

                <ImageView
                    android:id="@+id/vPlaceholderCircles"
                    android:layout_width="match_parent"
                    android:layout_height="296dp"
                    android:contentDescription="@string/desc_circles"
                    android:scaleType="centerCrop"
                    android:src="@drawable/placeholder"
                    app:layout_collapseMode="none"
                    />

                <android.support.v7.widget.Toolbar
                    android:id="@+id/vToolbar"
                    style="@style/Layout.Toolbar"
                    android:layout_marginBottom="40dp"
                    app:layout_collapseMode="pin"
                    app:layout_collapseParallaxMultiplier="1"
                    app:popupTheme="@style/AppTheme.PopupOverlay">

                    <TextView
                        android:id="@+id/vWhoShouldPayTitle"
                        android:layout_width="wrap_content"
                        android:visibility="gone"
                        android:layout_height="wrap_content"
                        android:layout_gravity="start"
                        android:text="@string/app_name"
                        android:textAppearance="@style/Text.Toolbar" />
                </android.support.v7.widget.Toolbar>

                <android.support.design.widget.TabLayout
                    android:id="@+id/vTabs"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    app:layout_collapseMode="parallax"
                    app:layout_collapseParallaxMultiplier="0"
                    app:tabIndicatorColor="@color/white"
                    app:tabMode="scrollable" />

            </android.support.design.widget.CollapsingToolbarLayout>

        </io.stepuplabs.settleup.ui.main.StateAwareAppBar>

        <android.support.v4.view.ViewPager
            android:id="@+id/vViewPager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

        <android.support.v4.widget.ContentLoadingProgressBar
            android:id="@+id/vActivityProgress"
            style="?android:attr/progressBarStyleLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center" />

        <com.github.clans.fab.FloatingActionMenu
            android:id="@+id/vFloatingActionMenu"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="bottom|end"
            android:contentDescription="@string/expense"
            android:paddingBottom="10dp"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            app:layout_behavior="io.stepuplabs.settleup.ui.common.FloatingActionMenuBehavior"
            fab:menu_animationDelayPerItem="0"
            fab:menu_backgroundColor="@color/dim"
            fab:menu_buttonSpacing="6dp"
            fab:menu_fab_label="@string/expense"
            fab:menu_icon="@drawable/fab_add"
            fab:menu_labels_cornerRadius="30dp"
            fab:menu_labels_ellipsize="end"
            fab:menu_labels_paddingBottom="8dp"
            fab:menu_labels_paddingLeft="16dp"
            fab:menu_labels_paddingRight="16dp"
            fab:menu_labels_paddingTop="8dp"
            fab:menu_labels_position="left"
            fab:menu_labels_textColor="@color/white"
            fab:menu_labels_textSize="14sp">

            <com.github.clans.fab.FloatingActionButton
                android:id="@+id/vFabTransfer"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom|end"
                android:contentDescription="@string/transfer"
                android:src="@drawable/ic_transfer"
                fab:fab_label="@string/transfer"
                fab:fab_size="mini" />
        </com.github.clans.fab.FloatingActionMenu>

    </android.support.design.widget.CoordinatorLayout>

    <android.support.design.widget.NavigationView
        android:id="@+id/vNavigationDrawer"
        android:layout_width="280dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@color/white"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/drawer_header"
        app:itemBackground="@drawable/selector_items_background_color"
        app:itemIconTint="@color/selector_drawer_items_foreground_color"
        app:itemTextColor="@color/selector_drawer_items_foreground_color"
        app:menu="@menu/drawer" />

</android.support.v4.widget.DrawerLayout>
4

0 回答 0