Exemplo n.º 1
0
  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();
            }
          }
        });
  }
Exemplo n.º 2
0
 @Override
 public void closeAll() {
   tabsLayout.closeAll();
 }
Exemplo n.º 3
0
 @Override
 public boolean shouldExpand() {
   return tabsLayout.shouldExpand();
 }
Exemplo n.º 4
0
 @Override
 public void hide() {
   setVisibility(View.GONE);
   tabsLayout.hide();
 }
Exemplo n.º 5
0
 @Override
 public void show() {
   tabsLayout.show();
   setVisibility(View.VISIBLE);
 }
Exemplo n.º 6
0
 @Override
 public void setTabsPanel(TabsPanel panel) {
   tabsPanel = panel;
   tabsLayout.setTabsPanel(panel);
 }