Java Code Examples for org.chromium.chrome.browser.compositor.overlays.strip.StripLayoutHelperManager#getHeight()
The following examples show how to use
org.chromium.chrome.browser.compositor.overlays.strip.StripLayoutHelperManager#getHeight() .
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: TabStripSceneLayer.java From delion with Apache License 2.0 | 6 votes |
/** * Pushes all relevant {@link StripLayoutTab}s to the CC Layer tree. * This also pushes any other assets required to draw the Tab Strip. This should only be called * when the Compositor has disabled ScheduleComposite calls as this will change the tree and * could subsequently cause unnecessary follow up renders. * * @param layoutHelper A layout helper for the tab strip. * @param layerTitleCache A layer title cache. * @param resourceManager A resource manager. * @param stripLayoutTabsToRender Array of strip layout tabs. * @param yOffset Current top controls offset in dp. */ public void pushAndUpdateStrip(StripLayoutHelperManager layoutHelper, LayerTitleCache layerTitleCache, ResourceManager resourceManager, StripLayoutTab[] stripLayoutTabsToRender, float yOffset, int selectedTabId) { if (mNativePtr == 0) return; final boolean visible = yOffset > -layoutHelper.getHeight(); // This will hide the tab strips if necessary. nativeBeginBuildingFrame(mNativePtr, visible); // When strip tabs are completely off screen, we don't need to update it. if (visible) { pushButtonsAndBackground(layoutHelper, resourceManager, yOffset); pushStripTabs(layoutHelper, layerTitleCache, resourceManager, stripLayoutTabsToRender, selectedTabId); } nativeFinishBuildingFrame(mNativePtr); }
Example 2
Source File: TabStripSceneLayer.java From AndroidChromium with Apache License 2.0 | 6 votes |
/** * Pushes all relevant {@link StripLayoutTab}s to the CC Layer tree. * This also pushes any other assets required to draw the Tab Strip. This should only be called * when the Compositor has disabled ScheduleComposite calls as this will change the tree and * could subsequently cause unnecessary follow up renders. * * @param layoutHelper A layout helper for the tab strip. * @param layerTitleCache A layer title cache. * @param resourceManager A resource manager. * @param stripLayoutTabsToRender Array of strip layout tabs. * @param yOffset Current browser controls offset in dp. */ public void pushAndUpdateStrip(StripLayoutHelperManager layoutHelper, LayerTitleCache layerTitleCache, ResourceManager resourceManager, StripLayoutTab[] stripLayoutTabsToRender, float yOffset, int selectedTabId) { if (mNativePtr == 0) return; final boolean visible = yOffset > -layoutHelper.getHeight(); // This will hide the tab strips if necessary. nativeBeginBuildingFrame(mNativePtr, visible); // When strip tabs are completely off screen, we don't need to update it. if (visible) { pushButtonsAndBackground(layoutHelper, resourceManager, yOffset); pushStripTabs(layoutHelper, layerTitleCache, resourceManager, stripLayoutTabsToRender, selectedTabId); } nativeFinishBuildingFrame(mNativePtr); }
Example 3
Source File: TabStripSceneLayer.java From 365browser with Apache License 2.0 | 6 votes |
/** * Pushes all relevant {@link StripLayoutTab}s to the CC Layer tree. * This also pushes any other assets required to draw the Tab Strip. This should only be called * when the Compositor has disabled ScheduleComposite calls as this will change the tree and * could subsequently cause unnecessary follow up renders. * * @param layoutHelper A layout helper for the tab strip. * @param layerTitleCache A layer title cache. * @param resourceManager A resource manager. * @param stripLayoutTabsToRender Array of strip layout tabs. * @param yOffset Current browser controls offset in dp. */ public void pushAndUpdateStrip(StripLayoutHelperManager layoutHelper, LayerTitleCache layerTitleCache, ResourceManager resourceManager, StripLayoutTab[] stripLayoutTabsToRender, float yOffset, int selectedTabId) { if (mNativePtr == 0) return; final boolean visible = yOffset > -layoutHelper.getHeight(); // This will hide the tab strips if necessary. nativeBeginBuildingFrame(mNativePtr, visible); // When strip tabs are completely off screen, we don't need to update it. if (visible) { pushButtonsAndBackground(layoutHelper, resourceManager, yOffset); pushStripTabs(layoutHelper, layerTitleCache, resourceManager, stripLayoutTabsToRender, selectedTabId); } nativeFinishBuildingFrame(mNativePtr); }
Example 4
Source File: TabStripSceneLayer.java From delion with Apache License 2.0 | 5 votes |
private void pushButtonsAndBackground(StripLayoutHelperManager layoutHelper, ResourceManager resourceManager, float yOffset) { final float width = layoutHelper.getWidth() * mDpToPx; final float height = layoutHelper.getHeight() * mDpToPx; nativeUpdateTabStripLayer(mNativePtr, width, height, yOffset * mDpToPx, layoutHelper.getBackgroundTabBrightness(), layoutHelper.getBrightness(), shouldReaddBackground(layoutHelper.getOrientation())); CompositorButton newTabButton = layoutHelper.getNewTabButton(); CompositorButton modelSelectorButton = layoutHelper.getModelSelectorButton(); boolean newTabButtonVisible = newTabButton.isVisible(); boolean modelSelectorButtonVisible = modelSelectorButton.isVisible(); nativeUpdateNewTabButton(mNativePtr, newTabButton.getResourceId(), newTabButton.getX() * mDpToPx, newTabButton.getY() * mDpToPx, newTabButton.getWidth() * mDpToPx, newTabButton.getHeight() * mDpToPx, newTabButtonVisible, resourceManager); nativeUpdateModelSelectorButton(mNativePtr, modelSelectorButton.getResourceId(), modelSelectorButton.getX() * mDpToPx, modelSelectorButton.getY() * mDpToPx, modelSelectorButton.getWidth() * mDpToPx, modelSelectorButton.getHeight() * mDpToPx, modelSelectorButton.isIncognito(), modelSelectorButtonVisible, resourceManager); int leftFadeDrawable = modelSelectorButtonVisible && LocalizationUtils.isLayoutRtl() ? R.drawable.tab_strip_fade_for_model_selector : R.drawable.tab_strip_fade; int rightFadeDrawable = modelSelectorButtonVisible && !LocalizationUtils.isLayoutRtl() ? R.drawable.tab_strip_fade_for_model_selector : R.drawable.tab_strip_fade; nativeUpdateTabStripLeftFade(mNativePtr, leftFadeDrawable, layoutHelper.getLeftFadeOpacity(), resourceManager); nativeUpdateTabStripRightFade(mNativePtr, rightFadeDrawable, layoutHelper.getRightFadeOpacity(), resourceManager); }
Example 5
Source File: TabStripSceneLayer.java From AndroidChromium with Apache License 2.0 | 5 votes |
private void pushButtonsAndBackground(StripLayoutHelperManager layoutHelper, ResourceManager resourceManager, float yOffset) { final float width = layoutHelper.getWidth() * mDpToPx; final float height = layoutHelper.getHeight() * mDpToPx; nativeUpdateTabStripLayer(mNativePtr, width, height, yOffset * mDpToPx, layoutHelper.getBackgroundTabBrightness(), layoutHelper.getBrightness(), shouldReaddBackground(layoutHelper.getOrientation())); CompositorButton newTabButton = layoutHelper.getNewTabButton(); CompositorButton modelSelectorButton = layoutHelper.getModelSelectorButton(); boolean newTabButtonVisible = newTabButton.isVisible(); boolean modelSelectorButtonVisible = modelSelectorButton.isVisible(); nativeUpdateNewTabButton(mNativePtr, newTabButton.getResourceId(), newTabButton.getX() * mDpToPx, newTabButton.getY() * mDpToPx, newTabButton.getWidth() * mDpToPx, newTabButton.getHeight() * mDpToPx, newTabButtonVisible, resourceManager); nativeUpdateModelSelectorButton(mNativePtr, modelSelectorButton.getResourceId(), modelSelectorButton.getX() * mDpToPx, modelSelectorButton.getY() * mDpToPx, modelSelectorButton.getWidth() * mDpToPx, modelSelectorButton.getHeight() * mDpToPx, modelSelectorButton.isIncognito(), modelSelectorButtonVisible, resourceManager); int leftFadeDrawable = modelSelectorButtonVisible && LocalizationUtils.isLayoutRtl() ? R.drawable.tab_strip_fade_for_model_selector : R.drawable.tab_strip_fade; int rightFadeDrawable = modelSelectorButtonVisible && !LocalizationUtils.isLayoutRtl() ? R.drawable.tab_strip_fade_for_model_selector : R.drawable.tab_strip_fade; nativeUpdateTabStripLeftFade(mNativePtr, leftFadeDrawable, layoutHelper.getLeftFadeOpacity(), resourceManager); nativeUpdateTabStripRightFade(mNativePtr, rightFadeDrawable, layoutHelper.getRightFadeOpacity(), resourceManager); }
Example 6
Source File: TabStripSceneLayer.java From 365browser with Apache License 2.0 | 5 votes |
private void pushButtonsAndBackground(StripLayoutHelperManager layoutHelper, ResourceManager resourceManager, float yOffset) { final float width = layoutHelper.getWidth() * mDpToPx; final float height = layoutHelper.getHeight() * mDpToPx; nativeUpdateTabStripLayer(mNativePtr, width, height, yOffset * mDpToPx, layoutHelper.getBackgroundTabBrightness(), layoutHelper.getBrightness(), shouldReaddBackground(layoutHelper.getOrientation())); CompositorButton newTabButton = layoutHelper.getNewTabButton(); CompositorButton modelSelectorButton = layoutHelper.getModelSelectorButton(); boolean newTabButtonVisible = newTabButton.isVisible(); boolean modelSelectorButtonVisible = modelSelectorButton.isVisible(); nativeUpdateNewTabButton(mNativePtr, newTabButton.getResourceId(), newTabButton.getX() * mDpToPx, newTabButton.getY() * mDpToPx, newTabButton.getWidth() * mDpToPx, newTabButton.getHeight() * mDpToPx, newTabButtonVisible, resourceManager); nativeUpdateModelSelectorButton(mNativePtr, modelSelectorButton.getResourceId(), modelSelectorButton.getX() * mDpToPx, modelSelectorButton.getY() * mDpToPx, modelSelectorButton.getWidth() * mDpToPx, modelSelectorButton.getHeight() * mDpToPx, modelSelectorButton.isIncognito(), modelSelectorButtonVisible, resourceManager); int leftFadeDrawable = modelSelectorButtonVisible && LocalizationUtils.isLayoutRtl() ? R.drawable.tab_strip_fade_for_model_selector : R.drawable.tab_strip_fade; int rightFadeDrawable = modelSelectorButtonVisible && !LocalizationUtils.isLayoutRtl() ? R.drawable.tab_strip_fade_for_model_selector : R.drawable.tab_strip_fade; nativeUpdateTabStripLeftFade(mNativePtr, leftFadeDrawable, layoutHelper.getLeftFadeOpacity(), resourceManager); nativeUpdateTabStripRightFade(mNativePtr, rightFadeDrawable, layoutHelper.getRightFadeOpacity(), resourceManager); }