summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaikai Wang <kaikai@google.com>2014-12-09 23:19:11 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-12-09 23:19:11 +0000
commit3c2f9f9de050ebb8a44b1b3d00d63074947339e1 (patch)
treed0589521f99961b43b12ee263fda544434d86f86
parentf7c6f5c7a1c5ff8de3c5570770f8fc732b021b48 (diff)
parentf2c5894c9accb5d860195ff483c739662ae63f2a (diff)
downloadandroid_frameworks_opt_colorpicker-3c2f9f9de050ebb8a44b1b3d00d63074947339e1.tar.gz
android_frameworks_opt_colorpicker-3c2f9f9de050ebb8a44b1b3d00d63074947339e1.tar.bz2
android_frameworks_opt_colorpicker-3c2f9f9de050ebb8a44b1b3d00d63074947339e1.zip
am f2c5894c: am 6563b3d6: Bug: 18538668 Fixing index in color picker content description to be zero-based
* commit 'f2c5894c9accb5d860195ff483c739662ae63f2a': 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);