Fixed bugs with opening file:// urls in the browser via intent
This commit is contained in:
parent
719b281bac
commit
6e108dbbff
@ -28,11 +28,13 @@ import acr.browser.lightning.constant.StartPage;
|
|||||||
import acr.browser.lightning.database.BookmarkManager;
|
import acr.browser.lightning.database.BookmarkManager;
|
||||||
import acr.browser.lightning.database.HistoryDatabase;
|
import acr.browser.lightning.database.HistoryDatabase;
|
||||||
import acr.browser.lightning.preference.PreferenceManager;
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.anthonycr.bonsai.Action;
|
import com.anthonycr.bonsai.Action;
|
||||||
import com.anthonycr.bonsai.Observable;
|
import com.anthonycr.bonsai.Observable;
|
||||||
import com.anthonycr.bonsai.OnSubscribe;
|
import com.anthonycr.bonsai.OnSubscribe;
|
||||||
import com.anthonycr.bonsai.Schedulers;
|
import com.anthonycr.bonsai.Schedulers;
|
||||||
import com.anthonycr.bonsai.Subscriber;
|
import com.anthonycr.bonsai.Subscriber;
|
||||||
|
|
||||||
import acr.browser.lightning.utils.FileUtils;
|
import acr.browser.lightning.utils.FileUtils;
|
||||||
import acr.browser.lightning.utils.UrlUtils;
|
import acr.browser.lightning.utils.UrlUtils;
|
||||||
import acr.browser.lightning.view.LightningView;
|
import acr.browser.lightning.view.LightningView;
|
||||||
@ -170,6 +172,16 @@ public class TabsManager {
|
|||||||
builder.setCancelable(true)
|
builder.setCancelable(true)
|
||||||
.setTitle(R.string.title_warning)
|
.setTitle(R.string.title_warning)
|
||||||
.setMessage(R.string.message_blocked_local)
|
.setMessage(R.string.message_blocked_local)
|
||||||
|
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||||
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
if (mTabList.isEmpty()) {
|
||||||
|
newTab(activity, null, false);
|
||||||
|
}
|
||||||
|
finishInitialization();
|
||||||
|
subscriber.onComplete();
|
||||||
|
}
|
||||||
|
})
|
||||||
.setNegativeButton(android.R.string.cancel, null)
|
.setNegativeButton(android.R.string.cancel, null)
|
||||||
.setPositiveButton(R.string.action_open, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.action_open, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -179,14 +191,20 @@ public class TabsManager {
|
|||||||
}).show();
|
}).show();
|
||||||
} else {
|
} else {
|
||||||
newTab(activity, url, false);
|
newTab(activity, url, false);
|
||||||
}
|
if (mTabList.isEmpty()) {
|
||||||
}
|
|
||||||
if (mTabList.size() == 0) {
|
|
||||||
newTab(activity, null, false);
|
newTab(activity, null, false);
|
||||||
}
|
}
|
||||||
finishInitialization();
|
finishInitialization();
|
||||||
subscriber.onComplete();
|
subscriber.onComplete();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (mTabList.isEmpty()) {
|
||||||
|
newTab(activity, null, false);
|
||||||
|
}
|
||||||
|
finishInitialization();
|
||||||
|
subscriber.onComplete();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,17 +236,22 @@ public class BrowserPresenter {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
newTab(url, true);
|
newTab(url, true);
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
newTab(url, true);
|
|
||||||
}
|
|
||||||
mShouldClose = true;
|
mShouldClose = true;
|
||||||
LightningView tab = mTabsModel.lastTab();
|
LightningView tab = mTabsModel.lastTab();
|
||||||
if (tab != null) {
|
if (tab != null) {
|
||||||
tab.setTag(true);
|
tab.setTag(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
newTab(url, true);
|
||||||
|
mShouldClose = true;
|
||||||
|
LightningView tab = mTabsModel.lastTab();
|
||||||
|
if (tab != null) {
|
||||||
|
tab.setTag(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user