Search in sources :

Example 1 with StackLayout

use of org.chromium.chrome.browser.compositor.layouts.phone.StackLayout in project AndroidChromium by JackyAndroid.

the class ChromeTabbedActivity method toggleOverview.

private void toggleOverview() {
    Tab currentTab = getActivityTab();
    ContentViewCore contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null;
    if (!mLayoutManager.overviewVisible()) {
        getCompositorViewHolder().hideKeyboard(new Runnable() {

            @Override
            public void run() {
                mLayoutManager.showOverview(true);
            }
        });
        if (contentViewCore != null) {
            contentViewCore.setAccessibilityState(false);
        }
    } else {
        Layout activeLayout = mLayoutManager.getActiveLayout();
        if (activeLayout instanceof StackLayout) {
            ((StackLayout) activeLayout).commitOutstandingModelState(LayoutManager.time());
        }
        if (getCurrentTabModel().getCount() != 0) {
            // Don't hide overview if current tab stack is empty()
            mLayoutManager.hideOverview(true);
            // hideOverview could change the current tab.  Update the local variables.
            currentTab = getActivityTab();
            contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null;
            if (contentViewCore != null) {
                contentViewCore.setAccessibilityState(true);
            }
        }
    }
}
Also used : Tab(org.chromium.chrome.browser.tab.Tab) ContentViewCore(org.chromium.content.browser.ContentViewCore) FrameLayout(android.widget.FrameLayout) StackLayout(org.chromium.chrome.browser.compositor.layouts.phone.StackLayout) Layout(org.chromium.chrome.browser.compositor.layouts.Layout) StackLayout(org.chromium.chrome.browser.compositor.layouts.phone.StackLayout)

Example 2 with StackLayout

use of org.chromium.chrome.browser.compositor.layouts.phone.StackLayout in project AndroidChromium by JackyAndroid.

the class LayoutManagerDocumentTabSwitcher method toggleOverview.

public void toggleOverview() {
    Tab tab = getTabModelSelector().getCurrentTab();
    ContentViewCore contentViewCore = tab != null ? tab.getContentViewCore() : null;
    if (!overviewVisible()) {
        mHost.hideKeyboard(new Runnable() {

            @Override
            public void run() {
                showOverview(true);
            }
        });
        if (contentViewCore != null) {
            contentViewCore.setAccessibilityState(false);
        }
    } else {
        Layout activeLayout = getActiveLayout();
        if (activeLayout instanceof StackLayout) {
            ((StackLayout) activeLayout).commitOutstandingModelState(LayoutManager.time());
        }
        if (getTabModelSelector().getCurrentModel().getCount() != 0) {
            // Don't hide overview if current tab stack is empty()
            hideOverview(true);
            // hideOverview could change the current tab.  Update the local variables.
            tab = getTabModelSelector().getCurrentTab();
            contentViewCore = tab != null ? tab.getContentViewCore() : null;
            if (contentViewCore != null) {
                contentViewCore.setAccessibilityState(true);
            }
        }
    }
}
Also used : Tab(org.chromium.chrome.browser.tab.Tab) LayoutTab(org.chromium.chrome.browser.compositor.layouts.components.LayoutTab) ContentViewCore(org.chromium.content.browser.ContentViewCore) OverviewListLayout(org.chromium.chrome.browser.widget.OverviewListLayout) StackLayout(org.chromium.chrome.browser.compositor.layouts.phone.StackLayout) StackLayout(org.chromium.chrome.browser.compositor.layouts.phone.StackLayout)

Aggregations

StackLayout (org.chromium.chrome.browser.compositor.layouts.phone.StackLayout)2 Tab (org.chromium.chrome.browser.tab.Tab)2 ContentViewCore (org.chromium.content.browser.ContentViewCore)2 FrameLayout (android.widget.FrameLayout)1 Layout (org.chromium.chrome.browser.compositor.layouts.Layout)1 LayoutTab (org.chromium.chrome.browser.compositor.layouts.components.LayoutTab)1 OverviewListLayout (org.chromium.chrome.browser.widget.OverviewListLayout)1