diff --git a/src/main/java/com/owncloud/android/ui/activity/CommunityActivity.java b/src/main/java/com/owncloud/android/ui/activity/CommunityActivity.java index d877064105..0b945da6aa 100644 --- a/src/main/java/com/owncloud/android/ui/activity/CommunityActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/CommunityActivity.java @@ -22,7 +22,6 @@ package com.owncloud.android.ui.activity; import android.content.Intent; -import android.graphics.PorterDuff; import android.os.Bundle; import android.text.Html; import android.text.method.LinkMovementMethod; diff --git a/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java b/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java index 97ae0bdeec..0eb2054dc4 100644 --- a/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java @@ -694,9 +694,9 @@ public class SettingsActivity extends PreferenceActivity SwitchPreference themePref = (SwitchPreference) findPreference(getString(R.string.prefs_key_theme)); SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); - themePref.setSummary((appPrefs.getBoolean(com.owncloud.android.db.PreferenceManager.PREF__DARK_THEME, + themePref.setSummary(appPrefs.getBoolean(com.owncloud.android.db.PreferenceManager.PREF__DARK_THEME, false) ? - getString(R.string.prefs_value_theme_dark) : getString(R.string.prefs_value_theme_light))); + getString(R.string.prefs_value_theme_dark) : getString(R.string.prefs_value_theme_light)); themePref.setOnPreferenceChangeListener((preference, newValue) -> { MainApp.setAppTheme((Boolean) newValue); getDelegate().applyDayNight(); diff --git a/src/main/java/com/owncloud/android/ui/activity/SsoGrantPermissionActivity.java b/src/main/java/com/owncloud/android/ui/activity/SsoGrantPermissionActivity.java index 1aa3f96e1c..556c465c5b 100644 --- a/src/main/java/com/owncloud/android/ui/activity/SsoGrantPermissionActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/SsoGrantPermissionActivity.java @@ -30,7 +30,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; -import android.graphics.Color; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.os.Bundle; diff --git a/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java b/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java index 66ccc616c5..829aa4214b 100644 --- a/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/UploadFilesActivity.java @@ -25,7 +25,6 @@ import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.content.res.ColorStateList; -import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Environment; diff --git a/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java b/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java index 7096db731c..e600e1b713 100644 --- a/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java +++ b/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java @@ -24,7 +24,6 @@ package com.owncloud.android.ui.adapter; import android.content.Context; import android.content.res.Resources; -import android.graphics.Color; import android.graphics.drawable.PictureDrawable; import android.net.Uri; import android.text.Spannable; diff --git a/src/main/java/com/owncloud/android/ui/adapter/LocalFileListAdapter.java b/src/main/java/com/owncloud/android/ui/adapter/LocalFileListAdapter.java index f025ce0c7a..2c25b9edc2 100644 --- a/src/main/java/com/owncloud/android/ui/adapter/LocalFileListAdapter.java +++ b/src/main/java/com/owncloud/android/ui/adapter/LocalFileListAdapter.java @@ -23,7 +23,6 @@ package com.owncloud.android.ui.adapter; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; -import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/src/main/java/com/owncloud/android/utils/ThemeUtils.java b/src/main/java/com/owncloud/android/utils/ThemeUtils.java index 4ef95dee78..24ca68e851 100644 --- a/src/main/java/com/owncloud/android/utils/ThemeUtils.java +++ b/src/main/java/com/owncloud/android/utils/ThemeUtils.java @@ -126,14 +126,12 @@ public final class ThemeUtils { } public static int primaryColor(Account account, boolean replaceWhite, Context context) { - OCCapability capability = getCapability(account, context); - if (context==null) { return 255; } try { - int color = Color.parseColor(capability.getServerColor()); + int color = Color.parseColor(getCapability(account, context).getServerColor()); if (replaceWhite && Color.WHITE == color) { return Color.GRAY; } else {