armcha / LuseenBottomNavigation

BottomNavigationView Designed according Google guideLine
1.01k stars 180 forks source link

setImageResourceActive problem #23

Open gurikoxo opened 8 years ago

gurikoxo commented 8 years ago

Hi,

When I set the drawable via setImageResourceActive() method, the initial drawable resource not shown for first time opened app. after select /unselect the drawable changing working. did i miss anything? can you help for this.

|Thanks.

 final BottomNavigationView bottomNavigationView =(BottomNavigationView)findViewById(R.id.bottomNavigation);

        BottomNavigationItem homeNavigationItem = new BottomNavigationItem
                ("Feed", ContextCompat.getColor(this, R.color.colorAccent), R.drawable.ic_home_icon);
        BottomNavigationItem recentsNavigationItem = new BottomNavigationItem
                ("Recents", Color.parseColor("#553e52"), R.drawable.ic_wall_clock);
        BottomNavigationItem vaskNavigationItem = new BottomNavigationItem
                ("Vask", Color.parseColor("#7B1FA2"), R.drawable.vask_icon);
        final BottomNavigationItem favoritesNavigationItem = new BottomNavigationItem
                ("Favorites",Color.parseColor("#FF5252"), R.drawable.heart_shape);

  favoritesNavigationItem.setImageResource(R.drawable.heart_shape);
        favoritesNavigationItem.setImageResourceActive(R.drawable.vask_icon);

  BottomNavigationItem profileNavigationItem = new BottomNavigationItem
                ("Profile", Color.parseColor("#FF9800"), R.drawable.ic_user_silhouette);

        bottomNavigationView.addTab(homeNavigationItem);
        bottomNavigationView.addTab(recentsNavigationItem);
        bottomNavigationView.addTab(vaskNavigationItem);
        bottomNavigationView.addTab(favoritesNavigationItem);
        bottomNavigationView.addTab(profileNavigationItem);
NeroLoh commented 7 years ago

i met this problem too,is there anybody solve this?

cnneillee commented 6 years ago

31 may solve this problem!