Browse Source

Fix lint issues with color ints

master
Anthony Restaino 9 years ago
parent
commit
c1083f6aab
  1. 2
      app/src/main/java/acr/browser/lightning/database/BookmarkManager.java
  2. 1
      app/src/main/java/acr/browser/lightning/fragment/GeneralSettingsFragment.java
  3. 5
      app/src/main/java/acr/browser/lightning/utils/ThemeUtils.java

2
app/src/main/java/acr/browser/lightning/database/BookmarkManager.java

@ -154,7 +154,7 @@ public class BookmarkManager {
@Override @Override
public void run() { public void run() {
final File tempFile = new File(mFilesDir, final File tempFile = new File(mFilesDir,
String.format("bm_%d.dat", System.currentTimeMillis())); String.format(Locale.US, "bm_%d.dat", System.currentTimeMillis()));
final File bookmarksFile = new File(mFilesDir, FILE_BOOKMARKS); final File bookmarksFile = new File(mFilesDir, FILE_BOOKMARKS);
boolean success = false; boolean success = false;
BufferedWriter bookmarkWriter = null; BufferedWriter bookmarkWriter = null;

1
app/src/main/java/acr/browser/lightning/fragment/GeneralSettingsFragment.java

@ -3,7 +3,6 @@
*/ */
package acr.browser.lightning.fragment; package acr.browser.lightning.fragment;
import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Build; import android.os.Build;

5
app/src/main/java/acr/browser/lightning/utils/ThemeUtils.java

@ -12,6 +12,7 @@ import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.support.annotation.AttrRes; import android.support.annotation.AttrRes;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes; import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
@ -44,10 +45,12 @@ public class ThemeUtils {
return color; return color;
} }
@ColorInt
public static int getIconLightThemeColor(@NonNull Context context) { public static int getIconLightThemeColor(@NonNull Context context) {
return ContextCompat.getColor(context, R.color.icon_light_theme); return ContextCompat.getColor(context, R.color.icon_light_theme);
} }
@ColorInt
public static int getIconDarkThemeColor(@NonNull Context context) { public static int getIconDarkThemeColor(@NonNull Context context) {
return ContextCompat.getColor(context, R.color.icon_dark_theme); return ContextCompat.getColor(context, R.color.icon_dark_theme);
} }
@ -92,7 +95,7 @@ public class ThemeUtils {
} }
public static ColorDrawable getSelectedBackground(@NonNull Context context, boolean dark) { public static ColorDrawable getSelectedBackground(@NonNull Context context, boolean dark) {
final int color = (dark) ? ContextCompat.getColor(context, R.color.selected_dark) : @ColorInt final int color = (dark) ? ContextCompat.getColor(context, R.color.selected_dark) :
ContextCompat.getColor(context, R.color.selected_light); ContextCompat.getColor(context, R.color.selected_light);
return new ColorDrawable(color); return new ColorDrawable(color);
} }

Loading…
Cancel
Save