Skip to content

Instantly share code, notes, and snippets.

@dominicthomas
Created January 23, 2017 16:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dominicthomas/2e3e419913d21824627d55e43d2ac239 to your computer and use it in GitHub Desktop.
Save dominicthomas/2e3e419913d21824627d55e43d2ac239 to your computer and use it in GitHub Desktop.
Quick guide on setting up a BottomNavigationView programatically..
final BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation_view);
bottomNavigationView.inflateMenu(R.menu.bottom_navigation_main);
bottomNavigationView.setItemBackgroundResource(R.color.colorPrimary);
bottomNavigationView.setItemTextColor(ContextCompat.getColorStateList(bottomNavigationView.getContext(), R.color.bottom_navigation_color_selector));
bottomNavigationView.setItemIconTintList(ContextCompat.getColorStateList(bottomNavigationView.getContext(), R.color.bottom_navigation_color_selector));
bottomNavigationView.setOnNavigationItemSelectedListener(...);
@ayeshaarshad52
Copy link

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment