Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Selected menu items remain highlighted #21

Closed
mlumeau opened this issue Dec 17, 2014 · 5 comments
Closed

Selected menu items remain highlighted #21

mlumeau opened this issue Dec 17, 2014 · 5 comments

Comments

@mlumeau
Copy link

mlumeau commented Dec 17, 2014

Hi!

First of all, thank you for your great job.

I came across a little problem while implementing this drawer.
When I declare sections inside addSection(), no problem.

But when I try to declare them beforehand as the following:

//create sections and associated fragments
mainSection = this.newSection("Home", getResources().getDrawable(R.drawable.ic_home_grey600_48dp), new MainFragment());
pendingShares = this.newSection("Pending shares",getResources().getDrawable(R.drawable.ic_database_grey600_48dp),new PendingSharesFragment()).setNotifications(10);
shareSection = this.newSection("Share", this.getResources().getDrawable(R.drawable.ic_share_grey600_48dp), new ShareFragment()).setSectionColor(Color.parseColor("#2196f3"));
alarmSection = this.newSection("Alarms",getResources().getDrawable(R.drawable.ic_alarm_grey600_48dp), new AlarmFragment()).setSectionColor((Color.parseColor("#ff9800")));
profileSection = this.newSection("Profile", getResources().getDrawable(R.drawable.ic_account_grey600_48dp), new ProfileFragment());
settingsSection = this.newBottomSection("Settings",this.getResources().getDrawable(R.drawable.ic_cog_grey600_48dp),new Intent());

// add sections
this.addSection(mainSection);
this.addSection(pendingShares);
this.addSection(shareSection);
this.addDivisor();
this.addSection(alarmSection);
this.addSection(profileSection);
this.addBottomSection(settingsSection);

the drawer items remain highlighted when I navigate between sections.

screenshot_2014-12-17-17-11-50

Should I instantiate sections manually using new MaterialSection()?

@neokree
Copy link
Owner

neokree commented Dec 17, 2014

Are you sure that you use the last version of this library?
Because I tried to replicate your bug, but without success.

@mlumeau
Copy link
Author

mlumeau commented Dec 17, 2014

yup, just added your library to my project today, version 1.1.9

@neokree
Copy link
Owner

neokree commented Dec 17, 2014

Can you send me your complete activity please?

@mlumeau
Copy link
Author

mlumeau commented Dec 17, 2014

Just sent it to you via email.

@neokree
Copy link
Owner

neokree commented Dec 17, 2014

I'm working on a new release. For everyone that has got this problem for now please follow this method for adding your sections:

mainSection = this.newSection("Home", getResources().getDrawable(R.drawable.ic_home_grey600_48dp), new MainFragment());
this.addSection(mainSection);

pendingShares = this.newSection("Pending shares",getResources().getDrawable(R.drawable.ic_database_grey600_48dp),new PendingSharesFragment()).setNotifications(10);
this.addSection(pendingShares);

@neokree neokree removed the bug label Dec 17, 2014
@neokree neokree closed this as completed Dec 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants