Permalink
Browse files

#222, #199: remove cacheColorHint while fixing gray/white flashing

I thought of it backwards; the fix was to use the
android.R.color.background_light color when possible,
rather than try to force the background to white.
  • Loading branch information...
1 parent 5527444 commit e3924ea96ba0880ba1b86f48e5d8126429ab5c7c @talklittle committed Jan 15, 2012
@@ -37,7 +37,6 @@
<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:cacheColorHint="#00000000"
android:divider="@null"
android:transcriptMode="disabled"
/>
@@ -38,7 +38,6 @@
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
- android:cacheColorHint="#00000000"
/>
<ScrollView android:id="@android:id/empty"
@@ -70,7 +70,6 @@
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
- android:cacheColorHint="#00000000"
/>
<ScrollView android:id="@android:id/empty"
@@ -38,7 +38,6 @@
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
- android:cacheColorHint="#00000000"
/>
<ScrollView android:id="@android:id/empty"
@@ -32,8 +32,6 @@
</style>
<style name="Reddit_Light_Medium" parent="@android:style/Theme.Holo.Light">
- <item name="android:listSelector">@drawable/list_selector_blue</item>
- <item name="android:cacheColorHint">@color/white</item>
<item name="android:textAppearanceSmall">@style/TextAppearance_Medium.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance_Medium.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance_Medium.Large</item>
@@ -47,8 +45,6 @@
</style>
<style name="Reddit_Light_Large" parent="@android:style/Theme.Holo.Light">
- <item name="android:listSelector">@drawable/list_selector_blue</item>
- <item name="android:cacheColorHint">@color/white</item>
<item name="android:textAppearanceSmall">@style/TextAppearance_Large.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance_Large.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance_Large.Large</item>
@@ -62,16 +58,12 @@
</style>
<style name="Reddit_Light_Larger" parent="@android:style/Theme.Holo.Light">
- <item name="android:listSelector">@drawable/list_selector_blue</item>
- <item name="android:cacheColorHint">@color/white</item>
<item name="android:textAppearanceSmall">@style/TextAppearance_Larger.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance_Larger.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance_Larger.Large</item>
</style>
<style name="Reddit_Light_Huge" parent="@android:style/Theme.Holo.Light">
- <item name="android:listSelector">@drawable/list_selector_blue</item>
- <item name="android:cacheColorHint">@color/white</item>
<item name="android:textAppearanceSmall">@style/TextAppearance_Huge.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance_Huge.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance_Huge.Large</item>
View
@@ -19,7 +19,9 @@
-->
<resources>
- <style name="Reddit_Light_Dialog" parent="@android:style/Theme.Dialog" />
+ <style name="Reddit_Light_Dialog" parent="@android:style/Theme.Dialog">
+ <item name="android:textColor">@color/white</item>
+ </style>
<style name="Reddit_Light_Dialog_NoTitle" parent="@style/Reddit_Light_Dialog">
<item name="android:windowNoTitle">true</item>
</style>
@@ -33,7 +35,6 @@
<style name="Reddit_Light_Medium" parent="@android:style/Theme.Light">
<item name="android:listSelector">@drawable/list_selector_blue</item>
- <item name="android:cacheColorHint">@color/white</item>
<item name="android:textAppearanceSmall">@style/TextAppearance_Medium.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance_Medium.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance_Medium.Large</item>
@@ -48,7 +49,6 @@
<style name="Reddit_Light_Large" parent="@android:style/Theme.Light">
<item name="android:listSelector">@drawable/list_selector_blue</item>
- <item name="android:cacheColorHint">@color/white</item>
<item name="android:textAppearanceSmall">@style/TextAppearance_Large.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance_Large.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance_Large.Large</item>
@@ -63,15 +63,13 @@
<style name="Reddit_Light_Larger" parent="@android:style/Theme.Light">
<item name="android:listSelector">@drawable/list_selector_blue</item>
- <item name="android:cacheColorHint">@color/white</item>
<item name="android:textAppearanceSmall">@style/TextAppearance_Larger.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance_Larger.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance_Larger.Large</item>
</style>
<style name="Reddit_Light_Huge" parent="@android:style/Theme.Light">
<item name="android:listSelector">@drawable/list_selector_blue</item>
- <item name="android:cacheColorHint">@color/white</item>
<item name="android:textAppearanceSmall">@style/TextAppearance_Huge.Small</item>
<item name="android:textAppearanceMedium">@style/TextAppearance_Huge.Medium</item>
<item name="android:textAppearanceLarge">@style/TextAppearance_Huge.Large</item>
@@ -112,9 +112,8 @@ public static boolean shouldLoadThumbnails(Activity activity, RedditSettings set
public static void updateListDrawables(ListActivity la, int theme) {
ListView lv = la.getListView();
if (Util.isLightTheme(theme)) {
+ lv.setBackgroundResource(android.R.color.background_light);
lv.setSelector(R.drawable.list_selector_blue);
- // HACK: set background color directly for android 2.0
- lv.setBackgroundResource(R.color.white);
} else /* if (Common.isDarkTheme(theme)) */ {
lv.setSelector(android.R.drawable.list_selector_background);
}
@@ -137,7 +136,7 @@ public static void updateNextPreviousButtons(ListActivity act, View nextPrevious
if (shouldShow) {
if (nextPreviousView != null && nextPreviousBorder != null) {
if (Util.isLightTheme(settings.getTheme())) {
- nextPreviousView.setBackgroundResource(R.color.white);
+ nextPreviousView.setBackgroundResource(android.R.color.background_light);
nextPreviousBorder.setBackgroundResource(R.color.black);
} else {
nextPreviousBorder.setBackgroundResource(R.color.white);
@@ -490,7 +490,7 @@ private void updateKarma() {
if (karmaLayout != null && karmaLayoutBorder != null) {
karmaLayout.setVisibility(View.VISIBLE);
if (Util.isLightTheme(mSettings.getTheme())) {
- karmaLayout.setBackgroundResource(R.color.white);
+ karmaLayout.setBackgroundResource(android.R.color.background_light);
karmaLayoutBorder.setBackgroundResource(R.color.black);
} else {
karmaLayoutBorder.setBackgroundResource(R.color.white);

0 comments on commit e3924ea

Please sign in to comment.