Răsfoiți Sursa

Change font color for darkmode and remove unused code

Signed-off-by: Joris Bodin <joris.bodin@infomaniak.com>
Joris Bodin 5 ani în urmă
părinte
comite
2c3ebac7e4

+ 0 - 18
src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java

@@ -753,24 +753,6 @@ public class SettingsActivity extends ThemedPreferenceActivity
             actionBar.setDisplayHomeAsUpEnabled(true);
             ThemeUtils.tintBackButton(actionBar, this);
         }
-
-        Window window = getWindow();
-        if (window != null) {
-            window.getDecorView().setBackgroundDrawable(new ColorDrawable(ResourcesCompat
-                    .getColor(getResources(), R.color.bg_default, null)));
-
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                window.setStatusBarColor(ThemeUtils.primaryColor(this));
-            }
-
-            // For adding content description tag to a title field in the action bar
-            int actionBarTitleId = getResources().getIdentifier("action_bar_title", "id", "android");
-            View actionBarTitle = window.getDecorView().findViewById(actionBarTitleId);
-
-            if (actionBarTitle != null) {
-                actionBarTitle.setContentDescription(getString(R.string.actionbar_settings));
-            }
-        }
     }
 
     private void launchDavDroidLogin() {

+ 7 - 3
src/main/java/com/owncloud/android/utils/ThemeUtils.java

@@ -242,6 +242,10 @@ public final class ThemeUtils {
         return ContextCompat.getColor(context, R.color.fontAppbar);
     }
 
+    public static int fontSecondaryAppbar(Context context) {
+        return ContextCompat.getColor(context, R.color.fontSecondaryAppbar);
+    }
+
     /**
      * Set color of title to white/black depending on background color
      *
@@ -279,7 +283,7 @@ public final class ThemeUtils {
                 actionBar.setSubtitle(title);
             } else {
                 Spannable text = new SpannableString(title);
-                text.setSpan(new ForegroundColorSpan(fontAppbarColor(context)),
+                text.setSpan(new ForegroundColorSpan(fontSecondaryAppbar(context)),
                              0,
                              text.length(),
                              Spannable.SPAN_INCLUSIVE_INCLUSIVE);
@@ -528,10 +532,10 @@ public final class ThemeUtils {
      */
     public static void themeSearchView(SearchView searchView, boolean themedBackground, Context context) {
         // hacky as no default way is provided
-        int fontColor = ThemeUtils.fontAppbarColor(context);
+        int fontColor = fontAppbarColor(context);
         SearchView.SearchAutoComplete editText = searchView.findViewById(R.id.search_src_text);
         setEditTextColor(context, editText, fontColor);
-        editText.setHintTextColor(fontColor);
+        editText.setHintTextColor(fontSecondaryAppbar(context));
 
         ImageView closeButton = searchView.findViewById(androidx.appcompat.R.id.search_close_btn);
         closeButton.setColorFilter(fontColor);

+ 1 - 1
src/main/res/values-night/colors.xml

@@ -44,5 +44,5 @@
 
     <!-- App bar -->
     <color name="appbar">#1E1E1E</color>
-    <color name="fontAppbar">#99FFFFFF</color>
+    <color name="fontAppbar">@android:color/white</color>
 </resources>

+ 1 - 0
src/main/res/values/colors.xml

@@ -89,4 +89,5 @@
     <!-- App bar -->
     <color name="appbar">@android:color/white</color>
     <color name="fontAppbar">#666666</color>
+    <color name="fontSecondaryAppbar">#A5A5A5</color>
 </resources>