improve codacy score

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2019-01-23 08:24:07 +01:00
parent 34cef89ce8
commit b0734f5768
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
7 changed files with 3 additions and 10 deletions

View file

@ -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;

View file

@ -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();

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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 {