Switching to IO scheduler and cleaning up cache method
This commit is contained in:
parent
33f205d557
commit
bb7ec7fd3f
@ -190,8 +190,8 @@ public final class BookmarkPage {
|
|||||||
if (bookmarkUri != null) {
|
if (bookmarkUri != null) {
|
||||||
File faviconFile = FaviconModel.getFaviconCacheFile(mApp, bookmarkUri);
|
File faviconFile = FaviconModel.getFaviconCacheFile(mApp, bookmarkUri);
|
||||||
if (!faviconFile.exists()) {
|
if (!faviconFile.exists()) {
|
||||||
mFaviconModel.cacheFaviconForUrl(mFaviconModel.getDefaultBitmapForString(item.getTitle()), item.getUrl())
|
Bitmap defaultFavicon = mFaviconModel.getDefaultBitmapForString(item.getTitle());
|
||||||
.subscribe();
|
mFaviconModel.cacheFaviconForUrl(defaultFavicon, item.getUrl()).subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
faviconFileUrl = Constants.FILE + faviconFile;
|
faviconFileUrl = Constants.FILE + faviconFile;
|
||||||
|
@ -538,7 +538,7 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
|
|||||||
SubscriptionUtils.safeUnsubscribe(oldSubscription);
|
SubscriptionUtils.safeUnsubscribe(oldSubscription);
|
||||||
|
|
||||||
final Subscription faviconSubscription = mFaviconModel.faviconForUrl(url, web.getTitle())
|
final Subscription faviconSubscription = mFaviconModel.faviconForUrl(url, web.getTitle())
|
||||||
.subscribeOn(Schedulers.worker())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(Schedulers.main())
|
.observeOn(Schedulers.main())
|
||||||
.subscribe(new SingleOnSubscribe<Bitmap>() {
|
.subscribe(new SingleOnSubscribe<Bitmap>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -73,15 +73,9 @@ public class LightningChromeClient extends WebChromeClient {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uri uri = Uri.parse(url);
|
|
||||||
|
|
||||||
if (uri.getHost() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mFaviconModel.cacheFaviconForUrl(icon, url)
|
mFaviconModel.cacheFaviconForUrl(icon, url)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe();
|
.subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -114,21 +108,21 @@ public class LightningChromeClient extends WebChromeClient {
|
|||||||
org = origin;
|
org = origin;
|
||||||
}
|
}
|
||||||
builder.setMessage(org + mActivity.getString(R.string.message_location))
|
builder.setMessage(org + mActivity.getString(R.string.message_location))
|
||||||
.setCancelable(true)
|
.setCancelable(true)
|
||||||
.setPositiveButton(mActivity.getString(R.string.action_allow),
|
.setPositiveButton(mActivity.getString(R.string.action_allow),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
callback.invoke(origin, true, remember);
|
callback.invoke(origin, true, remember);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.setNegativeButton(mActivity.getString(R.string.action_dont_allow),
|
.setNegativeButton(mActivity.getString(R.string.action_dont_allow),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
callback.invoke(origin, false, remember);
|
callback.invoke(origin, false, remember);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
AlertDialog alert = builder.create();
|
AlertDialog alert = builder.create();
|
||||||
alert.show();
|
alert.show();
|
||||||
BrowserDialog.setDialogSize(mActivity, alert);
|
BrowserDialog.setDialogSize(mActivity, alert);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user