Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This sort of view is absolutely possible using ListView</p> <p>You're going to need to implement your own ListAdapter with custom getView behavior. Based on the position of the view, you can either render an inactive divider view (that won't be clickable), or you can then render a gridview for the appropriate category. <a href="http://www.helloandroid.com/tutorials/how-add-divider-items-listview" rel="nofollow">This tutorial</a> can get you started on implementing custom adapters with getView.</p> <p>Here's some sample code on what getView might look like</p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; boolean isDivider = false //TODO logic here if (isDivider){ if (v == null) { LayoutInflater li = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = li.inflate(R.layout.custom_adapter_item, null); } Map&lt;String, String&gt; item = items.get(position); initView(v, item); return v; } else{ View v = null //TODO init divider view here return v; } } private void initView(View v, Map&lt;String, String&gt; item) { String[] keys = DummyData.columns; ((TextView) v.findViewById(R.id.value_left)).setText(item.get(keys[0])); ((TextView) v.findViewById(R.id.value_right)).setText(item.get(keys[1])); } </code></pre> <p>You're going to have to inflate your gridview layout where I inflate my custom_adapter_item, but this is the framework for a custom listview with complex list items</p> <p>Your view hierarchy will end up looking something like this</p> <ul> <li>ListView <ul> <li>Category1Header (LinearLayout)) <ul> <li>Title (textbox)</li> </ul></li> <li>Category1Contents (Gridview) <ul> <li>Cat1Cont1 (LinearLayout) <ul> <li>icon (image)</li> <li>description (textbox)</li> </ul></li> </ul></li> <li>Category2Header</li> </ul></li> </ul> <p>You get the idea</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload