I am developing an Android app. In my app, I am using Recycler View. This is my very first time of using Recycler View. I using it together with CardView. The reason why I am using recycler view is I want to remove row by swiping left or right. But I cannot find event to do it in Recycler View. How can I set it? Is it built-in included in Recycler View?

I installed using grandle like this

```
 compile 'com.android.support:cardview-v7:23.0.+'

 compile 'com.android.support:recyclerview-v7:23.0.+'

```

This is my adapter

```
public class CardAdapter extends RecyclerView.Adapter<CardAdapter.MyViewHolder> {

    private ArrayList<CardData> values;

    public CardAdapter(ArrayList<CardData> valuesPram)
    {
        this.values = valuesPram;
    }

    public class MyViewHolder extends RecyclerView.ViewHolder {
        public TextView name,email;

        public MyViewHolder(View view) {
            super(view);
            name = (TextView) view.findViewById(R.id.card_name);
            email = (TextView)view.findViewById(R.id.card_email);
        }
    }

    @Override
    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View itemView = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.cards_layout, parent, false);

        return new MyViewHolder(itemView);
    }

    @Override
    public void onBindViewHolder(MyViewHolder holder, int position) {
        CardData cardData = values.get(position);
        holder.email.setText(cardData.getEmail());
        holder.name.setText(cardData.getName());
    }

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

```

This is my row layout

```
<android.support.v7.widget.CardView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    card_view:cardBackgroundColor="@color/colorAccent"
    card_view:cardCornerRadius="10dp"
    card_view:cardElevation="5dp"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <TextView
            android:id="@+id/card_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <TextView
            android:id="@+id/card_email"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>
</android.support.v7.widget.CardView>

```

This is my activity

```
public class MainActivity extends AppCompatActivity {

    private RecyclerView recyclerView;
    private RecyclerView.LayoutManager layoutManager;
    private ArrayList<Integer> removedItems;

    private ArrayList<CardData> listItems;
    private CardAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initializeData();
        setUpRecyclerView();
    }

    private void setUpRecyclerView()
    {
        recyclerView = (RecyclerView)findViewById(R.id.my_recycler_view);
        recyclerView.setHasFixedSize(true);
        layoutManager = new LinearLayoutManager(this);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        recyclerView.setAdapter(adapter);

    }

    private void initializeData()
    {
        listItems = new ArrayList<CardData>();
        CardData item1 = new CardData();
        item1.setName("Name 1");
        item1.setEmail("Email 1");
        listItems.add(item1);
        CardData item2 = new CardData();
        item2.setName("Name 2");
        item2.setEmail("Email 2");
        listItems.add(item2);
        CardData item3 = new CardData();
        item3.setName("Name 3");
        item3.setEmail("Email 3");
        listItems.add(item3);
        CardData item4 = new CardData();
        item4.setName("Name 4");
        item4.setEmail("Email 4");
        listItems.add(item4);
        adapter = new CardAdapter(listItems);
    }

    private void removeItem(View v)
    {
        int selectedItemPosition = recyclerView.getChildPosition(v);
        RecyclerView.ViewHolder viewHolder = recyclerView.findViewHolderForPosition(selectedItemPosition);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

```

My code is working fine. My question is how can I implement event for removing item by swiping left or right to one of the rows of recycler view?