GridView With CardView , Search and ClickListener

GridView With CardView, Search / Filter and OnClickListner, GridView Items will Contain CardView, Image, Text, and Description. When clicked a new activity opens and displays the image and name of the clicked item. You can also perform search/filter within the gridview items either by name or description

Tutorial divided in 3 parts:

PART 1:
Create GridView with Image, text and Description:

Here we shall learn how to:

  1. Add gridview in our activity.
  2. Adding cardveiw library in our build gradle
  3. Create layout that will hold gridview items ( image, name, description ) in a cardview
    create a modal that will hold data
  4. Create Adapter class that will extend BaseAdapter ( this link data source to our gridview )
  5. Copy and Past our images
  6. Display our gridview

PART 2:
Adding Search/Filter to Our GridView:

Here we shall learn how to:

  1. Add menu items in adnroid studio
  2. Inflate menu item and display in our activity oncreate method.
  3. Implement filterable method in our adapter.
  4. Add another list of items that will contain filtered items.
  5. Perform the filter in our gridview.

Part 3:
Adding OnclickListener in our GridView:

Here we shall learn how to:

  1. Listen to the clicked gridview item.
  2. Create a new activity that will open when gridview item is clicked
  3. Open new activity when gridview is clicked
  4. Pass Data from clicked Grid Item to our new activity.

Related GridLayout with CardView:https://larntech.net/gridview-with-cardview-and-onclicklistener/

Android Docs GridView: https://developer.android.com/reference/android/widget/GridView

If you need additional help, Kindly comment below.

For source code of the whole project , You can get it for only $5 to support this work.

GET SOURCE CODE FOR ONLY $5

2 Comments