FluidBottomNavigation-android icon indicating copy to clipboard operation
FluidBottomNavigation-android copied to clipboard

setIconSelectedColor is not working

Open sallu-tech opened this issue 5 years ago • 0 comments

I have successfully integrated this library into my Android(Java) application and now I want to change the color of the icon upon selecting any tab. By far I have done this but it's not working:

fluidBottomNavigation.setOnTabSelectedListener(
                new OnTabSelectedListener() {
                    @Override
                    public void onTabSelected(int i) {
                        Fragment fragment = null;
                        switch (i) {
                            case 0:
                                fragment = new HomeFragment();
                                fluidBottomNavigation.setIconSelectedColor(R.drawable.ic_home_active);
                                break;
                            case 1:
                                fragment = new TicketsFragment();
                                fluidBottomNavigation.setIconSelectedColor(R.drawable.icon_tickects_active);
                                break;

                            case 2:
                                fluidBottomNavigation.setIconSelectedColor(R.drawable.icon_kanz_active);
                                fragment = new KanzFragment();
                                break;

                            case 3:
                                fluidBottomNavigation.setIconSelectedColor(R.drawable.icon_favorites_active);
                                fragment = new FavoriteFragment();
                                break;

                            case 4:
                                fluidBottomNavigation.setIconSelectedColor(R.drawable.icon_carts_active);
                                fragment = new CartFragment();
                                break;
                        }

                        //replacing the fragment
                        if (fragment != null) {
                            FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
                            ft.addToBackStack(null);
                            ft.replace(R.id.content_frame, fragment);
                            ft.commit();
                        }

                    }
                }
        );

```Been stuck on this for a while now.

sallu-tech avatar Sep 28 '20 09:09 sallu-tech