0

I'm currently trying to implement a "grid-like" list as it can be seen in the image I have added. The idea is that when I add "groups" (Pre-Kinder A, etc.), the list will keep growing, and the overflow should modify the box's height. The problem I'm having right now is that I cannot control the way items are added to my view, I'm adding this programatically with the following code:

        LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        TagButton tagButton = new TagButton(getApplicationContext(), c);
        tagButton.setLayoutParams(lp);
        tagButton.setBackgroundResource(R.drawable.date_button);
        this.tagsButton.add(tagButton);

This is supposed to emulate sending an email, just like the gmail app.

I can't find a way of adding more groups, and instead of adding those groups to the right (which can't even be seen), I need to add them in a new "row". Any ideas on how to resolve this problem would be greately appreciated.

Here's how the application looks when I try adding lots of groups: enter image description here

Thanks in advance!

Waclock
  • 1,686
  • 19
  • 37

1 Answers1

0

Thanks to Funkystein answer, and after googling a little bit about flowlayout, I could solve my problem by following the instructions on this link:

How can I do something like a FlowLayout in Android?

Specifically downloading the project in here: https://docs.google.com/file/d/0B_VKZCqEnHblNDdiY2UxODgtYWNhNS00MmU4LWE4NDMtZjQ1OWI5MDMxZTVh/edit?num=50&sort=name&layout=list&pli=1#

After downloading the project you have to basically copy and paste the implementation on the view you want to make "flowlayout-able"

Community
  • 1
  • 1
Waclock
  • 1,686
  • 19
  • 37