3

Here is my code:

<android.support.design.widget.CoordinatorLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <android.support.design.widget.AppBarLayout
                android:id="@+id/app_bar_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

                <android.support.v7.widget.Toolbar
                    android:id="@+id/tool_bar"
                    android:layout_width="match_parent"
                    android:layout_height="100dp"
                    android:background="@android:color/white"
                    android:orientation="vertical"
                    app:layout_scrollFlags="scroll|enterAlways"/>

                <android.support.design.widget.TabLayout
                    android:id="@+id/tablayout"
                    android:layout_width="match_parent"
                    android:layout_height="100dp"
                    android:background="#03BCD4"/>
            </android.support.design.widget.AppBarLayout>

            <android.support.v4.widget.SwipeRefreshLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_behavior="@string/appbar_scrolling_view_behavior">

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/recyclerview"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>
            </android.support.v4.widget.SwipeRefreshLayout>

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

When the RecyclerView's Adapter getItemCount is too little, the RecyclerView can't scroll, and the toolbar is hidden.

It is hard to show the toolbar, as it always show the SwipeRefreshLayout refresh status.

Is there anything I can replace that would solve the problem?

LoveFortyDown
  • 1,011
  • 2
  • 17
  • 37
cs x
  • 621
  • 2
  • 8
  • 23
  • have you tried scroll view layout out after app bar layout. both swipe and recyceler view inside scroll view layout..? – Abhishek Jul 17 '15 at 09:09
  • i found NestedScrollSwipeRefreshLayout that implements NestedScrollingChild can solve this problem,but when the getMotionEventY is too little,it always show the SwipeRefreshLayout refresh status. – cs x Jul 18 '15 at 07:30
  • Have you found any solution? – Pratik Butani Sep 29 '15 at 08:00

0 Answers0