summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-09-29 01:05:51 -0700
committerDianne Hackborn <hackbod@google.com>2009-09-29 11:02:39 -0700
commitb6eaaa2ab2a43193b6fec3790a7e413b8e28733a (patch)
tree5709842a2463304fc1ecb0e175bc7829a12b0808
parent490d5222ae985f7e606cdf503d292062c80e7328 (diff)
downloadframeworks_base-b6eaaa2ab2a43193b6fec3790a7e413b8e28733a.zip
frameworks_base-b6eaaa2ab2a43193b6fec3790a7e413b8e28733a.tar.gz
frameworks_base-b6eaaa2ab2a43193b6fec3790a7e413b8e28733a.tar.bz2
Clean up cacheColorHint to be better controlled by the theme.
Fixes generic lists in dialog themes, for example. Change-Id: I0ea1cae1641d8ab3756179ce80245ed0df942115
-rw-r--r--api/current.xml11
-rw-r--r--core/res/res/values/attrs.xml5
-rw-r--r--core/res/res/values/public.xml1
-rw-r--r--core/res/res/values/styles.xml3
-rw-r--r--core/res/res/values/themes.xml9
5 files changed, 28 insertions, 1 deletions
diff --git a/api/current.xml b/api/current.xml
index 62078a7..097fbca 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -2550,6 +2550,17 @@
visibility="public"
>
</field>
+<field name="colorBackgroundCacheHint"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16843435"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="colorForeground"
type="int"
transient="false"
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 6f109df..f1ef6df 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -28,6 +28,11 @@
<attr name="colorForegroundInverse" format="color" />
<!-- Color that matches (as closely as possible) the window background. -->
<attr name="colorBackground" format="color" />
+ <!-- This is a hint for a solid color that can be used for caching
+ rendered views. This will be the color of the background when
+ there is a solid background color; it will be null when the
+ background is a texture or translucent. -->
+ <attr name="colorBackgroundCacheHint" format="color" />
<!-- Default disabled alpha for widgets that set enabled/disabled alpha programmatically. -->
<attr name="disabledAlpha" format="float" />
<!-- Default background dim amount when a menu, dialog, or something similar pops up. -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 97fb80a..999e6ed 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1175,6 +1175,7 @@
<public type="attr" name="scrollbarFadeDuration" />
<public type="attr" name="scrollbarDefaultDelayBeforeFade" />
<public type="attr" name="fadeScrollbars" />
+ <public type="attr" name="colorBackgroundCacheHint" />
<public type="style" name="Theme.Wallpaper" />
<public type="style" name="Theme.Wallpaper.NoTitleBar" />
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 47c68ad..e071e99 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -459,12 +459,13 @@
<style name="Widget.ListView" parent="Widget.AbsListView">
<item name="android:listSelector">@android:drawable/list_selector_background</item>
- <item name="android:cacheColorHint">?android:attr/colorBackground</item>
+ <item name="android:cacheColorHint">?android:attr/colorBackgroundCacheHint</item>
<item name="android:divider">@android:drawable/divider_horizontal_dark_opaque</item>
</style>
<style name="Widget.ListView.White" parent="Widget.AbsListView">
<item name="android:listSelector">@android:drawable/list_selector_background</item>
+ <item name="android:cacheColorHint">?android:attr/colorBackgroundCacheHint</item>
<item name="android:divider">@android:drawable/divider_horizontal_bright_opaque</item>
</style>
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 5ddbce2..119f174 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -30,6 +30,7 @@
<item name="colorForeground">@android:color/bright_foreground_dark</item>
<item name="colorForegroundInverse">@android:color/bright_foreground_dark_inverse</item>
<item name="colorBackground">@android:color/background_dark</item>
+ <item name="colorBackgroundCacheHint">?android:attr/colorBackground</item>
<item name="disabledAlpha">0.5</item>
<item name="backgroundDimAmount">0.6</item>
@@ -289,6 +290,7 @@
wallpaper appear behind them. -->
<style name="Theme.Wallpaper">
<item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowShowWallpaper">true</item>
</style>
@@ -308,6 +310,7 @@
top of a dark background. -->
<style name="Theme.WallpaperSettings">
<item name="android:windowBackground">@android:drawable/screen_background_dark_transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
</style>
@@ -316,6 +319,7 @@
top of a light background. -->
<style name="Theme.Light.WallpaperSettings">
<item name="android:windowBackground">@android:drawable/screen_background_light_transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
</style>
@@ -335,6 +339,7 @@
flag and appropriate animations for your windows. -->
<style name="Theme.Translucent">
<item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<!-- Note that we use the base animation style here (that is no
animations) because we really have no idea how this kind of
@@ -379,6 +384,8 @@
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
+
<item name="textAppearance">@android:style/TextAppearance</item>
<item name="textAppearanceInverse">@android:style/TextAppearance.Inverse</item>
@@ -422,6 +429,7 @@
background, and turns off dimming behind the window. -->
<style name="Theme.Panel">
<item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsFloating">true</item>
@@ -436,6 +444,7 @@
background, and turns off dimming behind the window. -->
<style name="Theme.Light.Panel">
<item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsFloating">true</item>