带有View Pager和查看分页器片段的CollaspeToolBar有一个ExpendableListview然后layout_behavior无法正常工作

时间:2017-05-26 09:10:26

标签: android android-collapsingtoolbarlayout

这是我的xml活动代码,它有一个CollaspeToolBar。

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.design.widget.CoordinatorLayout
    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">

   <!--App bar layout-->
    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/appbar_layout"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">


        <android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="256dp"
            android:id="@+id/collapsing_toolbar"
            style="@style/Widget.DeliveryChopes.CollapsingToolbar"
            app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">

            <!-- Add this view -->
            <com.android.volley.toolbox.NetworkImageView
                android:id="@+id/business_detail_appbar_image"
                style="@style/Widget.Shrine.CollapsingToolbarImage"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_collapseMode="parallax"

                android:background="@drawable/lunch_bg"
                app:layout_collapseParallaxMultiplier="0.75"/>

            <RelativeLayout
                style="@style/Widget.DeliveryChopes.CollapsingToolbarContent"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/rlBDScrollableImage"
                app:layout_collapseMode="parallax"
                app:layout_collapseParallaxMultiplier="0.65"
                >




                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/rbBDScrollRating"
                    android:textColor="@color/color_white"
                    android:textStyle="normal"
                    android:textSize="15sp"
                    android:typeface="serif"
                    android:layout_marginStart="10dp"
                    android:maxLength="20"
                    android:layout_marginTop="5dp"
                    android:ellipsize="end"
                    android:text="@string/food_category"
                    android:id="@+id/tvBDScrollCategorey"
                    />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/tvBDScrollCategorey"
                    android:layout_marginStart="10dp"
                    android:text="@string/business_address"
                    android:textColor="@color/color_white"
                    android:id="@+id/tvBDScrollBusinessAddress"
                    android:typeface="serif"
                    android:maxLines="2"
                    android:ellipsize="end"
                    android:layout_marginTop="5dp"
                    android:layout_marginEnd="10dp"/>

                <RatingBar
                    android:id="@+id/rbBDScrollRating"
                    style="?android:attr/ratingBarStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:numStars="5"
                    android:isIndicator="true"
                    android:clickable="false"
                    android:progress="@android:integer/config_longAnimTime"
                    android:layout_marginStart="10dp"
                    android:layout_marginEnd="10dp"
                    android:layout_marginTop="2dp"

                    />


                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:background="@drawable/closed_sign"
                    android:id="@+id/ivScBDOpenClose"/>

            </RelativeLayout>


            <!-- Wrap this view: -->
            <android.support.v7.widget.Toolbar
                android:id="@+id/app_bar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                android:layout_marginTop="25dp"
                android:layout_marginBottom="48dp"
                android:visibility="visible"
                android:layout_gravity="top"
                app:theme="@style/ThemeOverlay.AppCompat"
                />



            <android.support.design.widget.TabLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:tabGravity="fill"
                app:tabMode="fixed"
                app:tabIndicatorColor="@color/color_btn_login"
                app:tabTextColor="@color/color_white"
                app:tabSelectedTextColor="@color/color_btn_login"
                android:clickable="true"
                android:id="@+id/tabBD"
                android:layout_gravity="bottom"/>


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





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

这是我的布局。

    <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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">

    <ExpandableListView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/elvCategories"
        android:alwaysDrawnWithCache="true"
        android:animationCache="true"
        android:divider="@null"
        />


    <android.support.v4.widget.NestedScrollView
        android:id="@+id/bottom_sheet"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="true"
        app:behavior_hideable="true"
        android:background="@color/color_white"
        android:fitsSystemWindows="true"
        android:visibility="gone"
        app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clickable="true"
            android:id="@+id/llProductOptionsSheet"
            android:orientation="vertical"
            >

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/colorAccent"
                android:padding="10dp">


                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:id="@+id/tvProductOptionItemNameValue"
                    android:textColor="@color/color_white"
                    android:typeface="serif"
                    android:text="@string/product_name"/>


            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/rlProductOptionQuantityTxt"
                android:padding="5dp"
                android:background="@drawable/border_details">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:text="@string/quanitity"
                    android:textColor="@color/black_overlay"
                    android:id="@+id/tvProductOptionQuantityTxt"
                    android:typeface="serif"
                    android:layout_marginStart="10dp"/>

                <Spinner
                    android:layout_width="match_parent"
                    android:layout_height="40dp"
                    android:id="@+id/spinnerProductOptionQuantity"
                    android:spinnerMode="dropdown"
                    android:layout_below="@+id/tvProductOptionQuantityTxt"
                    android:layout_marginTop="5dp"
                    android:layout_marginStart="10dp"
                    android:layout_marginEnd="10dp">

                </Spinner>



            </RelativeLayout>



        </LinearLayout>

    </android.support.v4.widget.NestedScrollView>

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

因此,当滚动expeableListview时,Collapsing functionlity无法正常工作。当我滚动ExpendableListview然后它不工作。

0 个答案:

没有答案