-1

I'm setting up an android app that will display data like this:

Line Name        X    GGGGRR
Another Name     Y    GGGRRR
...
Last Name        Z    GGRRRR

where the names and x, y, z numbers are TextViews and the Gs and Rs are ImageViews showing red and green circles.

What's the best way to lay this out? I think putting the list in a vertical LinearLayout makes sense. I don't want to repeat a bunch of LinearLayouts containing TextViews and ImageViews in the XML, because I might need to adjust the number of entries dynamically. What's the best way to encapsulate these lines? Should I create a custom layout for it? Or would it be better to use a fragment for each line?

kwiqsilver
  • 1,017
  • 2
  • 11
  • 24

1 Answers1

1

You sholud use a custom layout with textviews and imageviews as you said and you can use ListView or RecycleView for the list.

Federico Blumetto
  • 967
  • 1
  • 7
  • 12