2

I am really confused, which among GridView, Tableview or multiple listview to be used to develop a UI as shown in below image.

I don't know how much list data (categories and its sub categories) is in web. It is dynamically added from wed, and sent to my android app. enter image description here

Please suggest me, what view is best for developing above UI.

Note: I want to make it programmatically.

Thank you in advance for your co-operation.

1

2 Answers 2

1

Keep in mind that the image you have shown as an example is quite large and such an implementation would make for a cluttered UI on smaller screen sizes. That being said, the example you provided could be achieved in Android by using a GridView. Each major category (Automotive, Jobs, etc.) would be a grid item, with the sub element implemented as either a TextView or even a ListView within the grid item. Something like this:

enter image description here

As both @PedroHawk and @bryan mentioned, you could also use an ExpandableListView; in this scenario, the major categories (Automotive, Jobs, etc.) would be header items and the sub elements would be children of the header. Something like this:

enter image description here

However, with this implementation you would be limited to a one-dimensional list - that is you would not be able to have major categories next to each other as shown in your example.

With both of these implementations (ExpandableListView and GridView) you can dynamically add more elements as you receive data.

Sign up to request clarification or add additional context in comments.

Comments

0

Like PedroHawk said, ExpandableListView is an option. But also consider because of the screen size, you may not want to try and port the UI directly over. What about a single ListView with just the main categories and the user can drill down?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.