Search in sources :

Example 1 with ContextualSearchIconSpriteControl

use of org.chromium.chrome.browser.compositor.bottombar.contextualsearch.ContextualSearchIconSpriteControl in project AndroidChromium by JackyAndroid.

the class ContextualSearchSceneLayer method update.

/**
     * Update the scene layer to draw an OverlayPanel.
     * @param resourceManager Manager to get view and image resources.
     * @param panel The OverlayPanel to render.
     * @param searchBarControl The Search Bar control.
     * @param peekPromoControl The peeking promotion for Contextual Search.
     * @param imageControl The object controlling the image displayed in the Bar.
     */
public void update(ResourceManager resourceManager, ContextualSearchPanel panel, ContextualSearchBarControl searchBarControl, ContextualSearchPeekPromoControl peekPromoControl, ContextualSearchPromoControl promoControl, ContextualSearchImageControl imageControl) {
    // Don't try to update the layer if not initialized or showing.
    if (resourceManager == null || !panel.isShowing())
        return;
    if (!mIsInitialized) {
        nativeCreateContextualSearchLayer(mNativePtr, resourceManager);
        mIsInitialized = true;
    }
    mImageControl = imageControl;
    int searchContextViewId = searchBarControl.getSearchContextViewId();
    int searchTermViewId = searchBarControl.getSearchTermViewId();
    int searchCaptionViewId = searchBarControl.getCaptionViewId();
    int searchPromoViewId = promoControl.getViewId();
    boolean searchPromoVisible = promoControl.isVisible();
    float searchPromoHeightPx = promoControl.getHeightPx();
    float searchPromoOpacity = promoControl.getOpacity();
    int searchPeekPromoTextViewId = peekPromoControl.getViewId();
    boolean searchPeekPromoVisible = peekPromoControl.isVisible();
    float searchPeekPromoHeightPx = peekPromoControl.getHeightPx();
    float searchPeekPromoPaddingPx = peekPromoControl.getPaddingPx();
    float searchPeekPromoRippleWidthPx = peekPromoControl.getRippleWidthPx();
    float searchPeekPromoRippleOpacity = peekPromoControl.getRippleOpacity();
    float searchPeekPromoTextOpacity = peekPromoControl.getTextOpacity();
    boolean thumbnailVisible = imageControl.getThumbnailVisible();
    String thumbnailUrl = imageControl.getThumbnailUrl();
    float thumbnailVisibilityPercentage = imageControl.getThumbnailVisibilityPercentage();
    int thumbnailSize = imageControl.getThumbnailSize();
    ContextualSearchIconSpriteControl spriteControl = imageControl.getIconSpriteControl();
    boolean searchProviderIconSpriteVisible = spriteControl.isVisible();
    float searchProviderIconCompletionPercentage = spriteControl.getCompletionPercentage();
    float searchPanelX = panel.getOffsetX();
    float searchPanelY = panel.getOffsetY();
    float searchPanelWidth = panel.getWidth();
    float searchPanelHeight = panel.getHeight();
    float searchBarMarginSide = panel.getBarMarginSide();
    float searchBarHeight = panel.getBarHeight();
    float searchContextOpacity = searchBarControl.getSearchBarContextOpacity();
    float searchTermOpacity = searchBarControl.getSearchBarTermOpacity();
    float searchCaptionAnimationPercentage = searchBarControl.getCaptionAnimationPercentage();
    boolean searchCaptionVisible = searchBarControl.getCaptionVisible();
    boolean searchBarBorderVisible = panel.isBarBorderVisible();
    float searchBarBorderHeight = panel.getBarBorderHeight();
    boolean searchBarShadowVisible = panel.getBarShadowVisible();
    float searchBarShadowOpacity = panel.getBarShadowOpacity();
    float arrowIconOpacity = panel.getArrowIconOpacity();
    float arrowIconRotation = panel.getArrowIconRotation();
    float closeIconOpacity = panel.getCloseIconOpacity();
    boolean isProgressBarVisible = panel.isProgressBarVisible();
    float progressBarHeight = panel.getProgressBarHeight();
    float progressBarOpacity = panel.getProgressBarOpacity();
    int progressBarCompletion = panel.getProgressBarCompletion();
    WebContents panelWebContents = panel.getContentViewCore() != null ? panel.getContentViewCore().getWebContents() : null;
    nativeUpdateContextualSearchLayer(mNativePtr, R.drawable.contextual_search_bar_background, searchContextViewId, searchTermViewId, searchCaptionViewId, R.drawable.contextual_search_bar_shadow, R.drawable.google_icon_sprite, R.raw.google_icon_sprite, R.drawable.breadcrumb_arrow, ContextualSearchPanel.CLOSE_ICON_DRAWABLE_ID, R.drawable.progress_bar_background, R.drawable.progress_bar_foreground, searchPromoViewId, R.drawable.contextual_search_promo_ripple, searchPeekPromoTextViewId, mDpToPx, panel.getBasePageBrightness(), panel.getBasePageY() * mDpToPx, panelWebContents, searchPromoVisible, searchPromoHeightPx, searchPromoOpacity, searchPeekPromoVisible, searchPeekPromoHeightPx, searchPeekPromoPaddingPx, searchPeekPromoRippleWidthPx, searchPeekPromoRippleOpacity, searchPeekPromoTextOpacity, searchPanelX * mDpToPx, searchPanelY * mDpToPx, searchPanelWidth * mDpToPx, searchPanelHeight * mDpToPx, searchBarMarginSide * mDpToPx, searchBarHeight * mDpToPx, searchContextOpacity, searchTermOpacity, searchCaptionAnimationPercentage, searchCaptionVisible, searchBarBorderVisible, searchBarBorderHeight * mDpToPx, searchBarShadowVisible, searchBarShadowOpacity, searchProviderIconSpriteVisible, searchProviderIconCompletionPercentage, thumbnailVisible, thumbnailVisibilityPercentage, thumbnailSize, thumbnailUrl, arrowIconOpacity, arrowIconRotation, closeIconOpacity, isProgressBarVisible, progressBarHeight * mDpToPx, progressBarOpacity, progressBarCompletion, Profile.getLastUsedProfile());
}
Also used : WebContents(org.chromium.content_public.browser.WebContents) ContextualSearchIconSpriteControl(org.chromium.chrome.browser.compositor.bottombar.contextualsearch.ContextualSearchIconSpriteControl)

Aggregations

ContextualSearchIconSpriteControl (org.chromium.chrome.browser.compositor.bottombar.contextualsearch.ContextualSearchIconSpriteControl)1 WebContents (org.chromium.content_public.browser.WebContents)1