summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaikai Wang <kaikai@google.com>2014-12-08 19:45:35 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-08 19:45:35 +0000
commitf2c5894c9accb5d860195ff483c739662ae63f2a (patch)
tree622d561ad4086500b3a1db27e79ceaed70dd54aa
parent63fb4a209ef45bc777a22b99da42e8168ba13d6e (diff)
parent6563b3d6f6bdee33c258a0f3139ebb97f2d23f1e (diff)
downloadandroid_frameworks_opt_colorpicker-f2c5894c9accb5d860195ff483c739662ae63f2a.tar.gz
android_frameworks_opt_colorpicker-f2c5894c9accb5d860195ff483c739662ae63f2a.tar.bz2
android_frameworks_opt_colorpicker-f2c5894c9accb5d860195ff483c739662ae63f2a.zip
am 6563b3d6: Bug: 18538668 Fixing index in color picker content description to be zero-based
* commit '6563b3d6f6bdee33c258a0f3139ebb97f2d23f1e': Bug: 18538668 Fixing index in color picker content description to be zero-based
-rw-r--r--src/com/android/colorpicker/ColorPickerPalette.java5
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);