APISonar


com.anthonycr.bonsai.Schedulers.io

> com > anthonycr > bonsai > Schedulers > io
com APIs anthonycr APIs bonsai APIs Schedulers APIs io APIs

Example 1
public void refreshBookmarks() {
        mBookmarkManager.getAllBookmarks()
            .subscribeOn(Schedulers.io())
            .subscribe(new SingleOnSubscribe<List<HistoryItem>>() {
                @Override
                public void onItem(@Nullable List<HistoryItem> item) {
                    Preconditions.checkNonNull(item);
                    mAllBookmarks.clear();
                    mAllBookmarks.addAll(item);
                }
            });
    }
Example 2
private void openHistory() {
        new HistoryPage().getHistoryPage()
            .subscribeOn(Schedulers.io())
            .observeOn(Schedulers.main())
            .subscribe(new SingleOnSubscribe<String>() {
                @Override
                public void onItem(@Nullable String item) {
                    Preconditions.checkNonNull(item);
                    LightningView view = mTabsManager.getCurrentTab();
                    if (view != null) {
                        view.loadUrl(item);
                    }
                }
            });
    }
Example 3
private void cacheFavicon(@Nullable final String url, @Nullable final Bitmap icon) {
        if (icon == null || url == null) {
            return;
        }

        mFaviconModel.cacheFaviconForUrl(icon, url)
            .subscribeOn(Schedulers.io())
            .subscribe();
    }
Example 4
protected void addItemToHistory(@Nullable final String title, @NonNull final String url) {
        if (UrlUtils.isSpecialUrl(url)) {
            return;
        }

        mHistoryModel.visitHistoryItem(url, title)
            .subscribeOn(Schedulers.io())
            .subscribe(new CompletableOnSubscribe() {
                @Override
                public void onError(@NonNull Throwable throwable) {
                    Log.e(TAG, "Exception while updating history", throwable);
                }
            });
    }
Example 5
public static void clearHistory(@NonNull Context context, @NonNull HistoryModel historyModel) {
        historyModel.deleteHistory()
                .subscribeOn(Schedulers.io())
                .subscribe();
        WebViewDatabase m = WebViewDatabase.getInstance(context);
        m.clearFormData();
        m.clearHttpAuthUsernamePassword();
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
            //noinspection deprecation
            m.clearUsernamePassword();
            //noinspection deprecation
            WebIconDatabase.getInstance().removeAllIcons();
        }
        Utils.trimCache(context);
    }
Example 6
AdBlock(@NonNull Application application, @NonNull PreferenceManager preferenceManager) {
        mApplication = application;
        mPreferenceManager = preferenceManager;
        if (mBlockedDomainsList.isEmpty() && BuildConfig.FULL_VERSION) {
            loadHostsFile().subscribeOn(Schedulers.io()).subscribe();
        }
        mBlockAds = mPreferenceManager.getAdBlockEnabled();
    }