doodle
doodle

Reputation: 45

BottomNavigationView change item Icons with different tint colors

The title may seem a bit confusing, sorry didn't know how to make it one line question.

I have a custom Drawable with different colors. However, when applied on a BottomNavigationView the btv applies tint on it and now it looks awful. Any way to solve this?

The thing is, because clicking on that specific drawable with colors will popup a BottomSheetDialog, I don't care about the color when pressed. Just that the drawable retains its own colors.

Upvotes: 0

Views: 215

Answers (1)

Salman Naseem
Salman Naseem

Reputation: 462

You can use bottomNavigationView.setItemIconTintList(null); to disable default tint color, then onNavigationItemSelected(@NonNull MenuItem item) you can change the drawable item.setIcon(getResources().getDrawable(R.drawable.new_drawable));

For more useful info check the docomentations.

Upvotes: 1

Related Questions