added some missing nullable annotation additions, switched to compat implementations of some methods, fixed some lint warnings
This commit is contained in:
parent
dbd7e6c2e6
commit
d59aeef3a9
@ -313,7 +313,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
|
||||
}
|
||||
|
||||
setNavigationDrawerWidth();
|
||||
mDrawerLayout.setDrawerListener(new DrawerLocker());
|
||||
mDrawerLayout.addDrawerListener(new DrawerLocker());
|
||||
|
||||
mWebpageBitmap = ThemeUtils.getThemedBitmap(this, R.drawable.ic_webpage, mDarkTheme);
|
||||
|
||||
@ -541,12 +541,10 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrawerSlide(View v, float arg) {
|
||||
}
|
||||
public void onDrawerSlide(View v, float arg) {}
|
||||
|
||||
@Override
|
||||
public void onDrawerStateChanged(int arg) {
|
||||
}
|
||||
public void onDrawerStateChanged(int arg) {}
|
||||
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class TabsManager {
|
||||
@Nullable private TabNumberChangedListener mTabNumberListener;
|
||||
|
||||
private boolean mIsInitialized = false;
|
||||
private List<Runnable> mPostInitializationWorkList = new ArrayList<>();
|
||||
private final List<Runnable> mPostInitializationWorkList = new ArrayList<>();
|
||||
|
||||
@Inject PreferenceManager mPreferenceManager;
|
||||
@Inject BookmarkManager mBookmarkManager;
|
||||
|
@ -30,7 +30,7 @@ public class BrowserPresenter {
|
||||
|
||||
private static final String TAG = BrowserPresenter.class.getSimpleName();
|
||||
|
||||
private TabsManager mTabsModel;
|
||||
@NonNull private final TabsManager mTabsModel;
|
||||
@Inject PreferenceManager mPreferences;
|
||||
@Inject Bus mEventBus;
|
||||
|
||||
|
@ -19,6 +19,7 @@ import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v4.widget.TextViewCompat;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.RecyclerView.LayoutManager;
|
||||
@ -316,11 +317,7 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
|
||||
|
||||
final Bitmap favicon = web.getFavicon();
|
||||
if (web.isForegroundTab()) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
holder.txtTitle.setTextAppearance(R.style.boldText);
|
||||
} else {
|
||||
holder.txtTitle.setTextAppearance(getContext(), R.style.boldText);
|
||||
}
|
||||
TextViewCompat.setTextAppearance(holder.txtTitle, R.style.boldText);
|
||||
Drawable foregroundDrawable;
|
||||
if (!mDrawerTabs) {
|
||||
foregroundDrawable = new BitmapDrawable(getResources(), mForegroundTabBitmap);
|
||||
@ -340,11 +337,7 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
|
||||
}
|
||||
holder.favicon.setImageBitmap(favicon);
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
holder.txtTitle.setTextAppearance(R.style.normalText);
|
||||
} else {
|
||||
holder.txtTitle.setTextAppearance(getContext(), R.style.normalText);
|
||||
}
|
||||
TextViewCompat.setTextAppearance(holder.txtTitle, R.style.normalText);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
holder.layout.setBackground(mBackgroundTabDrawable);
|
||||
} else {
|
||||
|
@ -63,7 +63,7 @@ public class PreferenceManager {
|
||||
public static final String INITIAL_CHECK_FOR_I2P = "checkForI2P";
|
||||
}
|
||||
|
||||
private final SharedPreferences mPrefs;
|
||||
@NonNull private final SharedPreferences mPrefs;
|
||||
|
||||
private static final String PREFERENCES = "settings";
|
||||
|
||||
@ -255,7 +255,7 @@ public class PreferenceManager {
|
||||
return mPrefs.getBoolean(Name.DO_NOT_TRACK, false);
|
||||
}
|
||||
|
||||
public boolean getRemoveIdentifyingHeadersEnabled(){
|
||||
public boolean getRemoveIdentifyingHeadersEnabled() {
|
||||
return mPrefs.getBoolean(Name.IDENTIFYING_HEADERS, false);
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ public class PreferenceManager {
|
||||
mPrefs.edit().putString(name, value).apply();
|
||||
}
|
||||
|
||||
public void setRemoveIdentifyingHeadersEnabled(boolean enabled){
|
||||
public void setRemoveIdentifyingHeadersEnabled(boolean enabled) {
|
||||
putBoolean(Name.IDENTIFYING_HEADERS, enabled);
|
||||
}
|
||||
|
||||
@ -331,7 +331,7 @@ public class PreferenceManager {
|
||||
putBoolean(Name.COOKIES, enable);
|
||||
}
|
||||
|
||||
public void setDownloadDirectory(String directory) {
|
||||
public void setDownloadDirectory(@NonNull String directory) {
|
||||
putString(Name.DOWNLOAD_DIRECTORY, directory);
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ public class PreferenceManager {
|
||||
putBoolean(Name.HIDE_STATUS_BAR, enable);
|
||||
}
|
||||
|
||||
public void setHomepage(String homepage) {
|
||||
public void setHomepage(@NonNull String homepage) {
|
||||
putString(Name.HOMEPAGE, homepage);
|
||||
}
|
||||
|
||||
@ -438,7 +438,7 @@ public class PreferenceManager {
|
||||
putInt(Name.PROXY_CHOICE, choice);
|
||||
}
|
||||
|
||||
public void setProxyHost(String proxyHost) {
|
||||
public void setProxyHost(@NonNull String proxyHost) {
|
||||
putString(Name.USE_PROXY_HOST, proxyHost);
|
||||
}
|
||||
|
||||
@ -450,7 +450,7 @@ public class PreferenceManager {
|
||||
putInt(Name.USER_AGENT, choice);
|
||||
}
|
||||
|
||||
public void setUserAgentString(String agent) {
|
||||
public void setUserAgentString(@Nullable String agent) {
|
||||
putString(Name.USER_AGENT_STRING, agent);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ import acr.browser.lightning.R;
|
||||
import acr.browser.lightning.database.HistoryItem;
|
||||
import acr.browser.lightning.utils.Utils;
|
||||
|
||||
public class RetrieveSuggestionsTask extends AsyncTask<Void, Void, List<HistoryItem>> {
|
||||
class RetrieveSuggestionsTask extends AsyncTask<Void, Void, List<HistoryItem>> {
|
||||
|
||||
private static final String TAG = RetrieveSuggestionsTask.class.getSimpleName();
|
||||
|
||||
@ -42,12 +42,12 @@ public class RetrieveSuggestionsTask extends AsyncTask<Void, Void, List<HistoryI
|
||||
private static final String ENCODING = "ISO-8859-1";
|
||||
private static final long INTERVAL_DAY = 86400000;
|
||||
private static final String DEFAULT_LANGUAGE = "en";
|
||||
private static XmlPullParser sXpp;
|
||||
private static String sLanguage;
|
||||
private WeakReference<SuggestionsResult> mResultCallback;
|
||||
private Application mApplication;
|
||||
private String mSearchSubtitle;
|
||||
private String mQuery;
|
||||
@Nullable private static XmlPullParser sXpp;
|
||||
@Nullable private static String sLanguage;
|
||||
@NonNull private final WeakReference<SuggestionsResult> mResultCallback;
|
||||
@NonNull private final Application mApplication;
|
||||
@NonNull private final String mSearchSubtitle;
|
||||
@NonNull private String mQuery;
|
||||
|
||||
public RetrieveSuggestionsTask(@NonNull String query,
|
||||
@NonNull SuggestionsResult callback,
|
||||
|
@ -6,7 +6,7 @@ import java.util.List;
|
||||
|
||||
import acr.browser.lightning.database.HistoryItem;
|
||||
|
||||
public interface SuggestionsResult {
|
||||
interface SuggestionsResult {
|
||||
|
||||
/**
|
||||
* Called when the search suggestions have
|
||||
|
@ -19,7 +19,7 @@ public class KeyboardHelper {
|
||||
void keyboardVisibilityChanged(boolean visible);
|
||||
}
|
||||
|
||||
@NonNull private View mView;
|
||||
@NonNull private final View mView;
|
||||
private int mLastRight = -1;
|
||||
private int mLastBottom = -1;
|
||||
|
||||
|
@ -40,7 +40,6 @@ import java.util.Map;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import acr.browser.lightning.R;
|
||||
import acr.browser.lightning.app.BrowserApp;
|
||||
import acr.browser.lightning.constant.BookmarkPage;
|
||||
import acr.browser.lightning.constant.Constants;
|
||||
@ -57,7 +56,6 @@ import acr.browser.lightning.react.Schedulers;
|
||||
import acr.browser.lightning.react.Subscriber;
|
||||
import acr.browser.lightning.react.OnSubscribe;
|
||||
import acr.browser.lightning.utils.ProxyUtils;
|
||||
import acr.browser.lightning.utils.ThemeUtils;
|
||||
import acr.browser.lightning.utils.UrlUtils;
|
||||
import acr.browser.lightning.utils.Utils;
|
||||
|
||||
|
@ -21,7 +21,7 @@ class LightningViewTitle {
|
||||
|
||||
@Nullable private Bitmap mFavicon = null;
|
||||
@NonNull private String mTitle;
|
||||
@NonNull Context mContext;
|
||||
@NonNull private final Context mContext;
|
||||
|
||||
public LightningViewTitle(@NonNull Context context) {
|
||||
mContext = context;
|
||||
|
@ -25,8 +25,6 @@ import android.webkit.WebViewClient;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.squareup.otto.Bus;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
|
Loading…
x
Reference in New Issue
Block a user