Search in sources :

Example 1 with OnTabReselectListener

use of com.roughike.bottombar.OnTabReselectListener in project BottomBar by roughike.

the class FiveColorChangingTabsActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_color_changing_tabs);
    messageView = (TextView) findViewById(R.id.messageView);
    BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {

        @Override
        public void onTabSelected(@IdRes int tabId) {
            messageView.setText(TabMessage.get(tabId, false));
        }
    });
    bottomBar.setOnTabReselectListener(new OnTabReselectListener() {

        @Override
        public void onTabReSelected(@IdRes int tabId) {
            Toast.makeText(getApplicationContext(), TabMessage.get(tabId, true), Toast.LENGTH_LONG).show();
        }
    });
}
Also used : BottomBar(com.roughike.bottombar.BottomBar) OnTabReselectListener(com.roughike.bottombar.OnTabReselectListener) OnTabSelectListener(com.roughike.bottombar.OnTabSelectListener)

Example 2 with OnTabReselectListener

use of com.roughike.bottombar.OnTabReselectListener in project BottomBar by roughike.

the class BadgeActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_three_tabs);
    messageView = (TextView) findViewById(R.id.messageView);
    final BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {

        @Override
        public void onTabSelected(@IdRes int tabId) {
            messageView.setText(TabMessage.get(tabId, false));
        }
    });
    bottomBar.setOnTabReselectListener(new OnTabReselectListener() {

        @Override
        public void onTabReSelected(@IdRes int tabId) {
            Toast.makeText(getApplicationContext(), TabMessage.get(tabId, true), Toast.LENGTH_LONG).show();
        }
    });
    BottomBarTab nearby = bottomBar.getTabWithId(R.id.tab_nearby);
    nearby.setBadgeCount(5);
}
Also used : BottomBar(com.roughike.bottombar.BottomBar) OnTabReselectListener(com.roughike.bottombar.OnTabReselectListener) BottomBarTab(com.roughike.bottombar.BottomBarTab) OnTabSelectListener(com.roughike.bottombar.OnTabSelectListener)

Example 3 with OnTabReselectListener

use of com.roughike.bottombar.OnTabReselectListener in project BottomBar by roughike.

the class CustomColorAndFontActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_color_and_font);
    messageView = (TextView) findViewById(R.id.messageView);
    BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {

        @Override
        public void onTabSelected(@IdRes int tabId) {
            messageView.setText(TabMessage.get(tabId, false));
        }
    });
    bottomBar.setOnTabReselectListener(new OnTabReselectListener() {

        @Override
        public void onTabReSelected(@IdRes int tabId) {
            Toast.makeText(getApplicationContext(), TabMessage.get(tabId, true), Toast.LENGTH_LONG).show();
        }
    });
}
Also used : BottomBar(com.roughike.bottombar.BottomBar) OnTabReselectListener(com.roughike.bottombar.OnTabReselectListener) OnTabSelectListener(com.roughike.bottombar.OnTabSelectListener)

Example 4 with OnTabReselectListener

use of com.roughike.bottombar.OnTabReselectListener in project BottomBar by roughike.

the class ThreeTabsActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_three_tabs);
    messageView = (TextView) findViewById(R.id.messageView);
    BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {

        @Override
        public void onTabSelected(@IdRes int tabId) {
            messageView.setText(TabMessage.get(tabId, false));
        }
    });
    bottomBar.setOnTabReselectListener(new OnTabReselectListener() {

        @Override
        public void onTabReSelected(@IdRes int tabId) {
            Toast.makeText(getApplicationContext(), TabMessage.get(tabId, true), Toast.LENGTH_LONG).show();
        }
    });
}
Also used : BottomBar(com.roughike.bottombar.BottomBar) OnTabReselectListener(com.roughike.bottombar.OnTabReselectListener) OnTabSelectListener(com.roughike.bottombar.OnTabSelectListener)

Aggregations

BottomBar (com.roughike.bottombar.BottomBar)4 OnTabReselectListener (com.roughike.bottombar.OnTabReselectListener)4 OnTabSelectListener (com.roughike.bottombar.OnTabSelectListener)4 BottomBarTab (com.roughike.bottombar.BottomBarTab)1