Cleaning up code
This commit is contained in:
parent
83099dc90d
commit
4e4707b524
@ -12,11 +12,8 @@ import acr.browser.lightning.utils.Preconditions;
|
|||||||
public class HistoryItem implements Comparable<HistoryItem> {
|
public class HistoryItem implements Comparable<HistoryItem> {
|
||||||
|
|
||||||
@NonNull private String mUrl = "";
|
@NonNull private String mUrl = "";
|
||||||
|
|
||||||
@NonNull private String mTitle = "";
|
@NonNull private String mTitle = "";
|
||||||
|
|
||||||
@NonNull private String mFolder = "";
|
@NonNull private String mFolder = "";
|
||||||
|
|
||||||
@Nullable private Bitmap mBitmap = null;
|
@Nullable private Bitmap mBitmap = null;
|
||||||
|
|
||||||
private int mImageId = 0;
|
private int mImageId = 0;
|
||||||
@ -126,13 +123,12 @@ public class HistoryItem implements Comparable<HistoryItem> {
|
|||||||
|
|
||||||
HistoryItem that = (HistoryItem) o;
|
HistoryItem that = (HistoryItem) o;
|
||||||
|
|
||||||
if (mImageId != that.mImageId) return false;
|
return mImageId == that.mImageId &&
|
||||||
if (mPosition != that.mPosition) return false;
|
mPosition == that.mPosition &&
|
||||||
if (mIsFolder != that.mIsFolder) return false;
|
mIsFolder == that.mIsFolder &&
|
||||||
if (!mUrl.equals(that.mUrl)) return false;
|
mUrl.equals(that.mUrl) &&
|
||||||
if (!mTitle.equals(that.mTitle)) return false;
|
mTitle.equals(that.mTitle) &&
|
||||||
|
mFolder.equals(that.mFolder);
|
||||||
return mFolder.equals(that.mFolder);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,9 +11,7 @@ import acr.browser.lightning.utils.Preconditions;
|
|||||||
public class DownloadItem implements Comparable<DownloadItem> {
|
public class DownloadItem implements Comparable<DownloadItem> {
|
||||||
|
|
||||||
@NonNull private String mUrl = "";
|
@NonNull private String mUrl = "";
|
||||||
|
|
||||||
@NonNull private String mTitle = "";
|
@NonNull private String mTitle = "";
|
||||||
|
|
||||||
@NonNull private String mContentSize = "";
|
@NonNull private String mContentSize = "";
|
||||||
|
|
||||||
public DownloadItem() {}
|
public DownloadItem() {}
|
||||||
@ -76,10 +74,9 @@ public class DownloadItem implements Comparable<DownloadItem> {
|
|||||||
|
|
||||||
DownloadItem that = (DownloadItem) o;
|
DownloadItem that = (DownloadItem) o;
|
||||||
|
|
||||||
if (!mUrl.equals(that.mUrl)) return false;
|
return mUrl.equals(that.mUrl) &&
|
||||||
if (!mTitle.equals(that.mTitle)) return false;
|
mTitle.equals(that.mTitle) &&
|
||||||
|
mContentSize.equals(that.mContentSize);
|
||||||
return mContentSize.equals(that.mContentSize);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ public class BaseSearchEngine {
|
|||||||
@NonNull private final String mQueryUrl;
|
@NonNull private final String mQueryUrl;
|
||||||
@StringRes private final int mTitleRes;
|
@StringRes private final int mTitleRes;
|
||||||
|
|
||||||
public BaseSearchEngine(@NonNull String iconUrl,
|
BaseSearchEngine(@NonNull String iconUrl,
|
||||||
@NonNull String queryUrl,
|
@NonNull String queryUrl,
|
||||||
@StringRes int titleRes) {
|
@StringRes int titleRes) {
|
||||||
|
|
||||||
Preconditions.checkNonNull(iconUrl);
|
Preconditions.checkNonNull(iconUrl);
|
||||||
Preconditions.checkNonNull(queryUrl);
|
Preconditions.checkNonNull(queryUrl);
|
||||||
|
@ -151,6 +151,7 @@ public abstract class BaseSuggestionsModel {
|
|||||||
return language;
|
return language;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
private static final Interceptor REWRITE_CACHE_CONTROL_INTERCEPTOR = new Interceptor() {
|
private static final Interceptor REWRITE_CACHE_CONTROL_INTERCEPTOR = new Interceptor() {
|
||||||
@Override
|
@Override
|
||||||
public Response intercept(@NonNull Chain chain) throws IOException {
|
public Response intercept(@NonNull Chain chain) throws IOException {
|
||||||
|
@ -8,7 +8,7 @@ import android.support.annotation.NonNull;
|
|||||||
* API equality with the {@link String}
|
* API equality with the {@link String}
|
||||||
* API.
|
* API.
|
||||||
*/
|
*/
|
||||||
public class StringBuilderUtils {
|
class StringBuilderUtils {
|
||||||
|
|
||||||
private static final String SPACE = " ";
|
private static final String SPACE = " ";
|
||||||
private static final String EMPTY = "";
|
private static final String EMPTY = "";
|
||||||
@ -21,9 +21,9 @@ public class StringBuilderUtils {
|
|||||||
* @param toReplace the string to replace.
|
* @param toReplace the string to replace.
|
||||||
* @param replacement the replacement string.
|
* @param replacement the replacement string.
|
||||||
*/
|
*/
|
||||||
public static void replace(@NonNull StringBuilder stringBuilder,
|
static void replace(@NonNull StringBuilder stringBuilder,
|
||||||
@NonNull String toReplace,
|
@NonNull String toReplace,
|
||||||
@NonNull String replacement) {
|
@NonNull String replacement) {
|
||||||
int index = stringBuilder.indexOf(toReplace);
|
int index = stringBuilder.indexOf(toReplace);
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
stringBuilder.replace(index, index + toReplace.length(), replacement);
|
stringBuilder.replace(index, index + toReplace.length(), replacement);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user