Search code examples
androiduser-interfacegridviewfoursquaretag-cloud

How to create a gridview like Foursquare interest selection screen?


I am creating an app which requires the user to select multiple interests. I am trying to create a screen similar to the Foursquare interest selection similar to a Tag cloud where multiple buttons can be selected to represent the users interests.

I have tried creating a gridview but I'm not able to achieve the effect of buttons wrapping up to the next line.

Is there a way this can be achieved via a gridview? Is there a library which does this kind of UI?

Foursquare interest selection screenshot


Solution

  • You're looking for FlowLayout with gravity="center_horizontal". There are several implementations available, a lot of them as library projects on GitHub. Take you pick :)

    ApmeM/android-flowlayout

    blazsolar/FlowLayout

    suanmiao/flowlayout

    (descending *s)