I am looking for any library that help me to make a FlowLayout with adapter, like GridView, but i want to arrange elements in flow! What do you think, what is the best way to do that (FreeFlow)? I have created a StickyListHeadersListView with adapter:
@Override
public View getView(int position, View convertView, final ViewGroup parent) {
FiltersChildViewHolder holder;
if (convertView == null) {
final View[] temp = new View[1];
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
temp[0] = mInflater.inflate(R.layout.item_filters_layout, parent, false);
}
});
convertView = temp[0];
holder = new FiltersChildViewHolder();
holder.flFilters_IFL = (FlowLayout) convertView.findViewById(R.id.flFilters_IFL);
convertView.setTag(holder);
} else {
holder = (FiltersChildViewHolder) convertView.getTag();
}
ArrayList<FilterModel> filterModels = getFiltersForCategory(position);
FilterLayoutAdapter adapter = new FilterLayoutAdapter(mActivity, filterModels);
adapter.setOnFiltersChangedListener(mFiltersChangedListener);
adapter.setIsDefault(isDefault);
holder.flFilters_IFL.setAdapter(adapter);
return convertView;
}
This is the getView() method in my adapter! Every list item is a FlowLayout, and the FilterLayoutAdapter will add views to this FlowLayout, this works for me, in this way the elements are arranged in flow, but the ListView is very freezy when I scroll to the next list item, because all childView are inflated immediatelly in FlowLayout and thera are 100 childView!