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
Related
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.
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)
I was wondering how to implement the listview like the android market.
in the right hand panel a listview is divided into the two rows. This is very useful because it saves lot of space and user can look at almost double items in the listview at a time. how can I implement this ? any suggestions?
you can use GridView instead of ListView of two columns..
1. GridView
2. GridViewExample
Sample design :
The Android Market also uses the ViewPager to scroll between the pages. Here is an example on how you could implement it.
There is another question that is related to this one.Check the folling link, it might help you:
How to display a two column ListView in Android?
Modify you *.xml file to get what you want.
Good luck!
If you want to do this using listView, then each item (row) in the list view should consist of two views. You can do this using a relative layout (or linear layout) with two items side by side.
You can also implement this using a gridview having two columns.
I am trying to make a recipe ListView for food and I want to add imageViews next to items in my list. How can i do that? Thx.
A ListView item can have it's own custom layout.
You have to create your adapter for the ListView. When you create your adapter you can assign your custom layout.
Note: You will have to implement getView() to property set the image+text.
Here you have a sample: Lazy load of images in ListView
Following this tutorial could be a nice idea for you (mainly the second example).
http://www.mkyong.com/android/android-listview-example/
But anyway, you should Google a little bit before asking such a basic question.
I am working in android. I want to show a list of events. I can make this list using listView.
But i want to add Day just before the list of events. Means i have two arrayList
for Name of days
for name of events for a day
So please suggest me how can i implement this.? you can provide me link related this topic or give a code help.
I need like this :---
Thank you in advance.
You can either use Sectioned ListView(You have to customize ListView) or Expandable ListView(inbuilt).
Sectioned ListView examples:
Android – Sectioned Headers in ListViews ,
ListView Tips & Tricks #2: Section your ListView
Expandable ListView examples:
ExpandableListView on Android
Steps to implement ExpandableListView in android - Check the Step - 2 in this example, same way groups[] and children[][], you can implement your 2 arraylists accordingly.
You can use a SimpleAdapter and bind the Name of the days to one TextView and the event name to another TextView. Your xml layout will then just be a LinearLayout, oriented horizontally, with two TextViews in it. Here's an example.