org.chromium.chrome.browser.compositor.overlays.strip.StripLayoutHelperManager Java Examples
The following examples show how to use
org.chromium.chrome.browser.compositor.overlays.strip.StripLayoutHelperManager.
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 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 #2
Source File: TabStripSceneLayer.java From 365browser with Apache License 2.0 | 6 votes |
private void pushStripTabs(StripLayoutHelperManager layoutHelper, LayerTitleCache layerTitleCache, ResourceManager resourceManager, StripLayoutTab[] stripTabs, int selectedTabId) { final int tabsCount = stripTabs != null ? stripTabs.length : 0; for (int i = 0; i < tabsCount; i++) { final StripLayoutTab st = stripTabs[i]; boolean isSelected = st.getId() == selectedTabId; nativePutStripTabLayer(mNativePtr, st.getId(), st.getCloseButton().getResourceId(), st.getResourceId(isSelected), isSelected, st.getClosePressed(), layoutHelper.getWidth() * mDpToPx, st.getDrawX() * mDpToPx, st.getDrawY() * mDpToPx, st.getWidth() * mDpToPx, st.getHeight() * mDpToPx, st.getContentOffsetX() * mDpToPx, st.getCloseButton().getOpacity(), st.isLoading(), st.getLoadingSpinnerRotation(), layoutHelper.getBorderOpacity(), layerTitleCache, resourceManager); } }
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 AndroidChromium with Apache License 2.0 | 6 votes |
private void pushStripTabs(StripLayoutHelperManager layoutHelper, LayerTitleCache layerTitleCache, ResourceManager resourceManager, StripLayoutTab[] stripTabs, int selectedTabId) { final int tabsCount = stripTabs != null ? stripTabs.length : 0; for (int i = 0; i < tabsCount; i++) { final StripLayoutTab st = stripTabs[i]; boolean isSelected = st.getId() == selectedTabId; nativePutStripTabLayer(mNativePtr, st.getId(), st.getCloseButton().getResourceId(), st.getResourceId(isSelected), isSelected, st.getClosePressed(), layoutHelper.getWidth() * mDpToPx, st.getDrawX() * mDpToPx, st.getDrawY() * mDpToPx, st.getWidth() * mDpToPx, st.getHeight() * mDpToPx, st.getContentOffsetX() * mDpToPx, st.getCloseButton().getOpacity(), st.isLoading(), st.getLoadingSpinnerRotation(), layoutHelper.getBorderOpacity(), layerTitleCache, resourceManager); } }
Example #5
Source File: LayoutManagerChromeTablet.java From AndroidChromium with Apache License 2.0 | 6 votes |
/** * Creates an instance of a {@link LayoutManagerChromePhone}. * @param host A {@link LayoutManagerHost} instance. * @param overviewLayoutFactoryDelegate A {@link OverviewLayoutFactoryDelegate} instance. */ public LayoutManagerChromeTablet( LayoutManagerHost host, OverviewLayoutFactoryDelegate overviewLayoutFactoryDelegate) { super(host, overviewLayoutFactoryDelegate); Context context = host.getContext(); // Build Event Filters mTabStripFilter = new TabStripEventFilter( context, this, new TabStripEventHandler(), null, false, false); mTabStripLayoutHelperManager = new StripLayoutHelperManager( context, this, mHost.getLayoutRenderHost(), mTabStripFilter); // Set up state mDefaultTitle = context.getString(R.string.tab_loading_default_title); setNextLayout(null); }
Example #6
Source File: TabStripSceneLayer.java From delion with Apache License 2.0 | 6 votes |
private void pushStripTabs(StripLayoutHelperManager layoutHelper, LayerTitleCache layerTitleCache, ResourceManager resourceManager, StripLayoutTab[] stripTabs, int selectedTabId) { final int tabsCount = stripTabs != null ? stripTabs.length : 0; for (int i = 0; i < tabsCount; i++) { final StripLayoutTab st = stripTabs[i]; boolean isSelected = st.getId() == selectedTabId; nativePutStripTabLayer(mNativePtr, st.getId(), st.getCloseButton().getResourceId(), st.getResourceId(isSelected), isSelected, st.getClosePressed(), layoutHelper.getWidth() * mDpToPx, st.getDrawX() * mDpToPx, st.getDrawY() * mDpToPx, st.getWidth() * mDpToPx, st.getHeight() * mDpToPx, st.getContentOffsetX() * mDpToPx, st.getCloseButton().getOpacity(), st.isLoading(), st.getLoadingSpinnerRotation(), layoutHelper.getBorderOpacity(), layerTitleCache, resourceManager); } }
Example #7
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 #8
Source File: LayoutManagerChromeTablet.java From delion with Apache License 2.0 | 6 votes |
/** * Creates an instance of a {@link LayoutManagerChromePhone}. * @param host A {@link LayoutManagerHost} instance. * @param overviewLayoutFactoryDelegate A {@link OverviewLayoutFactoryDelegate} instance. */ public LayoutManagerChromeTablet( LayoutManagerHost host, OverviewLayoutFactoryDelegate overviewLayoutFactoryDelegate) { super(host, overviewLayoutFactoryDelegate); Context context = host.getContext(); // Build Event Filters mTabStripFilter = new TabStripEventFilter( context, this, new TabStripEventHandler(), null, false, false); mTabStripLayoutHelperManager = new StripLayoutHelperManager( context, this, mHost.getLayoutRenderHost(), mTabStripFilter); // Set up state mDefaultTitle = context.getString(R.string.tab_loading_default_title); setNextLayout(null); }
Example #9
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 #10
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 #11
Source File: LayoutManagerChromeTablet.java From 365browser with Apache License 2.0 | 5 votes |
/** * Creates an instance of a {@link LayoutManagerChromePhone}. * @param host A {@link LayoutManagerHost} instance. */ public LayoutManagerChromeTablet(LayoutManagerHost host) { super(host, false); Context context = host.getContext(); mTabStripLayoutHelperManager = new StripLayoutHelperManager(context, this, mHost.getLayoutRenderHost()); // Set up state mDefaultTitle = context.getString(R.string.tab_loading_default_title); setNextLayout(null); }
Example #12
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); }
Example #13
Source File: LayoutManagerChrome.java From AndroidChromium with Apache License 2.0 | 4 votes |
/** * @return The {@link StripLayoutHelperManager} managed by this class. */ @VisibleForTesting public StripLayoutHelperManager getStripLayoutHelperManager() { return null; }
Example #14
Source File: LayoutManagerChromeTablet.java From AndroidChromium with Apache License 2.0 | 4 votes |
@Override public StripLayoutHelperManager getStripLayoutHelperManager() { return mTabStripLayoutHelperManager; }
Example #15
Source File: LayoutManagerChrome.java From delion with Apache License 2.0 | 4 votes |
/** * @return The {@link StripLayoutHelperManager} managed by this class. */ @VisibleForTesting public StripLayoutHelperManager getStripLayoutHelperManager() { return null; }
Example #16
Source File: LayoutManagerChrome.java From 365browser with Apache License 2.0 | 4 votes |
/** * @return The {@link StripLayoutHelperManager} managed by this class. */ @VisibleForTesting public StripLayoutHelperManager getStripLayoutHelperManager() { return null; }
Example #17
Source File: LayoutManagerChromeTablet.java From 365browser with Apache License 2.0 | 4 votes |
@Override public StripLayoutHelperManager getStripLayoutHelperManager() { return mTabStripLayoutHelperManager; }
Example #18
Source File: LayoutManagerChromeTablet.java From delion with Apache License 2.0 | 4 votes |
@Override public StripLayoutHelperManager getStripLayoutHelperManager() { return mTabStripLayoutHelperManager; }