Java Code Examples for org.chromium.chrome.browser.compositor.bottombar.OverlayPanel#isShowing()

The following examples show how to use org.chromium.chrome.browser.compositor.bottombar.OverlayPanel#isShowing() . 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: ReaderModeSceneLayer.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Update the scene layer to draw an OverlayPanel.
 * @param resourceManager Manager to get view and image resources.
 * @param panel The OverlayPanel to render.
 * @param barTextViewId The ID of the view containing the Reader Mode text.
 * @param barTextOpacity The opacity of the text specified by {@code barTextViewId}.
 */
public void update(ResourceManager resourceManager, OverlayPanel panel, int barTextViewId,
        float barTextOpacity) {
    // Don't try to update the layer if not initialized or showing.
    if (resourceManager == null || !panel.isShowing()) return;

    if (!mIsInitialized) {
        nativeCreateReaderModeLayer(mNativePtr, resourceManager);
        // TODO(mdjones): Rename contextual search resources below to be generic to overlay
        // panels.
        nativeSetResourceIds(mNativePtr,
                barTextViewId,
                R.drawable.contextual_search_bar_background,
                R.drawable.contextual_search_bar_shadow,
                R.drawable.infobar_mobile_friendly,
                R.drawable.btn_close);
        mIsInitialized = true;
    }

    nativeUpdate(mNativePtr,
            mDpToPx,
            panel.getBasePageBrightness(),
            panel.getBasePageY() * mDpToPx,
            panel.getContentViewCore(),
            panel.getOffsetX() * mDpToPx,
            panel.getOffsetY() * mDpToPx,
            panel.getWidth() * mDpToPx,
            panel.getHeight() * mDpToPx,
            panel.getBarMarginSide() * mDpToPx,
            panel.getBarHeight() * mDpToPx,
            barTextOpacity,
            panel.isBarBorderVisible(),
            panel.getBarBorderHeight() * mDpToPx,
            panel.getBarShadowVisible(),
            panel.getBarShadowOpacity());
}
 
Example 2
Source File: ReaderModeSceneLayer.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Update the scene layer to draw an OverlayPanel.
 * @param resourceManager Manager to get view and image resources.
 * @param panel The OverlayPanel to render.
 * @param barTextViewId The ID of the view containing the Reader Mode text.
 * @param barTextOpacity The opacity of the text specified by {@code barTextViewId}.
 */
public void update(ResourceManager resourceManager, OverlayPanel panel, int barTextViewId,
        float barTextOpacity) {
    // Don't try to update the layer if not initialized or showing.
    if (resourceManager == null || !panel.isShowing()) return;

    if (!mIsInitialized) {
        nativeCreateReaderModeLayer(mNativePtr, resourceManager);
        // TODO(mdjones): Rename contextual search resources below to be generic to overlay
        // panels.
        nativeSetResourceIds(mNativePtr,
                barTextViewId,
                R.drawable.contextual_search_bar_background,
                R.drawable.contextual_search_bar_shadow,
                R.drawable.infobar_mobile_friendly,
                R.drawable.btn_close);
        mIsInitialized = true;
    }

    WebContents panelWebContents = panel.getContentViewCore() != null
            ? panel.getContentViewCore().getWebContents() : null;

    nativeUpdate(mNativePtr,
            mDpToPx,
            panel.getBasePageBrightness(),
            panel.getBasePageY() * mDpToPx,
            panelWebContents,
            panel.getOffsetX() * mDpToPx,
            panel.getOffsetY() * mDpToPx,
            panel.getWidth() * mDpToPx,
            panel.getHeight() * mDpToPx,
            panel.getBarMarginSide() * mDpToPx,
            panel.getBarHeight() * mDpToPx,
            barTextOpacity,
            panel.isBarBorderVisible(),
            panel.getBarBorderHeight() * mDpToPx,
            panel.getBarShadowVisible(),
            panel.getBarShadowOpacity());
}
 
Example 3
Source File: ReaderModeSceneLayer.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Update the scene layer to draw an OverlayPanel.
 * @param resourceManager Manager to get view and image resources.
 * @param panel The OverlayPanel to render.
 * @param barTextViewId The ID of the view containing the Reader Mode text.
 * @param barTextOpacity The opacity of the text specified by {@code barTextViewId}.
 */
public void update(ResourceManager resourceManager, OverlayPanel panel, int barTextViewId,
        float barTextOpacity) {
    // Don't try to update the layer if not initialized or showing.
    if (resourceManager == null || !panel.isShowing()) return;

    if (!mIsInitialized) {
        nativeCreateReaderModeLayer(mNativePtr, resourceManager);
        // TODO(mdjones): Rename contextual search resources below to be generic to overlay
        // panels.
        nativeSetResourceIds(mNativePtr,
                barTextViewId,
                R.drawable.contextual_search_bar_background,
                R.drawable.contextual_search_bar_shadow,
                R.drawable.infobar_mobile_friendly,
                R.drawable.btn_close);
        mIsInitialized = true;
    }

    WebContents panelWebContents = panel.getContentViewCore() != null
            ? panel.getContentViewCore().getWebContents() : null;

    nativeUpdate(mNativePtr,
            mDpToPx,
            panel.getBasePageBrightness(),
            panel.getBasePageY() * mDpToPx,
            panelWebContents,
            panel.getOffsetX() * mDpToPx,
            panel.getOffsetY() * mDpToPx,
            panel.getWidth() * mDpToPx,
            panel.getHeight() * mDpToPx,
            panel.getBarMarginSide() * mDpToPx,
            panel.getBarHeight() * mDpToPx,
            barTextOpacity,
            panel.isBarBorderVisible(),
            panel.getBarBorderHeight() * mDpToPx,
            panel.getBarShadowVisible(),
            panel.getBarShadowOpacity());
}