Search in sources :

Example 26 with LightningView

use of acr.browser.lightning.view.LightningView in project Lightning-Browser by anthonycr.

the class BrowserPresenter method loadUrlInCurrentView.

/**
     * Loads a URL in the current tab.
     *
     * @param url the URL to load, must
     *            not be null.
     */
public void loadUrlInCurrentView(@NonNull final String url) {
    final LightningView currentTab = mTabsModel.getCurrentTab();
    if (currentTab == null) {
        // This is a problem, probably an assert will be better than a return
        return;
    }
    currentTab.loadUrl(url);
}
Also used : LightningView(acr.browser.lightning.view.LightningView)

Example 27 with LightningView

use of acr.browser.lightning.view.LightningView in project Lightning-Browser by anthonycr.

the class TabsManager method resumeAll.

/**
     * Method used to resume all the tabs in the browser.
     * This is necessary because we cannot pause the
     * WebView when the app is open currently due to a
     * bug in the WebView, where calling onResume doesn't
     * consistently resume it.
     *
     * @param context the context needed to initialize
     *                the LightningView preferences.
     */
public void resumeAll(@NonNull Context context) {
    LightningView current = getCurrentTab();
    if (current != null) {
        current.resumeTimers();
    }
    for (LightningView tab : mTabList) {
        if (tab != null) {
            tab.onResume();
            tab.initializePreferences(context);
        }
    }
}
Also used : LightningView(acr.browser.lightning.view.LightningView)

Aggregations

LightningView (acr.browser.lightning.view.LightningView)27 Intent (android.content.Intent)3 DialogInterface (android.content.DialogInterface)2 Bundle (android.os.Bundle)2 IOException (java.io.IOException)2 BookmarkPage (acr.browser.lightning.constant.BookmarkPage)1 DownloadsPage (acr.browser.lightning.constant.DownloadsPage)1 HistoryPage (acr.browser.lightning.constant.HistoryPage)1 StartPage (acr.browser.lightning.constant.StartPage)1 HistoryItem (acr.browser.lightning.database.HistoryItem)1 BrowserDialog (acr.browser.lightning.dialog.BrowserDialog)1 BookmarksFragment (acr.browser.lightning.fragment.BookmarksFragment)1 TabsFragment (acr.browser.lightning.fragment.TabsFragment)1 IntentUtils (acr.browser.lightning.utils.IntentUtils)1 Dialog (android.app.Dialog)1 ClipData (android.content.ClipData)1 ClipboardManager (android.content.ClipboardManager)1 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 Fragment (android.support.v4.app.Fragment)1