]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Fixed background in dark theme.
authorThad Hughes <thadh@google.com>
Fri, 27 Dec 2013 23:59:11 +0000 (15:59 -0800)
committerThad Hughes <thadh@google.com>
Fri, 27 Dec 2013 23:59:11 +0000 (15:59 -0800)
res/drawable/theme_default_normal_row_bg.xml [moved from res/drawable/theme_default_other_lang_bg.xml with 68% similarity]
res/drawable/theme_light_normal_row_bg.xml [moved from res/drawable/theme_light_other_lang_bg.xml with 67% similarity]
res/values/styles.xml
src/com/hughes/android/dictionary/C.java
src/com/hughes/android/dictionary/DictionaryActivity.java

similarity index 68%
rename from res/drawable/theme_default_other_lang_bg.xml
rename to res/drawable/theme_default_normal_row_bg.xml
index 78bb6b77b485f51a2cf70822cd8ad4c06afe0319..ee37a0c24f7e767d814bd97ec701e8386a146990 100644 (file)
@@ -1,4 +1,4 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
   <item android:state_selected="true" android:drawable="@android:color/transparent" /> 
-  <item android:drawable="@color/theme_default_other_lang_bg" /> 
+  <item android:drawable="@color/theme_default_normal_row_bg" /> 
 </selector>
\ No newline at end of file
similarity index 67%
rename from res/drawable/theme_light_other_lang_bg.xml
rename to res/drawable/theme_light_normal_row_bg.xml
index f43fcaa8314857b3995873dffe1b81b9564cf898..95e99632d66becb92821f6393924d2f3f0130233 100644 (file)
@@ -1,4 +1,4 @@
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
   <item android:state_selected="true" android:drawable="@android:color/transparent" /> 
-  <item android:drawable="@color/theme_light_other_lang_bg" /> 
+  <item android:drawable="@color/theme_light_normal_row_bg" /> 
 </selector>
\ No newline at end of file
index 069097cea02d50c042ddfa75245071b5dcbca7d1..d2ae2c6e5efcf403a0c7737d31a89f8694527798 100644 (file)
@@ -58,7 +58,7 @@
     <color name="theme_default_token_row_fg">#FFFFFF</color>
     <color name="theme_default_token_row_main_bg">#222222</color>
     <color name="theme_default_token_row_other_bg">#222222</color>
-    <color name="theme_default_other_lang_bg">#000000</color>
+    <color name="theme_default_normal_row_bg">#000000</color>
 
     <!-- ****************************************************************** -->
 
@@ -74,7 +74,7 @@
     <color name="theme_light_token_row_fg">#000000</color>
     <color name="theme_light_token_row_main_bg">#EEEEEE</color>
     <color name="theme_light_token_row_other_bg">#EEEEEE</color>
-    <color name="theme_light_other_lang_bg">#FFFFFF</color>
+    <color name="theme_light_normal_row_bg">#FFFFFF</color>
 
     <color name="gray">#777777</color>
     
index dc4bd0a8ea2a2f10c364d63739a5913730a20f1c..f60e6f2c232073a5450e2c154dac6de786c1aeb0 100644 (file)
@@ -32,25 +32,25 @@ public class C {
                 R.color.theme_default_token_row_fg,
                 R.drawable.theme_default_token_row_main_bg,
                 R.drawable.theme_default_token_row_other_bg,
-                R.drawable.theme_default_other_lang_bg),
+                R.drawable.theme_default_normal_row_bg),
 
         LIGHT(R.style.Theme_Light,
                 R.style.Theme_Light_TokenRow_Fg,
                 R.color.theme_light_token_row_fg,
                 R.drawable.theme_light_token_row_main_bg,
                 R.drawable.theme_light_token_row_other_bg,
-                R.drawable.theme_light_other_lang_bg);
+                R.drawable.theme_light_normal_row_bg);
 
         private Theme(final int themeId, final int tokenRowFg,
                 final int tokenRowFgColor,
                 final int tokenRowMainBg, final int tokenRowOtherBg,
-                final int otherLangBg) {
+                final int normalRowBg) {
             this.themeId = themeId;
             this.tokenRowFg = tokenRowFg;
             this.tokenRowFgColor = tokenRowFgColor;
             this.tokenRowMainBg = tokenRowMainBg;
             this.tokenRowOtherBg = tokenRowOtherBg;
-            this.otherLangBg = otherLangBg;
+            this.normalRowBg = normalRowBg;
         }
 
         final int themeId;
@@ -58,7 +58,7 @@ public class C {
         final int tokenRowFgColor;
         final int tokenRowMainBg;
         final int tokenRowOtherBg;
-        final int otherLangBg;
+        final int normalRowBg;
     }
 
 }
index 0a1ea9a9dc842400fe69767a1cbc6d4aff77df3b..37a45fab9d31210a29516c1acb6e8bd3c5b65704 100644 (file)
@@ -439,6 +439,9 @@ public class DictionaryActivity extends SherlockListActivity {
 
         updateLangButton();
         searchView.requestFocus();
+
+        // http://stackoverflow.com/questions/2833057/background-listview-becomes-black-when-scrolling
+        getListView().setCacheColorHint(0);
     }
 
     private void onCreateSetupActionBarAndSearchView() {
@@ -1365,7 +1368,10 @@ public class DictionaryActivity extends SherlockListActivity {
             result.setClickable(true);
             result.setFocusable(true);
             result.setLongClickable(true);
-            result.setBackgroundResource(android.R.drawable.menuitem_background);
+//            result.setBackgroundResource(android.R.drawable.menuitem_background);
+            
+            result.setBackgroundResource(theme.normalRowBg);
+
             result.setOnClickListener(new TextView.OnClickListener() {
                 @Override
                 public void onClick(View v) {