Java Code Examples for org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason#UNKNOWN

The following examples show how to use org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChangeReason#UNKNOWN . 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: OverlayPanelAnimation.java    From delion with Apache License 2.0 6 votes vote down vote up
/**
 * Called when layout-specific actions are needed after the animation finishes.
 */
protected void onAnimationFinished() {
    // If animating to a particular PanelState, and after completing
    // resizing the Panel to its desired state, then the Panel's state
    // should be updated. This method also is called when an animation
    // is cancelled (which can happen by a subsequent gesture while
    // an animation is happening). That's why the actual height should
    // be checked.
    // TODO(mdjones): Move animations not directly related to the panel's state into their
    // own animation handler (i.e. peek promo, G sprite, etc.). See https://crbug.com/617307.
    if (mAnimatingState != null && mAnimatingState != PanelState.UNDEFINED
            && getHeight() == getPanelHeightFromState(mAnimatingState)) {
        setPanelState(mAnimatingState, mAnimatingStateReason);
    }

    mAnimatingState = PanelState.UNDEFINED;
    mAnimatingStateReason = StateChangeReason.UNKNOWN;
}
 
Example 2
Source File: OverlayPanelAnimation.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
/**
 * Called when layout-specific actions are needed after the animation finishes.
 */
protected void onAnimationFinished() {
    // If animating to a particular PanelState, and after completing
    // resizing the Panel to its desired state, then the Panel's state
    // should be updated. This method also is called when an animation
    // is cancelled (which can happen by a subsequent gesture while
    // an animation is happening). That's why the actual height should
    // be checked.
    // TODO(mdjones): Move animations not directly related to the panel's state into their
    // own animation handler (i.e. peek promo, G sprite, etc.). See https://crbug.com/617307.
    if (mAnimatingState != null && mAnimatingState != PanelState.UNDEFINED
            && getHeight() == getPanelHeightFromState(mAnimatingState)) {
        setPanelState(mAnimatingState, mAnimatingStateReason);
    }

    mAnimatingState = PanelState.UNDEFINED;
    mAnimatingStateReason = StateChangeReason.UNKNOWN;
}
 
Example 3
Source File: OverlayPanelAnimation.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Called when layout-specific actions are needed after the animation finishes.
 */
protected void onAnimationFinished() {
    // If animating to a particular PanelState, and after completing
    // resizing the Panel to its desired state, then the Panel's state
    // should be updated. This method also is called when an animation
    // is cancelled (which can happen by a subsequent gesture while
    // an animation is happening). That's why the actual height should
    // be checked.
    // TODO(mdjones): Move animations not directly related to the panel's state into their
    // own animation handler (i.e. peek promo, G sprite, etc.). See https://crbug.com/617307.
    if (mAnimatingState != null && mAnimatingState != PanelState.UNDEFINED
            && getHeight() == getPanelHeightFromState(mAnimatingState)) {
        setPanelState(mAnimatingState, mAnimatingStateReason);
    }

    mAnimatingState = PanelState.UNDEFINED;
    mAnimatingStateReason = StateChangeReason.UNKNOWN;
}
 
Example 4
Source File: OverlayPanelManager.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Notify the manager that some other object hid the panel.
 * NOTE(mdjones): It is possible that a panel other than the one currently showing was hidden.
 * @param panel The panel that was closed.
 */
public void notifyPanelClosed(OverlayPanel panel, StateChangeReason reason) {
    // TODO(mdjones): Close should behave like "requestShowPanel". The reason it currently does
    // not is because closing will cancel animation for that panel. This method waits for the
    // panel's "onClosed" event to fire, thus preserving the animation.
    if (panel == null) return;

    // If the reason to close was to suppress, only suppress the panel.
    if (reason == StateChangeReason.SUPPRESS) {
        if (mActivePanel == panel) {
            if (mActivePanel.canBeSuppressed()) {
                mSuppressedPanel = mActivePanel;
            }
            mActivePanel = mPendingPanel;
            mActivePanel.peekPanel(mPendingReason);
            mPendingPanel = null;
            mPendingReason = StateChangeReason.UNKNOWN;
        }
    } else {
        // Normal close panel flow.
        if (panel == mActivePanel) {
            mActivePanel = null;
            if (mSuppressedPanel != null) {
                mActivePanel = mSuppressedPanel;
                mActivePanel.peekPanel(StateChangeReason.UNSUPPRESS);
            }
        }
        mSuppressedPanel = null;
    }
}
 
Example 5
Source File: OverlayPanelManager.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Notify the manager that some other object hid the panel.
 * NOTE(mdjones): It is possible that a panel other than the one currently showing was hidden.
 * @param panel The panel that was closed.
 */
public void notifyPanelClosed(OverlayPanel panel, StateChangeReason reason) {
    // TODO(mdjones): Close should behave like "requestShowPanel". The reason it currently does
    // not is because closing will cancel animation for that panel. This method waits for the
    // panel's "onClosed" event to fire, thus preserving the animation.
    if (panel == null) return;

    // If the reason to close was to suppress, only suppress the panel.
    if (reason == StateChangeReason.SUPPRESS) {
        if (mActivePanel == panel) {
            if (mActivePanel.canBeSuppressed()) {
                mSuppressedPanels.add(mActivePanel);
            }
            mActivePanel = mPendingPanel;
            mActivePanel.peekPanel(mPendingReason);
            mPendingPanel = null;
            mPendingReason = StateChangeReason.UNKNOWN;
        }
    } else {
        // Normal close panel flow.
        if (panel == mActivePanel) {
            mActivePanel = null;
            if (!mSuppressedPanels.isEmpty()) {
                mActivePanel = mSuppressedPanels.poll();
                mActivePanel.peekPanel(StateChangeReason.UNSUPPRESS);
            }
        } else {
            mSuppressedPanels.remove(panel);
        }
    }
}
 
Example 6
Source File: OverlayPanelManager.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Notify the manager that some other object hid the panel.
 * NOTE(mdjones): It is possible that a panel other than the one currently showing was hidden.
 * @param panel The panel that was closed.
 */
public void notifyPanelClosed(OverlayPanel panel, StateChangeReason reason) {
    // TODO(mdjones): Close should behave like "requestShowPanel". The reason it currently does
    // not is because closing will cancel animation for that panel. This method waits for the
    // panel's "onClosed" event to fire, thus preserving the animation.
    if (panel == null) return;

    // If the reason to close was to suppress, only suppress the panel.
    if (reason == StateChangeReason.SUPPRESS) {
        if (mActivePanel == panel) {
            if (mActivePanel.canBeSuppressed()) {
                mSuppressedPanels.add(mActivePanel);
            }
            mActivePanel = mPendingPanel;
            mActivePanel.peekPanel(mPendingReason);
            mPendingPanel = null;
            mPendingReason = StateChangeReason.UNKNOWN;
        }
    } else {
        // Normal close panel flow.
        if (panel == mActivePanel) {
            mActivePanel = null;
            if (!mSuppressedPanels.isEmpty()) {
                mActivePanel = mSuppressedPanels.poll();
                mActivePanel.peekPanel(StateChangeReason.UNSUPPRESS);
            }
        } else {
            mSuppressedPanels.remove(panel);
        }
    }
}