Step 1: Open android studio. Go to File- new -Activity- Empty activity- name it Tasklongpress.
Step 2: Go to the res folder.
Step 3:Paste below code to tasklongpress.xml.
Step 4:Add recyclerview library to bulid.gradle. File-project structure-Dependencies-All dependencies- click on + and search for recyclerview library-press ok.
Step 5:Add cardview library to bulid.gradle. File-project structure-Dependencies-All dependencies- click on + and search for cardview library-press ok.
Step 6:Add makerman rounded imageview library to bulid.gradle.
implementation ‘com.makeramen:roundedimageview:2.3.0’

Paste below code to tasklongpress.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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".Task_longpress">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none">

        <LinearLayout
            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:alpha="0.1"
                android:orientation="vertical">

                <include layout="@layout/toolbar" />

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/recycler_traffic"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:clipToPadding="false"
                    android:paddingBottom="39.2dp" />

            </LinearLayout>

            <android.support.v7.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="20.6dp"
                android:layout_marginRight="20.6dp"
                android:layout_marginBottom="20.6dp"
                app:cardCornerRadius="9.6dp"
                app:cardElevation="1dp">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:paddingTop="22.1dp"
                    android:paddingBottom="22.1dp">

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="25.4dp"
                        android:layout_marginRight="23.3dp"
                        android:orientation="vertical">

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_weight="1"
                                android:fontFamily="@font/helveticaneue"
                                android:text="Product page UX research"
                                android:textColor="#6a6a77"
                                android:textSize="15.4sp" />

                            <ImageView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:src="@drawable/more" />


                        </LinearLayout>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="4.6dp"
                            android:fontFamily="@font/helveticaneue"
                            android:text="on July 1, 2016 9:43 AM"
                            android:textColor="#88889c"
                            android:textSize="10.6sp"/>

                        <View
                            android:layout_width="match_parent"
                            android:layout_height="1dp"
                            android:layout_marginTop="18.6dp"
                            android:background="#f0f0f0" />

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="18.9dp"
                            android:orientation="horizontal">

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_weight="1"
                                android:orientation="horizontal">

                                <com.makeramen.roundedimageview.RoundedImageView xmlns:app="http://schemas.android.com/apk/res-auto"
                                    android:id="@+id/imageView1"
                                    android:layout_width="34.6dp"
                                    android:layout_height="34.6dp"
                                    android:scaleType="fitCenter"
                                    android:src="@drawable/profile"
                                    app:riv_corner_radius="4.8dip" />

                                <com.makeramen.roundedimageview.RoundedImageView xmlns:app="http://schemas.android.com/apk/res-auto"
                                    android:id="@+id/imageView2"
                                    android:layout_width="34.6dp"
                                    android:layout_height="34.6dp"
                                    android:layout_marginLeft="4.4dp"
                                    android:scaleType="fitCenter"
                                    android:src="@drawable/profile"
                                    app:riv_corner_radius="4.8dip" />

                                <com.makeramen.roundedimageview.RoundedImageView xmlns:app="http://schemas.android.com/apk/res-auto"
                                    android:id="@+id/imageView3"
                                    android:layout_width="34.6dp"
                                    android:layout_height="34.6dp"
                                    android:layout_marginLeft="4.4dp"
                                    android:scaleType="fitCenter"
                                    android:src="@drawable/profile"
                                    app:riv_corner_radius="4.8dip" />
                            </LinearLayout>


                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="right"
                                android:gravity="right"
                                android:orientation="vertical">

                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:drawablePadding="6.4dp"
                                    android:drawableLeft="@drawable/ic_time"
                                    android:fontFamily="@font/helveticaneue"
                                    android:text="Time tracked:"
                                    android:textColor="#6a6a77"
                                    android:textSize="11.5sp" />

                                <LinearLayout
                                    android:layout_marginTop="3.8dp"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:orientation="horizontal">

                                    <TextView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:fontFamily="@font/helveticaneue"
                                        android:text="12:46"
                                        android:textColor="#4951ff"
                                        android:textSize="20.2sp" />

                                    <TextView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:fontFamily="@font/helveticaneue"
                                        android:text="h"
                                        android:textColor="#774951ff"
                                        android:textSize="16.3sp" />

                                </LinearLayout>


                            </LinearLayout>

                        </LinearLayout>

                    </LinearLayout>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:layout_marginTop="18.6dp"
                        android:background="#f0f0f0" />

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="25.4dp"
                        android:layout_marginTop="20.6dp"
                        android:layout_marginRight="23.3dp"
                        android:layout_marginBottom="30.2dp"
                        android:lineSpacingExtra="7dp"
                        android:text="Attending a trade show can be a very effective method of\npromoting your company and its products. And one of\nthe most effective ways to optimize your trade show\ndisplay and increase traffic to your booth is through the\nuse of banner stands."
                        android:textColor="#9ea4af"
                        android:textSize="10.1sp" />

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#f0f0f0" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="25.4dp"
                        android:layout_marginTop="25dp"
                        android:drawableLeft="@drawable/check_1"
                        android:drawablePadding="12dp"
                        android:fontFamily="@font/helveticaneue"
                        android:gravity="center"
                        android:text="Competition analysys"
                        android:textColor="#9ea4af"
                        android:textSize="10.1sp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="25.4dp"
                        android:layout_marginTop="9.6dp"
                        android:drawableLeft="@drawable/check_1"
                        android:drawablePadding="12dp"
                        android:fontFamily="@font/helveticaneue"
                        android:gravity="center"
                        android:text="Wireframes review"
                        android:textColor="#9ea4af"
                        android:textSize="10.1sp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="28dp"
                        android:layout_marginTop="9.6dp"
                        android:drawableLeft="@drawable/check_2"
                        android:drawablePadding="12dp"
                        android:fontFamily="@font/helveticaneue"
                        android:gravity="center"
                        android:text="Sumup meeting"
                        android:textColor="#9ea4af"
                        android:textSize="10.1sp" />


                </LinearLayout>


            </android.support.v7.widget.CardView>

        </LinearLayout>

    </ScrollView>

</LinearLayout>

Create Model Class.

Step 1: Create package ModelClass.
Step 2: Add Java class – TrafficModel.
Step 3: Add textview id n imageview id.
Step 4: Create Constructor. AND Create getter setter method.

package com.wolfsoft.avsc.model;


public class TrafficModel {

    Integer imgbag;

    String txtconversion;


    public Integer getImgbag() {
        return imgbag;
    }

    public void setImgbag(Integer imgbag) {
        this.imgbag = imgbag;
    }

    public String getTxtconversion() {
        return txtconversion;
    }

    public void setTxtconversion(String txtconversion) {
        this.txtconversion = txtconversion;
    }

    public TrafficModel(Integer imgbag, String txtconversion) {
        this.imgbag = imgbag;
        this.txtconversion = txtconversion;
    }
}

Create Adapter

Step 1: Create package Adapter.
Step 2: Add Java class – TrafficAdapter.
Step 3: Implement Methods.
Step 4:Paste Below Code to tTrafficAdapter.

package com.wolfsoft.avsc.adapter;

import android.content.Context;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.wolfsoft.avsc.R;
import com.wolfsoft.avsc.model.TrafficModel;
import java.util.ArrayList;


public class TrafficAdapter extends RecyclerView.Adapter<TrafficAdapter.ViewHolder> {

    int myPos=0;

    Context context;
    private ArrayList<TrafficModel> trafficModelArrayList;

    public TrafficAdapter(Context context, ArrayList<TrafficModel> trafficModelArrayList) {
        this.context = context;
        this.trafficModelArrayList = trafficModelArrayList;
    }

    @NonNull
    @Override
    public TrafficAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_traffic,parent,false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull final TrafficAdapter.ViewHolder holder, final int position) {

        holder.imgbag.setImageResource(trafficModelArrayList.get(position).getImgbag());
        holder.txtconversion.setText(trafficModelArrayList.get(position).getTxtconversion());

        if (position==myPos){
            //  holder.card.setCardElevation(35);
         // holder.card.setOutlineSpotShadowColor(Color.parseColor("#000bff"));
            holder.imgbag.setColorFilter(Color.parseColor("#ffffff"));
            holder.txtconversion.setTextColor(Color.parseColor("#ffffff"));
            holder.card.setBackgroundResource(R.drawable.rect_blue); }

        else {

//            holder.card.setCardElevation(35);
//            holder.card.setOutlineSpotShadowColor(Color.parseColor("#808080"));
            holder.imgbag.setColorFilter(Color.parseColor("#bdc1c9"));
            holder.txtconversion.setTextColor(Color.parseColor("#6a6a77"));
            holder.card.setBackgroundResource(R.drawable.rect_white);
        }
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                myPos = position;
                notifyDataSetChanged();
            }
        });
    }

    @Override
    public int getItemCount() {
        return trafficModelArrayList.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {


        ImageView imgbag,one;

        TextView txtconversion;

         CardView card;

        public ViewHolder(View itemView) {

            super(itemView);


            imgbag=itemView.findViewById(R.id.imgbag);
            txtconversion=itemView.findViewById(R.id.txtconversion);
            card=itemView.findViewById(R.id.card);
            one=itemView.findViewById(R.id.one);
       }
    }
}

Taklongpress.java

paste the below code to Tasklongpress.java

package com.wolfsoft.avsc;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.wolfsoft.avsc.adapter.TrafficAdapter;
import com.wolfsoft.avsc.model.TrafficModel;

import java.util.ArrayList;

public class Task_longpress extends AppCompatActivity {


    private TrafficAdapter trafficAdapter;
    private ArrayList<TrafficModel> trafficModelArrayList;
    private RecyclerView recyclerView;


    Integer[] imgbag = {R.drawable.traffic, R.drawable.ic_done
            , R.drawable.ic_notification, R.drawable.ic_point_of_sale,
            R.drawable.ic_done, R.drawable.ic_clock};

    String[] txtconversion = {"Traffic", "Conversion",
            "Alerts", "Points of Sale",
            "Tasks", "Meetings"};


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_task_longpress);

        recyclerView = findViewById(R.id.recycler_traffic);
        RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(Task_longpress.this, LinearLayoutManager.HORIZONTAL, false);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setItemAnimator(new DefaultItemAnimator());

        trafficModelArrayList = new ArrayList<>();

        for (int i = 0; i < imgbag.length; i++) {
            TrafficModel view1 = new TrafficModel(imgbag[i], txtconversion[i]);
            trafficModelArrayList.add(view1);

        }

        trafficAdapter = new TrafficAdapter(Task_longpress.this, trafficModelArrayList);
        recyclerView.setAdapter(trafficAdapter);




    }
}