I have a problem with the recyclerview. Actually it's working on Activity without any lags but not on fragment inside scrollview or nestedscrollview. I have done several experiments on it but all of them just landed me to the laggy recyclerview. Then I used Appbarlayout behavior, almost I have achieved smooth recyclerview but when I scroll to bottom, and when I come back to the top, and want to scroll back to the bottom, not works. What problem is occurring? please help me out on this.
My Code FragmentHome.xml
<?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">
            <!-- Latest Images -->
            <LinearLayout
                android:id="@+id/latestPost"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">
                    <com.makeramen.roundedimageview.RoundedImageView
                        android:layout_width="4dp"
                        android:layout_height="match_parent"
                        android:layout_marginBottom="2dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginStart="10dp"
                        android:layout_marginTop="2dp"
                        android:scaleType="centerCrop"
                        android:src="@color/gradient_color_1"
                        app:riv_corner_radius="2dp" />
                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:fontFamily="@font/font_reg"
                        android:text="Latest Post"
                        android:textColor="@color/black"
                        android:textSize="18sp" />
                </LinearLayout>
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                    <android.support.v7.widget.RecyclerView
                        android:id="@+id/recyclerView_latest"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="10dp"
                        android:layout_marginStart="10dp"
                        android:layout_marginTop="10dp" />
                </RelativeLayout>
            </LinearLayout>
        </LinearLayout>
        <fr.castorflex.android.circularprogressbar.CircularProgressBar
            android:id="@+id/pb_home"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_centerInParent="true"
            android:indeterminate="true"
            android:visibility="gone"
            app:cpb_color="#FFee44"
            app:cpb_colors="@array/pocket_bar_colors"
            app:cpb_max_sweep_angle="300"
            app:cpb_min_sweep_angle="10"
            app:cpb_rotation_speed="1.0"
            app:cpb_stroke_width="4dp"
            app:cpb_sweep_speed="1.0" />
    </RelativeLayout>
    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        app:liftOnScroll="true">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:layout_scrollFlags="scroll|enterAlways">
            <LinearLayout
                android:id="@+id/ll_home_featured"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
                <android.support.v4.view.ViewPager
                    android:id="@+id/vp_home"
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:layout_marginTop="10dp" />
                <com.rd.PageIndicatorView
                    android:id="@+id/pageIndicatorView"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:padding="10dp"
                    app:piv_animationType="color"
                    app:piv_autoVisibility="true"
                    app:piv_dynamicCount="true"
                    app:piv_interactiveAnimation="true"
                    app:piv_padding="4dp"
                    app:piv_radius="5dp"
                    app:piv_selectedColor="@color/vp_indicator"
                    app:piv_unselectedColor="#B5B5B7"
                    app:piv_viewPager="@id/vp_home" />
            </LinearLayout>
            <LinearLayout
                android:id="@+id/ll_home_pop"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">
                    <com.makeramen.roundedimageview.RoundedImageView
                        android:id="@+id/iv2"
                        android:layout_width="4dp"
                        android:layout_height="match_parent"
                        android:layout_marginBottom="2dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginStart="10dp"
                        android:layout_marginTop="2dp"
                        android:scaleType="centerCrop"
                        android:src="@color/gradient_color_1"
                        app:riv_corner_radius="2dp" />
                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="5dp"
                        android:layout_marginTop="5dp"
                        android:layout_weight="1"
                        android:orientation="vertical">
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/font_reg"
                            android:text="@string/popular_quotes"
                            android:textColor="@color/black"
                            android:textSize="18sp" />
                        <TextView
                            android:id="@+id/tv_no_pop"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/font_light"
                            android:text="10 Quotes"
                            android:textSize="12sp" />
                    </LinearLayout>
                    <android.support.v7.widget.AppCompatButton
                        android:id="@+id/button_all_popular"
                        android:layout_width="wrap_content"
                        android:layout_height="45dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginStart="10dp"
                        android:fontFamily="@font/font_reg"
                        android:text="@string/more"
                        android:textColor="@color/white"
                        app:backgroundTint="@color/gradient_color_1" />
                </LinearLayout>
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                    <View
                        android:layout_width="30dp"
                        android:layout_height="200dp"
                        android:layout_alignParentEnd="true"
                        android:layout_alignParentRight="true"
                        android:background="@drawable/bg_gradient_white" />
                    <android.support.v7.widget.RecyclerView
                        android:id="@+id/rv_home_popular"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="10dp"
                        android:layout_marginStart="10dp"
                        android:layout_marginTop="10dp" />
                </RelativeLayout>
            </LinearLayout>
        </LinearLayout>
    </android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
