From b2e551711aa93a3d296ced6368e895743d43da80 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Sat, 15 Jan 2011 17:21:35 -0800 Subject: [PATCH] Fix bug 3355197 - Add attribute for fast scroll preview panel text color. Text color for the fast scroll panel is dependent on its background, which is already configurable within the theme. Change-Id: I6ac3018116f078b7567888d75fa34ffd250d2f92 --- api/current.xml | 13 ++++++++++++- core/java/android/widget/FastScroller.java | 6 +++--- core/res/res/values/attrs.xml | 3 +++ core/res/res/values/public.xml | 1 + core/res/res/values/themes.xml | 1 + 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/api/current.xml b/api/current.xml index 86c47f589e536..68d3187dce0a2 100644 --- a/api/current.xml +++ b/api/current.xml @@ -4250,6 +4250,17 @@ visibility="public" > + + - + diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java index d4ef044c6a18e..dfa94c75aaaa3 100644 --- a/core/java/android/widget/FastScroller.java +++ b/core/java/android/widget/FastScroller.java @@ -56,7 +56,7 @@ class FastScroller { private static final int[] DEFAULT_STATES = new int[0]; private static final int[] ATTRS = new int[] { - android.R.attr.textColorPrimary, + android.R.attr.fastScrollTextColor, android.R.attr.fastScrollThumbDrawable, android.R.attr.fastScrollTrackDrawable, android.R.attr.fastScrollPreviewBackgroundLeft, @@ -64,7 +64,7 @@ class FastScroller { android.R.attr.fastScrollOverlayPosition }; - private static final int PRIMARY_TEXT_COLOR = 0; + private static final int TEXT_COLOR = 0; private static final int THUMB_DRAWABLE = 1; private static final int TRACK_DRAWABLE = 2; private static final int PREVIEW_BACKGROUND_LEFT = 3; @@ -247,7 +247,7 @@ class FastScroller { mPaint.setTextAlign(Paint.Align.CENTER); mPaint.setTextSize(mOverlaySize / 2); - ColorStateList textColor = ta.getColorStateList(PRIMARY_TEXT_COLOR); + ColorStateList textColor = ta.getColorStateList(TEXT_COLOR); int textColorNormal = textColor.getDefaultColor(); mPaint.setColor(textColorNormal); mPaint.setStyle(Paint.Style.FILL_AND_STROKE); diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 02855b5405caf..19e2b8d9c937d 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -544,6 +544,9 @@ + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 9b88b015d3ad2..e73486defea80 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1425,6 +1425,7 @@ + diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index 971719ee25f91..71745e0fb0697 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -294,6 +294,7 @@ @android:drawable/menu_submenu_background @android:drawable/menu_submenu_background floating + @android:color/primary_text_dark