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