1

I want to implement same scrolling effect as in bigbasket application product list

for example here are the images
image before scrolling

https://i.stack.imgur.com/cdBxX.png

image after scrolling

enter image description here

I have followed these links

link1

link2

None of them help me

here is the code for my activity_container and product list layout

   <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            android:fitsSystemWindows="true">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

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

        <FrameLayout
            android:id="@+id/activity_content"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            android:layout_width="match_parent"
            android:layout_height="match_parent"></FrameLayout>

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


    <android.support.design.widget.NavigationView
        android:id="@+id/navigationView"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/nav_header"
        app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>

productlist.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/coordinator"
    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:orientation="vertical">

        <TextView
            android:id="@+id/category_name"
            android:layout_width="wrap_content"
            android:layout_height="30dp"
            android:layout_gravity="center"
            android:textColor="@color/black"
            android:layout_marginTop="5dp"
            android:textSize="15sp"
            android:textStyle="bold" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:background="#D8D8D8"
            android:orientation="horizontal"
            android:weightSum="5">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter1"
                android:textColor="@android:color/black" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter2"
                android:textColor="@android:color/black" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter3"
                android:textColor="@android:color/black" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter4"
                android:textColor="@android:color/black" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="5dp"
                android:layout_weight="1"
                android:background="@drawable/item_shape"
                android:elevation="5dp"
                android:gravity="center"
                android:text="Filter5"
                android:textColor="@android:color/black" />
        </LinearLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="#E8E8E8">

            <TextView
                android:id="@+id/prdct_count"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentStart="true"
                android:layout_marginStart="20dp"
                android:layout_marginTop="15dp"
                android:textColor="@android:color/black"
                android:textSize="15sp" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_marginEnd="15dp"
                android:layout_marginTop="3dp"
                android:drawablePadding="2dp"
                android:drawableTop="@drawable/filter"
                android:text="@string/filter"
                android:textColor="#404040"
                android:textSize="15sp" />
        </RelativeLayout>


        <android.support.v7.widget.RecyclerView
            android:id="@+id/subscriptList"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scrollbars="vertical"
            android:visibility="visible"></android.support.v7.widget.RecyclerView>
    </LinearLayout>


    <TextView
        android:id="@+id/empty_list_msg"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center_vertical"
        android:textColor="@android:color/black"
        android:textSize="20sp"
        android:visibility="gone" />
</LinearLayout>
Sandeep dhiman
  • 1,863
  • 2
  • 17
  • 22

0 Answers0