Integrated layout design (Scrollview, Listview ..)

I'm just wondering how to create a replica of this layout below enter image description here

I tried

public class Utility {
        public void setListViewHeightBasedOnChildren(ListView listView) {
            ListAdapter listAdapter = listView.getAdapter(); 
            if (listAdapter == null) {
                // pre-condition
                return;
            }

            int totalHeight = 0;
            for (int i = 0; i < listAdapter.getCount(); i++) {
                View listItem = listAdapter.getView(i, null, listView);
                listItem.measure(0, 0);
                totalHeight += listItem.getMeasuredHeight();
            }

            ViewGroup.LayoutParams params = listView.getLayoutParams();
            params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
            listView.setLayoutParams(params);
        }

but it sets the height of the ListView.

If you say that the HeaderView / FooterView will do the job, then also HOW ?.

If you say that the user layout (linear or relative), then I also can not use ScrollView in ScrollView.

Any other workaround?

Note . The data in the ListView will be dynamic (can be based on a query).

+3
source share
1 answer

. , , , .

.

enter image description here

+3

All Articles