use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.
the class LayoutManagerChrome method doneHiding.
@Override
public void doneHiding() {
Layout layoutBeingHidden = getActiveLayout();
if (getNextLayout() == getDefaultLayout()) {
Tab tab = getTabModelSelector() != null ? getTabModelSelector().getCurrentTab() : null;
emptyCachesExcept(tab != null ? tab.getId() : Tab.INVALID_TAB_ID);
}
super.doneHiding();
if (isOverviewLayout(layoutBeingHidden)) {
for (OverviewModeObserver observer : mOverviewModeObservers) {
observer.onOverviewModeFinishedHiding();
}
}
}
use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.
the class LayoutManagerChrome method tabClosed.
private void tabClosed(int tabId, boolean incognito, boolean tabRemoved) {
Tab currentTab = getTabModelSelector() != null ? getTabModelSelector().getCurrentTab() : null;
int nextTabId = currentTab != null ? currentTab.getId() : Tab.INVALID_TAB_ID;
tabClosed(tabId, nextTabId, incognito, tabRemoved);
}
use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.
the class StackViewAnimation method createNewTabOpenedAnimator.
private Animator createNewTabOpenedAnimator(StackTab[] tabs, ViewGroup container, TabModel model, int focusIndex) {
Tab tab = model.getTabAt(focusIndex);
if (tab == null || !tab.isNativePage())
return null;
View view = tab.getView();
if (view == null)
return null;
// Set up the view hierarchy
if (view.getParent() != null)
((ViewGroup) view.getParent()).removeView(view);
ViewGroup bgView = new FrameLayout(view.getContext());
bgView.setBackgroundColor(tab.getBackgroundColor());
bgView.addView(view);
container.addView(bgView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
// Update any compositor state that needs to change
if (tabs != null && focusIndex >= 0 && focusIndex < tabs.length) {
tabs[focusIndex].setAlpha(0.f);
}
// Build the view animations
PropertyValuesHolder xScale = PropertyValuesHolder.ofFloat(View.SCALE_X, 0.f, 1.f);
PropertyValuesHolder yScale = PropertyValuesHolder.ofFloat(View.SCALE_Y, 0.f, 1.f);
PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat(View.ALPHA, 0.f, 1.f);
ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(bgView, xScale, yScale, alpha);
animator.setDuration(TAB_OPENED_ANIMATION_DURATION);
animator.setInterpolator(BakedBezierInterpolator.TRANSFORM_FOLLOW_THROUGH_CURVE);
float insetPx = TAB_OPENED_PIVOT_INSET_DP * mDpToPx;
bgView.setPivotY(TAB_OPENED_PIVOT_INSET_DP);
bgView.setPivotX(LocalizationUtils.isLayoutRtl() ? mWidthDp * mDpToPx - insetPx : insetPx);
return animator;
}
use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.
the class StripLayoutHelper method computeAndUpdateTabOrders.
private void computeAndUpdateTabOrders(boolean delayResize) {
final int count = mModel.getCount();
StripLayoutTab[] tabs = new StripLayoutTab[count];
for (int i = 0; i < count; i++) {
final Tab tab = mModel.getTabAt(i);
final int id = tab.getId();
final StripLayoutTab oldTab = findTabById(id);
tabs[i] = oldTab != null ? oldTab : createStripTab(id);
setAccessibilityDescription(tabs[i], tab);
}
int oldStripLength = mStripTabs.length;
mStripTabs = tabs;
if (mStripTabs.length != oldStripLength)
resizeTabStrip(delayResize);
updateVisualTabOrdering();
}
use of org.chromium.chrome.browser.tab.Tab in project AndroidChromium by JackyAndroid.
the class StripLayoutHelperManager method getUpdatedSceneOverlayTree.
@Override
public SceneOverlayLayer getUpdatedSceneOverlayTree(LayerTitleCache layerTitleCache, ResourceManager resourceManager, float yOffset) {
assert mTabStripTreeProvider != null;
Tab selectedTab = mTabModelSelector.getCurrentModel().getTabAt(mTabModelSelector.getCurrentModel().index());
int selectedTabId = selectedTab == null ? TabModel.INVALID_TAB_INDEX : selectedTab.getId();
mTabStripTreeProvider.pushAndUpdateStrip(this, layerTitleCache, resourceManager, getActiveStripLayoutHelper().getStripLayoutTabsToRender(), yOffset, selectedTabId);
return mTabStripTreeProvider;
}
Aggregations