diff options
author | Kaikai Wang <kaikai@google.com> | 2014-12-08 11:12:30 -0800 |
---|---|---|
committer | Kaikai Wang <kaikai@google.com> | 2014-12-08 11:12:39 -0800 |
commit | 6563b3d6f6bdee33c258a0f3139ebb97f2d23f1e (patch) | |
tree | 622d561ad4086500b3a1db27e79ceaed70dd54aa | |
parent | 1f20a74925ab5ca73b451a437a718eb72f9a22b3 (diff) | |
download | android_frameworks_opt_colorpicker-6563b3d6f6bdee33c258a0f3139ebb97f2d23f1e.tar.gz android_frameworks_opt_colorpicker-6563b3d6f6bdee33c258a0f3139ebb97f2d23f1e.tar.bz2 android_frameworks_opt_colorpicker-6563b3d6f6bdee33c258a0f3139ebb97f2d23f1e.zip |
Bug: 18538668 Fixing index in color picker content description to be zero-based
Change-Id: I026d7706b17aef774650cd0879cc9594ed856b29
-rw-r--r-- | src/com/android/colorpicker/ColorPickerPalette.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/colorpicker/ColorPickerPalette.java b/src/com/android/colorpicker/ColorPickerPalette.java index 1512213..9ca46c3 100644 --- a/src/com/android/colorpicker/ColorPickerPalette.java +++ b/src/com/android/colorpicker/ColorPickerPalette.java @@ -101,13 +101,12 @@ public class ColorPickerPalette extends TableLayout { // Fills the table with swatches based on the array of colors. TableRow row = createTableRow(); for (int color : colors) { - tableElements++; - View colorSwatch = createColorSwatch(color, selectedColor); setSwatchDescription(rowNumber, tableElements, rowElements, color == selectedColor, colorSwatch, colorContentDescriptions); addSwatchToRow(row, colorSwatch, rowNumber); + tableElements++; rowElements++; if (rowElements == mNumColumns) { addView(row); @@ -154,7 +153,7 @@ public class ColorPickerPalette extends TableLayout { int accessibilityIndex; if (rowNumber % 2 == 0) { // We're in a regular-ordered row - accessibilityIndex = index; + accessibilityIndex = index + 1; } else { // We're in a backwards-ordered row. int rowMax = ((rowNumber + 1) * mNumColumns); |