public PrivateTabsPanel(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater.from(context).inflate(R.layout.private_tabs_panel, this); tabsLayout = (TabsLayout) findViewById(R.id.private_tabs_layout); final View emptyView = findViewById(R.id.private_tabs_empty); tabsLayout.setEmptyView(emptyView); final View learnMore = findViewById(R.id.private_tabs_learn_more); learnMore.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { final String locale = BrowserLocaleManager.getLanguageTag(Locale.getDefault()); final String url = getResources().getString(R.string.private_tabs_panel_learn_more_link, locale); Tabs.getInstance().loadUrlInTab(url); if (tabsPanel != null) { tabsPanel.autoHidePanel(); } } }); }
@Override public void closeAll() { tabsLayout.closeAll(); }
@Override public boolean shouldExpand() { return tabsLayout.shouldExpand(); }
@Override public void hide() { setVisibility(View.GONE); tabsLayout.hide(); }
@Override public void show() { tabsLayout.show(); setVisibility(View.VISIBLE); }
@Override public void setTabsPanel(TabsPanel panel) { tabsPanel = panel; tabsLayout.setTabsPanel(panel); }