mirror of
https://github.com/nextcloud/android.git
synced 2024-12-23 01:00:26 +03:00
improve codacy score
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
34cef89ce8
commit
b0734f5768
7 changed files with 3 additions and 10 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue