Java Code Examples for org.chromium.chrome.browser.compositor.layouts.components.LayoutTab#setDrawDecoration()

The following examples show how to use org.chromium.chrome.browser.compositor.layouts.components.LayoutTab#setDrawDecoration() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleAnimationLayout.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Animate the closing of a tab
 */
@Override
public void onTabClosed(long time, int id, int nextId, boolean incognito) {
    super.onTabClosed(time, id, nextId, incognito);

    if (mClosedTab != null) {
        TabModel nextModel = mTabModelSelector.getModelForTabId(nextId);
        if (nextModel != null) {
            LayoutTab nextLayoutTab =
                    createLayoutTab(nextId, nextModel.isIncognito(), NO_CLOSE_BUTTON, NO_TITLE);
            nextLayoutTab.setDrawDecoration(false);

            mLayoutTabs = new LayoutTab[] {nextLayoutTab, mClosedTab};
            updateCacheVisibleIds(
                    new LinkedList<Integer>(Arrays.asList(nextId, mClosedTab.getId())));
        } else {
            mLayoutTabs = new LayoutTab[] {mClosedTab};
        }

        forceAnimationToFinish();
        mAnimatedTab = mClosedTab;
        addToAnimation(this, Property.DISCARD_AMOUNT, 0, getDiscardRange(),
                TAB_CLOSED_ANIMATION_DURATION, 0, false,
                BakedBezierInterpolator.FADE_OUT_CURVE);

        mClosedTab = null;
        if (nextModel != null) {
            mTabModelSelector.selectModel(nextModel.isIncognito());
        }
    }
    startHiding(nextId, false);
}
 
Example 2
Source File: SimpleAnimationLayout.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Animate the closing of a tab
 */
@Override
public void onTabClosed(long time, int id, int nextId, boolean incognito) {
    super.onTabClosed(time, id, nextId, incognito);

    if (mClosedTab != null) {
        TabModel nextModel = mTabModelSelector.getModelForTabId(nextId);
        if (nextModel != null) {
            LayoutTab nextLayoutTab =
                    createLayoutTab(nextId, nextModel.isIncognito(), NO_CLOSE_BUTTON, NO_TITLE);
            nextLayoutTab.setDrawDecoration(false);

            mLayoutTabs = new LayoutTab[] {nextLayoutTab, mClosedTab};
            updateCacheVisibleIds(
                    new LinkedList<Integer>(Arrays.asList(nextId, mClosedTab.getId())));
        } else {
            mLayoutTabs = new LayoutTab[] {mClosedTab};
        }

        forceAnimationToFinish();
        mAnimatedTab = mClosedTab;
        addToAnimation(this, Property.DISCARD_AMOUNT, 0, getDiscardRange(),
                TAB_CLOSED_ANIMATION_DURATION, 0, false,
                BakedBezierInterpolator.FADE_OUT_CURVE);

        mClosedTab = null;
        if (nextModel != null) {
            mTabModelSelector.selectModel(nextModel.isIncognito());
        }
    }
    startHiding(nextId, false);
}
 
Example 3
Source File: SimpleAnimationLayout.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Animate the closing of a tab
 */
@Override
public void onTabClosed(long time, int id, int nextId, boolean incognito) {
    super.onTabClosed(time, id, nextId, incognito);

    if (mClosedTab != null) {
        TabModel nextModel = mTabModelSelector.getModelForTabId(nextId);
        if (nextModel != null) {
            LayoutTab nextLayoutTab =
                    createLayoutTab(nextId, nextModel.isIncognito(), NO_CLOSE_BUTTON, NO_TITLE);
            nextLayoutTab.setDrawDecoration(false);

            mLayoutTabs = new LayoutTab[] {nextLayoutTab, mClosedTab};
            updateCacheVisibleIds(
                    new LinkedList<Integer>(Arrays.asList(nextId, mClosedTab.getId())));
        } else {
            mLayoutTabs = new LayoutTab[] {mClosedTab};
        }

        forceAnimationToFinish();
        mAnimatedTab = mClosedTab;
        addToAnimation(this, Property.DISCARD_AMOUNT, 0, getDiscardRange(),
                TAB_CLOSED_ANIMATION_DURATION, 0, false,
                BakedBezierInterpolator.FADE_OUT_CURVE);

        mClosedTab = null;
        if (nextModel != null) {
            mTabModelSelector.selectModel(nextModel.isIncognito());
        }
    }
    startHiding(nextId, false);
}