Search in sources :

Example 1 with DrawingInfo

use of org.chromium.chrome.browser.widget.ClipDrawableProgressBar.DrawingInfo in project AndroidChromium by JackyAndroid.

the class ToolbarSceneLayer method update.

/**
     * Update the toolbar and progress bar layers.
     *
     * @param topControlsBackgroundColor The background color of the top controls.
     * @param topControlsUrlBarAlpha The alpha of the URL bar.
     * @param fullscreenManager A ChromeFullscreenManager instance.
     * @param resourceManager A ResourceManager for loading static resources.
     * @param forceHideAndroidTopControls True if the Android top controls are being hidden.
     * @param sizingFlags The sizing flags for the toolbar.
     * @param isTablet If the device is a tablet.
     */
private void update(int topControlsBackgroundColor, float topControlsUrlBarAlpha, ChromeFullscreenManager fullscreenManager, ResourceManager resourceManager, boolean forceHideAndroidTopControls, int sizingFlags, boolean isTablet) {
    if (!DeviceClassManager.enableFullscreen())
        return;
    if (fullscreenManager == null)
        return;
    ControlContainer toolbarContainer = fullscreenManager.getControlContainer();
    if (!isTablet && toolbarContainer != null) {
        if (mProgressBarDrawingInfo == null)
            mProgressBarDrawingInfo = new DrawingInfo();
        toolbarContainer.getProgressBarDrawingInfo(mProgressBarDrawingInfo);
    } else {
        assert mProgressBarDrawingInfo == null;
    }
    float offset = fullscreenManager.getControlOffset();
    boolean useTexture = fullscreenManager.drawControlsAsTexture() || offset == 0 || forceHideAndroidTopControls;
    fullscreenManager.setHideTopControlsAndroidView(forceHideAndroidTopControls);
    if ((sizingFlags & SizingFlags.REQUIRE_FULLSCREEN_SIZE) != 0 && (sizingFlags & SizingFlags.ALLOW_TOOLBAR_HIDE) == 0 && (sizingFlags & SizingFlags.ALLOW_TOOLBAR_ANIMATE) == 0) {
        useTexture = false;
    }
    nativeUpdateToolbarLayer(mNativePtr, resourceManager, R.id.control_container, topControlsBackgroundColor, R.drawable.textbox, topControlsUrlBarAlpha, offset, useTexture, forceHideAndroidTopControls);
    if (mProgressBarDrawingInfo == null)
        return;
    nativeUpdateProgressBar(mNativePtr, mProgressBarDrawingInfo.progressBarRect.left, mProgressBarDrawingInfo.progressBarRect.top, mProgressBarDrawingInfo.progressBarRect.width(), mProgressBarDrawingInfo.progressBarRect.height(), mProgressBarDrawingInfo.progressBarColor, mProgressBarDrawingInfo.progressBarBackgroundRect.left, mProgressBarDrawingInfo.progressBarBackgroundRect.top, mProgressBarDrawingInfo.progressBarBackgroundRect.width(), mProgressBarDrawingInfo.progressBarBackgroundRect.height(), mProgressBarDrawingInfo.progressBarBackgroundColor);
}
Also used : DrawingInfo(org.chromium.chrome.browser.widget.ClipDrawableProgressBar.DrawingInfo) ControlContainer(org.chromium.chrome.browser.widget.ControlContainer)

Aggregations

DrawingInfo (org.chromium.chrome.browser.widget.ClipDrawableProgressBar.DrawingInfo)1 ControlContainer (org.chromium.chrome.browser.widget.ControlContainer)1