当前位置: 首页>>代码示例>>Java>>正文


Java PanelState.UNDEFINED属性代码示例

本文整理汇总了Java中org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState.UNDEFINED属性的典型用法代码示例。如果您正苦于以下问题:Java PanelState.UNDEFINED属性的具体用法?Java PanelState.UNDEFINED怎么用?Java PanelState.UNDEFINED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState的用法示例。


在下文中一共展示了PanelState.UNDEFINED属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onAnimationFinished

/**
 * 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;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:20,代码来源:OverlayPanelAnimation.java

示例2: getPreviousPanelState

/**
 * @return The {@code PanelState} that is before the |state| in the order of states.
 */
private PanelState getPreviousPanelState(PanelState state) {
    PanelState prevState = PREVIOUS_STATES.get(state);
    if (!isSupportedState(PanelState.EXPANDED)) {
        prevState = PREVIOUS_STATES.get(prevState);
    }
    return prevState != null ? prevState : PanelState.UNDEFINED;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:10,代码来源:OverlayPanelBase.java

示例3: handleSizeChanged

@Override
protected void handleSizeChanged(float width, float height, float previousWidth) {
    if (!isShowing()) return;

    boolean wasFullWidthSizePanel = doesMatchFullWidthCriteria(previousWidth);
    boolean isFullWidthSizePanel = isFullWidthSizePanel();
    // We support resize from any full width to full width, or from narrow width to narrow width
    // when the width does not change (as when the keyboard is shown/hidden).
    boolean isPanelResizeSupported = isFullWidthSizePanel && wasFullWidthSizePanel
            || !isFullWidthSizePanel && !wasFullWidthSizePanel && width == previousWidth;

    // TODO(pedrosimonetti): See crbug.com/568351.
    // We can't keep the panel opened after a viewport size change when the panel's
    // ContentView needs to be resized to a non-default size. The panel provides
    // different desired MeasureSpecs when full-width vs narrow-width
    // (See {@link OverlayPanel#createNewOverlayPanelContentInternal()}).
    // When the activity is resized, ContentViewClient asks for the MeasureSpecs
    // before the panel is notified of the size change, resulting in the panel's
    // ContentView being laid out incorrectly.
    if (isPanelResizeSupported) {
        if (mAnimatingState != PanelState.UNDEFINED) {
            // If the size changes when an animation is happening, then we need to restart the
            // animation, because the size of the Panel might have changed as well.
            animatePanelToState(mAnimatingState, mAnimatingStateReason);
        } else {
            updatePanelForSizeChange();
        }
    } else {
        // TODO(pedrosimonetti): Find solution that does not require async handling.
        // NOTE(pedrosimonetti): Should close the Panel asynchronously because
        // we might be in the middle of laying out the CompositorViewHolder
        // View. See {@link CompositorViewHolder#onLayout()}. Closing the Panel
        // has the effect of destroying the Views used by the Panel (which are
        // children of the CompositorViewHolder), and if we do that synchronously
        // it will cause a crash in {@link FrameLayout#layoutChildren()}.
        mContainerView.getHandler().post(new Runnable() {
            @Override
            public void run() {
                closePanel(StateChangeReason.UNKNOWN, false);
            }
        });
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:43,代码来源:OverlayPanelAnimation.java

示例4: isValidUiState

/**
 * Determines if a given {@code PanelState} is a valid UI state. The UNDEFINED state
 * should never be considered a valid UI state.
 * @param state The given state.
 * @return Whether the state is valid.
 */
private boolean isValidUiState(PanelState state) {
    // TODO(pedrosimonetti): consider removing the UNDEFINED state
    // which would allow removing this method.
    return isSupportedState(state) && state != PanelState.UNDEFINED;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:11,代码来源:OverlayPanelBase.java

示例5: isOngoingContextualSearch

/**
 * @param fromState The state the panel is transitioning from.
 * @return Whether there is an ongoing contextual search.
 */
private boolean isOngoingContextualSearch(PanelState fromState) {
    return fromState != PanelState.UNDEFINED && fromState != PanelState.CLOSED;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:7,代码来源:ContextualSearchPanelMetrics.java


注:本文中的org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState.UNDEFINED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。