minor changes
This commit is contained in:
parent
eddba7e480
commit
20ca7047f3
@ -8,8 +8,6 @@ import android.support.annotation.IntDef;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import acr.browser.lightning.BuildConfig;
|
||||
|
||||
public final class Constants {
|
||||
|
||||
private Constants() {
|
||||
|
@ -25,6 +25,7 @@ public class DownloadItem implements Comparable<DownloadItem> {
|
||||
public DownloadItem(@NonNull String url, @NonNull String title, @NonNull String size) {
|
||||
Preconditions.checkNonNull(url);
|
||||
Preconditions.checkNonNull(title);
|
||||
Preconditions.checkNonNull(size);
|
||||
this.mUrl = url;
|
||||
this.mTitle = title;
|
||||
this.mContentSize = size;
|
||||
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||
* The interface that should be used to
|
||||
* communicate with the download database.
|
||||
* <p>
|
||||
* Created by anthonycr on 5/6/17.
|
||||
* Created by df1e on 29/5/17.
|
||||
*/
|
||||
public interface DownloadsModel {
|
||||
|
||||
|
@ -16,6 +16,7 @@ import android.widget.AutoCompleteTextView;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.anthonycr.bonsai.CompletableOnSubscribe;
|
||||
import com.anthonycr.bonsai.CompletableSubscriber;
|
||||
import com.anthonycr.bonsai.Schedulers;
|
||||
import com.anthonycr.bonsai.SingleOnSubscribe;
|
||||
|
||||
@ -39,14 +40,13 @@ import acr.browser.lightning.utils.IntentUtils;
|
||||
import acr.browser.lightning.utils.Preconditions;
|
||||
import acr.browser.lightning.utils.Utils;
|
||||
|
||||
import static android.content.ContentValues.TAG;
|
||||
|
||||
/**
|
||||
* TODO Rename this class it doesn't build dialogs only for bookmarks
|
||||
* <p/>
|
||||
* Created by Stefano Pacifici on 02/09/15, based on Anthony C. Restaino's code.
|
||||
*/
|
||||
public class LightningDialogBuilder {
|
||||
public static final String TAG = "LightningDialogBuilder";
|
||||
|
||||
public enum NewTab {
|
||||
FOREGROUND,
|
||||
@ -173,8 +173,15 @@ public class LightningDialogBuilder {
|
||||
new BrowserDialog.Item(R.string.dialog_delete_all_downloads) {
|
||||
@Override
|
||||
public void onClick() {
|
||||
mDownloadsModel.deleteAllDownloads().subscribeOn(Schedulers.io()).subscribe();
|
||||
uiController.handleDownloadDeleted();
|
||||
mDownloadsModel.deleteAllDownloads()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(Schedulers.main())
|
||||
.subscribe(new CompletableOnSubscribe() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
uiController.handleDownloadDeleted();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ import android.view.View;
|
||||
import android.webkit.HttpAuthHandler;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.webkit.SslErrorHandler;
|
||||
import android.webkit.URLUtil;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebResourceResponse;
|
||||
@ -360,8 +359,8 @@ public class LightningWebClient extends WebViewClient {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} else if (url.startsWith("file://")) {
|
||||
File file = new File(url.replace("file://", ""));
|
||||
} else if (url.startsWith(Constants.FILE)) {
|
||||
File file = new File(url.replace(Constants.FILE, ""));
|
||||
|
||||
if (file.exists()) {
|
||||
String newMimeType = MimeTypeMap.getSingleton()
|
||||
|
Loading…
x
Reference in New Issue
Block a user