code: private void addSwatchToRow(TableRow row, View swatch, int rowNumber) {
          if (rowNumber % 2 == 0) {
              row.addView(swatch);
          } else {
              row.addView(swatch, 0);
          }
      }
docs: Appends a swatch to the end of the row for even-numbered rows (starting with row 0),
  to the beginning of a row for odd-numbered rows.