]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Fixed background of actionbar color in dark theme for 2.3.x Android
authorThad Hughes <thadh@google.com>
Mon, 10 Feb 2014 18:20:49 +0000 (10:20 -0800)
committerThad Hughes <thadh@google.com>
Mon, 10 Feb 2014 18:20:49 +0000 (10:20 -0800)
versions.

Dictionary_signed.apk
images/play_store/nexus_10/dictionary_manager.png [new file with mode: 0644]
images/play_store/nexus_10/essere.png [new file with mode: 0644]
res/values/styles.xml
src/com/hughes/android/dictionary/DictionaryActivity.java

index 58cd7d318da96f931f09bb32b8a2bb777149b111..fd7ad592b4ca7109b712bf79b76ee913071d8ec7 100644 (file)
Binary files a/Dictionary_signed.apk and b/Dictionary_signed.apk differ
diff --git a/images/play_store/nexus_10/dictionary_manager.png b/images/play_store/nexus_10/dictionary_manager.png
new file mode 100644 (file)
index 0000000..03af536
Binary files /dev/null and b/images/play_store/nexus_10/dictionary_manager.png differ
diff --git a/images/play_store/nexus_10/essere.png b/images/play_store/nexus_10/essere.png
new file mode 100644 (file)
index 0000000..11a68df
Binary files /dev/null and b/images/play_store/nexus_10/essere.png differ
index d2ae2c6e5efcf403a0c7737d31a89f8694527798..bce60d946f2dd8e9da735d400c1135c1bb7bc947 100644 (file)
@@ -1,11 +1,11 @@
 <resources>
-    
+
     <style name="MyActionButtonStyle" parent="Widget.Sherlock.ActionButton">
         <item name="android:minWidth">28dip</item>
-        <!-- 
+        <!--
         <item name="android:paddingLeft">0dip</item>
         <item name="android:paddingRight">0dip</item>
-         -->
+        -->
     </style>
 
     <!--
@@ -13,6 +13,7 @@
         by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
     -->
     <style name="AppBaseThemeLight" parent="Theme.Sherlock.Light">
+
         <!--
             Theme customizations available in newer API levels can go in
             res/values-vXX/styles.xml, while customizations related to
         <!--
       <item name="searchViewSearchIcon">@android:color/transparent</item>
       <item name="searchViewCloseIcon">@android:color/transparent</item>
-      -->
-      <item name="actionButtonStyle">@style/MyActionButtonStyle</item>
+        -->
+        <item name="actionButtonStyle">@style/MyActionButtonStyle</item>
     </style>
-    
+
     <style name="AppBaseThemeDark" parent="Theme.Sherlock">
         <!--
             Theme customizations available in newer API levels can go in
             Make search icon magnifying glass disappear:
             http://stackoverflow.com/questions/13604506/show-actionbarsherlock-searchview-always-expanded
         -->
-      <!--
+        <!--
       <item name="searchViewSearchIcon">@android:color/transparent</item>
       <item name="searchViewCloseIcon">@android:color/transparent</item>
-      -->
+        -->
         <item name="actionButtonStyle">@style/MyActionButtonStyle</item>
     </style>
 
@@ -51,6 +52,7 @@
     <style name="Theme.Default" parent="AppBaseThemeDark"></style>
 
     <style name="Theme.Default.TokenRow.Fg" parent="Theme.Default">
+
         <!-- <item name="android:textColor">#FFFFFF</item> -->
         <item name="android:textColorLink">#00AAFF</item>
     </style>
 
     <!-- ****************************************************************** -->
 
+
     <!-- Light theme -->
 
     <style name="Theme.Light" parent="AppBaseThemeLight"></style>
 
     <style name="Theme.Light.TokenRow.Fg" parent="Theme.Light">
+
         <!-- <item name="android:textColor">#000000</item> -->
         <item name="android:textColorLink">#0000FF</item>
     </style>
@@ -75,9 +79,8 @@
     <color name="theme_light_token_row_main_bg">#EEEEEE</color>
     <color name="theme_light_token_row_other_bg">#EEEEEE</color>
     <color name="theme_light_normal_row_bg">#FFFFFF</color>
-
     <color name="gray">#777777</color>
-    
+
     <style name="BorderlessButton">
         <item name="android:background">@null</item>
         <item name="android:paddingLeft">4dip</item>
index 999a4f0b783b4662b8cb185cb6bf75718bdd8447..11606bc74f59d0e191114e09e5b17f72e2c72366 100644 (file)
@@ -197,6 +197,11 @@ public class DictionaryActivity extends SherlockListActivity {
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
+        // This needs to be before super.onCreate, otherwise ActionbarSherlock
+        // doesn't makes the background of the actionbar white when you're
+        // in the dark theme.
+        setTheme(((DictionaryApplication) getApplication()).getSelectedTheme().themeId);
+
         Log.d(LOG, "onCreate:" + this);
         super.onCreate(savedInstanceState);
 
@@ -205,7 +210,6 @@ public class DictionaryActivity extends SherlockListActivity {
         // Don't auto-launch if this fails.
         prefs.edit().remove(C.DICT_FILE).commit();
 
-        setTheme(((DictionaryApplication) getApplication()).getSelectedTheme().themeId);
 
         application = (DictionaryApplication) getApplication();
         theme = application.getSelectedTheme();
@@ -439,7 +443,7 @@ public class DictionaryActivity extends SherlockListActivity {
         searchView.requestFocus();
 
         // http://stackoverflow.com/questions/2833057/background-listview-becomes-black-when-scrolling
-        getListView().setCacheColorHint(0);
+//        getListView().setCacheColorHint(0);
     }
 
     private void onCreateSetupActionBarAndSearchView() {
@@ -475,7 +479,7 @@ public class DictionaryActivity extends SherlockListActivity {
         });
         customSearchView.addView(languageButton);
 
-        searchView = new SearchView(customSearchView.getContext());
+        searchView = new SearchView(getSupportActionBar().getThemedContext());
         searchView.setIconifiedByDefault(false);
         // searchView.setIconified(false); // puts the magnifying glass in the
         // wrong place.