repository

It is necessary to put different colors for each tab, in the repository it is shown how to make if there are more than 3, and I have 3, help to implement. Or, if not possible with this repo then advise another, thank you.

public class MainActivity extends AppCompatActivity { BottomBar bottomBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); bottomBar = BottomBar.attach(this, savedInstanceState); bottomBar.setItemsFromMenu(R.menu.bottom_bar_menu, new OnMenuTabClickListener() { @Override public void onMenuTabSelected(@IdRes int menuItemId) { if (menuItemId == R.id.bb_menu_recents) { } } @Override public void onMenuTabReSelected(@IdRes int menuItemId) { if (menuItemId == R.id.bb_menu_recents) { } } }); } protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); bottomBar.onSaveInstanceState(outState); } 

}

you need like this:

as here

  • and what is the fundamental difference, more than three of these tabs, or exactly three, that you cannot solve this problem? - pavlofff
  • @pavlofff when there are 3 or less of them, the colors start to be ignored and the background is filled with white color, like the link in the repository, the first gif. - newakkoff

1 answer 1

According to your own link there are such lines:

 // Set the color for the active tab. Ignored on mobile when there are more than three tabs. mBottomBar.setActiveTabColor("#009688"); 
  • This changes the color of the active tab icon. - newakkoff
  • @newakkoff, try these setMaxFixedTabs methods, useFixedMode - Yuriy SPb
  • unfortunately not the same either) - newakkoff
  • @newakkoff, well, skip yourself then the source code. I didn't find anything there anymore. - Yuriy SPb