code: private void setSwatchDescription(int rowNumber, int index, int rowElements, boolean selected,
              View swatch) {
          int accessibilityIndex;
          if (rowNumber % 2 == 0) {
              // We're in a regular-ordered row
              accessibilityIndex = index;
          } else {
              // We're in a backwards-ordered row.
              int rowMax = ((rowNumber + 1) * mNumColumns);
              accessibilityIndex = rowMax - rowElements;
          }
  
          String description;
          if (selected) {
              description = String.format(mDescriptionSelected, accessibilityIndex);
          } else {
              description = String.format(mDescription, accessibilityIndex);
          }
          swatch.setContentDescription(description);
      }
docs: Add a content description to the specified swatch view. Because the colors get added in a
  snaking form, every other row will need to compensate for the fact that the colors are added
  in an opposite direction from their left->right/top->bottom order, which is how the system
  will arrange them for accessibility purposes.