Skip to content

setIconSelectedColor is not working #18

Description

@sallu-tech

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions