Browse Source

Fixed a number of lint warnings

master
Anthony Restaino 9 years ago
parent
commit
d5102b5e54
  1. 3
      app/src/main/java/acr/browser/lightning/dialog/BookmarksDialogBuilder.java
  2. 5
      app/src/main/java/acr/browser/lightning/fragment/BookmarkSettingsFragment.java
  3. 3
      app/src/main/java/acr/browser/lightning/fragment/BookmarksFragment.java
  4. 1
      app/src/main/java/acr/browser/lightning/fragment/GeneralSettingsFragment.java
  5. 2
      app/src/main/java/acr/browser/lightning/object/SearchAdapter.java
  6. 3
      app/src/main/java/acr/browser/lightning/reading/ArticleTextExtractor.java
  7. 2
      app/src/main/java/acr/browser/lightning/utils/PermissionsManager.java
  8. 6
      app/src/main/java/acr/browser/lightning/view/LightningView.java

3
app/src/main/java/acr/browser/lightning/dialog/BookmarksDialogBuilder.java

@ -49,7 +49,7 @@ public class BookmarksDialogBuilder { @@ -49,7 +49,7 @@ public class BookmarksDialogBuilder {
public void showLongPressedDialogForUrl(final Context context, final String url) {
final HistoryItem item;
if (url.startsWith(Constants.FILE) && url.endsWith(Constants.BOOKMARKS_FILENAME)) {
// TODO this in so many ways is wrong, probably we need to redesign the folder mechanism
// TODO hacky, make a better bookmark mechanism in the future
final Uri uri = Uri.parse(url);
final String filename = uri.getLastPathSegment();
final String folderTitle = filename.substring(0, filename.length() - Constants.BOOKMARKS_FILENAME.length() - 1);
@ -125,7 +125,6 @@ public class BookmarksDialogBuilder { @@ -125,7 +125,6 @@ public class BookmarksDialogBuilder {
@Override
public void onClick(DialogInterface dialog, int which) {
HistoryItem editedItem = new HistoryItem();
String currentFolder = item.getFolder();
editedItem.setTitle(getTitle.getText().toString());
editedItem.setUrl(getUrl.getText().toString());
editedItem.setUrl(getUrl.getText().toString());

5
app/src/main/java/acr/browser/lightning/fragment/BookmarkSettingsFragment.java

@ -33,7 +33,6 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref @@ -33,7 +33,6 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
@Inject BookmarkManager mBookmarkManager;
private File[] mFileList;
private String[] mFileNameList;
private PermissionsManager mPermissionsManager;
private static final String[] REQUIRED_PERMISSIONS = new String[]{
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
@ -51,9 +50,9 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref @@ -51,9 +50,9 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
initPrefs();
mPermissionsManager = PermissionsManager.getInstance();
PermissionsManager permissionsManager = PermissionsManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mPermissionsManager.requestPermissionsIfNecessary(getActivity(), REQUIRED_PERMISSIONS);
permissionsManager.requestPermissionsIfNecessary(getActivity(), REQUIRED_PERMISSIONS);
}
}

3
app/src/main/java/acr/browser/lightning/fragment/BookmarksFragment.java

@ -70,7 +70,7 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener, @@ -70,7 +70,7 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
private Bitmap mWebpageBitmap, mFolderBitmap;
// Bookmarks
private List<HistoryItem> mBookmarks = new ArrayList<>();
private final List<HistoryItem> mBookmarks = new ArrayList<>();
// Views
private ListView mBookmarksListView;
@ -222,7 +222,6 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener, @@ -222,7 +222,6 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
@Subscribe
public void bookmarkDeleted(final BookmarkEvents.Deleted event) {
final HistoryItem item = event.item;
// final int size = mBookmarks.size();
mBookmarks.remove(event.item);
// assert mBookmarks.size() < size;

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

@ -228,7 +228,6 @@ public class GeneralSettingsFragment extends PreferenceFragment implements Prefe @@ -228,7 +228,6 @@ public class GeneralSettingsFragment extends PreferenceFragment implements Prefe
}
private void setProxyChoice(int choice) {
ProxyUtils utils = ProxyUtils.getInstance(mActivity);
switch (choice) {
case Constants.PROXY_ORBOT:
choice = ProxyUtils.setProxyChoice(choice, mActivity);

2
app/src/main/java/acr/browser/lightning/object/SearchAdapter.java

@ -402,7 +402,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { @@ -402,7 +402,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
return connectivity.getActiveNetworkInfo();
}
//TODO Write simpler algorithm
// The old suggestions algorithm, leaving here just for reference
// private List<HistoryItem> getSuggestions() {
// List<HistoryItem> filteredList = new ArrayList<>();
//

3
app/src/main/java/acr/browser/lightning/reading/ArticleTextExtractor.java

@ -736,8 +736,7 @@ public class ArticleTextExtractor { @@ -736,8 +736,7 @@ public class ArticleTextExtractor {
}
private static String extractType(Document doc) {
String type = SHelper.innerTrim(doc.select("head meta[property=og:type]").attr("content"));
return type;
return SHelper.innerTrim(doc.select("head meta[property=og:type]").attr("content"));
}
private static String extractSitename(Document doc) {

2
app/src/main/java/acr/browser/lightning/utils/PermissionsManager.java

@ -16,7 +16,7 @@ import java.util.Set; @@ -16,7 +16,7 @@ import java.util.Set;
public class PermissionsManager {
private static PermissionsManager mInstance;
private Set<String> mPendingRequests = new HashSet<>();
private final Set<String> mPendingRequests = new HashSet<>();
public static PermissionsManager getInstance() {
if (mInstance == null) {

6
app/src/main/java/acr/browser/lightning/view/LightningView.java

@ -72,8 +72,8 @@ public class LightningView { @@ -72,8 +72,8 @@ public class LightningView {
private final Title mTitle;
private WebView mWebView;
private final boolean mIsIncognitoTab;
private BrowserController mBrowserController;
private GestureDetector mGestureDetector;
private final BrowserController mBrowserController;
private final GestureDetector mGestureDetector;
private final Activity mActivity;
private static String mHomepage;
private static String mDefaultUserAgent;
@ -81,7 +81,7 @@ public class LightningView { @@ -81,7 +81,7 @@ public class LightningView {
private final Bitmap mWebpageBitmap;
private static PreferenceManager mPreferences;
private final AdBlock mAdBlock;
private IntentUtils mIntentUtils;
private final IntentUtils mIntentUtils;
private final Paint mPaint = new Paint();
private boolean isForegroundTab;
private boolean mTextReflow = false;

Loading…
Cancel
Save