My app needs a display with repeating pattern. Think a chess board where pieces can move within a square but not from one square to the next. Each cell is independent from the others. Each cell has a fixed size. Larger displays accommodate more cells. A typical screen might have one or two hundred of these cells.
Each cell can be an independent Java object, so my initial idea it to make a View
subclass for the cell and pack them into a ViewGroup
. On the other hand, the cells don't really play the Android layout game in the sense that they have a fixed size in pixels and cannot grow or shrink their size to accommodate different layouts. From this PoV, it makes sense to make one big View
that can draw all of these cells. The CellArray
view can then grow and shrink as the layout engine requests.
Which approach seems more natural?