roughike / BottomBar

(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern.
Apache License 2.0
8.43k stars 1.51k forks source link

disable first tab autoselection #876

Open buelersandra opened 6 years ago

buelersandra commented 6 years ago

Is it possible to prevent the first tab from being selected until user tabs/clicks to select?

123shubham123 commented 6 years ago

in your Activity's Oncreate---
bottom_navigation_bar.setOnTabSelectListener(this);
bottom_navigation_bar.setOnTabReselectListener(this);

then: public void onTabSelected(@IdRes int tabId) { if (bottom_navigation_bar.getRootView().findViewById(tabId).isPressed()){ switch (tabId) { case R.id.tab_home: break; case R.id.something: break; case R.id.something: break; case R.id.something: break; } } } and put first tab on "onTabReSelectedmethod" @Override public void onTabReSelected(int tabId) { switch (tabId) { case R.id.tab_home: break; } }

rajesh-codes commented 6 years ago

dear @123shubham123 , not working...