android-flowlayout
android-flowlayout copied to clipboard
Support for `setAdapter` ?
So it is possible/simpler to build child views using the standard Android's Adapter pattern.
This is what I use right now:
FlowLayout newsFlow = views.find(view, R.id.flow_news);
int count = adapter.getCount();
for (int i = 0; i < count; i++) {
newsFlow.addView(adapter.getView(i, null, newsFlow));
}
But obviously this logic belongs in the flow layout, not the activity or fragment that's using it. There are also other nuances that'll be needed such as auto-updating when the backing store gets updated with new items.
+1 for this
Please add adapter feature.
That would be neat. I imagine that would not be easy, but it would be cool. I did something similar.
On Wed, Apr 1, 2015 at 12:06 AM, frodberserk [email protected] wrote:
Please add adapter feature.
— Reply to this email directly or view it on GitHub https://github.com/ApmeM/android-flowlayout/issues/14#issuecomment-88351603 .
Sorry, I have tried to understand how adapters should work inside the layout but failed. Can somebody create a pull request for this issue (at least for horizontal view without gravity etc, as an example so I can extend it and add to this project).
Now with recycling view setAdapter can be used.