Android: List of CardView - android

How can I create a list of CardView(s) like the one in the photo? Do I need a RecyclerView or not?

if you want it to look excactly like it is in the uploaded image then you would need either a listview and an adapter with a cardview layout or a recyclerview and a cardview layout, it is basically the cardview that gives the items that good elevated feeling otherwis the rest is the same, but i suggest you use a recyclerview since google is replacing the traditional listview with all recycler, here is a great tutorial you can use http://code.tutsplus.com/tutorials/getting-started-with-recyclerview-and-cardview-on-android--cms-23465

Related

How to create multi-layered RecyclerView adapter?

In my Android project I have a complex RecyclerView. The structure of my RecyclerView looks like the attached image.
In a few words, I have a main RecyclerView which contains a CardView, within the CardView I have another RecyclerView and each element can expand and collapse.
I have tried using a nested RecyclerView implementation (which is easy to find in Google by typing "Nested RecyclerView"), but this implementation has a bottleneck. When I call onBindViewHolder it calls setAdapter method and causes a bug when I scroll the RecyclerView.
Could you please give me any tips on how to implement such RecyclerView? What is the best way of building such Recycler adapters?
Here is an image how it looks like
Here is what I found about my way of implementing RecyclerView
This can be easily done with Concat Adapter.
https://www.youtube.com/watch?v=n_mrrva_z
this is my Mockup app using Concat adapter.
Think of Concat Adpater as an arrayList. Its coded like ConcatAdapter(HeaderAdapter, Adapter2, HorizontalAdapter)

How to implement Horizontal RecyclerView With Header in my Android app

I would like to know the best approach to create an interface similar to the one in the image. I am using the FirestoreRecyclerAdapter to populate my list. Should I have a TextView for each category an then a RecyclerView under that category? I have multiple view types one for the header an one for items but I would have to know when to add a header in between the items. Also note for my purposes a item can fit multiple categories.
Here's a tutorial for implementing such RecyclerView. You might also consider looking at the github repository as well.
The idea is simple and effective which is described in the tutorial. You need a mother RecyclerView inside a NestedScrollView. The parent RecyclerView will have child RecyclerView holding the items to be shown in each row. Just follow the implementation of the SnapAdapter and the Adapter class for the mother and child RecyclerView respectively.

Expanding recycler view items

I have gone through other questions as well but couldn't figure out something. I have a well set up RecyclerView.
I m trying this library: https://github.com/AAkira/ExpandableLayout
Now I want the items to be expandable so that they show a TextView which is different for each item.
But I can't figure out how to place itms in XML. Where to place RecyclerView and where the expandable layout? How to setup these things?
Take a look at one of the samples given in the library, it is called 'examplerecyclerview' which I think is the one you need.
These are specific files that you should watch:
RecyclerView Activity and Adapter (Java)
RecyclerView Activity (XML)
RecyclerView List Row (XML)

Clickable TextViews in Staggered GridView

I am trying to show dynamic list of strings in GridView. Every word will be clickable and can be selected or deselected. I am attaching a screenshot of Flipboard as I want exactly the same functionality.
Please help me to find out the same functionality to be implemeted in my app.
The simplest way and without any external libraries you can use native components Gridview or recyclerview with GridLayoutManager
Follow this steps :
1 - Design your row item it's means the click-able labels in separated xml file.
2 - Create your adapter class to inflate view, show the data and handle clicks.
3- attach adapter to gridview or recyclerview.
And her is example for RecyclerView with GridLayoutManager and other one for Gridview
You can use this or this libraries to do this type of functionality

RecyclerView with different Cardview that hold other list in them

I have a recyclerView with two cardView one with plain text and the other with a list of data which is not specified. I have no problem creating two different view holder and set one single text data on first. The problem is how to load a list inside the 2nd cardView. Is it possible to create a list view adapter inside a recyclerView adapter ??
You should implement Custom LayoutManager for that. Refer this answer for an example and explanation of how to do that
Please post your code so that we can better understand your issue.
You can place a recycler view inside the second card view. And you can override getItemViewType() in adapter to handle the two card views.

Categories

Resources