CardView with spinner or Expandable ListView - android

Hi guys I'm trying to implement a UI which I have attached below:
please suggest me in which way should I achieve it.
1) Using Custom CardView.
2) Using Custom Expandable list View.
screen 2

If you have too much items in your list, you have to use custom expandable list view. Because, you have to implement view holder pattern for better performance. Otherwise, you can inflate Custom CardViews in a layout and change visibilities to sub items.

Related

Android Add custom items in costum ListView

I am creating a costum ListView
In this ListView I have the a list.xml with an item which has an image and three text fields.
Now to my problem :P
How can I add this custom ListView ITEM to my ListView (after a Button from another activity is clicked) and save it somewhere like in SQL...
Don't use ListView. Use RecyclerView instead.
https://developer.android.com/training/material/lists-cards.html#RecyclerView
You need to create adapter where you point proper XML file for an item
1. First, create a custom layout XML for your list row item(Image and 3 TextViews).
2. Create a custom adapter class to populate your ArrayList<OBJECT> on custom list row XML.
Here are some good tutorials:
Android Custom ListView with Image and Text
Android Custom ListView with Image and Text using Volley
Android Working with Recycler View
FYI, You can use RecyclerView instead of ListView. Android RecyclerView is more advanced version of ListView with improved performance and other benefits.
Hope this will help~

Android create mosaic in row item adapter recyclerview

I want to create item adapter with a mosaic view include multiple images.
I found some libs: AndroidMosaicLayout,
QuiltViewLibrary.
But these show on the main view. In my case, I want to show images on the item adapter recyclerview.
It's same the row on facebook row new feed.
Any help, thanks.
You cam do it using the library AndroidMosaicLayout. In the layout used for the adapter of the RecyclerView just add the view of AndroidMosiacLayout and inside the recyclerview adapter, just inflate the layout resources and access the AndroidMosiacLayout normally by assigning the required layout pattern and data. At the end the AndroidMosiacLayout it is just a NestedScrollView, so you can use it the same way you use any other view or view group.

Alternate for a listview with single row

I have a ImageView with a TextView and Button. I have it currently in a custom list view, but I noticed now that I don't need to show more as one element (object). So I actually don't need a Listview to show the row (list entry). How can I show the list entry without a Listview?
You can put the elements of your custom listview item into a Layout, e.g. LinearLayout and simply add it to your activity's layout where you needed it.
You can set an OnClickListener for that layout, so user can click the whole thing.
I think you should use ListActivity. Then you can set up empty view for list. Here some tutorial: ListActivity and ListView Tips.
Also you can implement that logic with Recycler view by yourself or use library.
Here is solution from stackoverflow

How to add elements to expandable menu?

I want to have an expandable menu, and when you expand a child item, then it will show some custom items, items of my choice, like a text input field or a checkbox (see the image below).
Now how can I achieve that? Can I achieve that using the Eclipse GUI builder? Or do I have to create methods where the data is loaded dynamically?
UPDATE:
So I do not only want text items as child elements, but all sorts of elements, like an input field or checkbox.
This tutorial works like charm
http://myandroidsolutions.blogspot.in/2012/08/android-expandable-list-example.html
i also took code from here to make my custom expandable UI by implementing adapter

Display only child items in Expandable list No need of parent indicator

Hi i am displaying items according to different categories using Expandable Listview.Now I want to display only items ,No need of parent name or parent indicator.is there any solution from expandable list view to diplay only child items .I don't have time Thats y i am displaying items from expandable list view(I am alredy developed this one) .So please give me some suggestions.It is very urgent.thanks in advance
I think you cannot have child view without group view in ExpandableListView. Which adapter you are using for populating group and child view?
You should use lisview instead which is easy to used.

Categories

Resources