Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setIconSelectedColor is not working #18

Open
sallu-tech opened this issue Sep 28, 2020 · 0 comments
Open

setIconSelectedColor is not working #18

sallu-tech opened this issue Sep 28, 2020 · 0 comments

Comments

@sallu-tech
Copy link

sallu-tech commented Sep 28, 2020

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant