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