-
Notifications
You must be signed in to change notification settings - Fork 433
FAQ
From your Activity:
// get toolbar
this.getToolbar();
// get Action Bar
this.getSupportActionBar();
From your Fragment:
// get toolbar
((MaterialNavigationDrawer)this.getActivity()).getToolbar();
// get action bar
this.getActivity().getSupportActionBar();
From your Activity:
this.getCurrentSection();
From your Fragment:
((MaterialNavigationDrawer)this.getActivity()).getCurrentSection();
First you should add/change your account:
account = new MaterialAccount( ... );
addAccount(account); // add a new account
account.setBackground( ... ); // change account informations
And then call the notifyAccountDataChanged
method on ui thread:
(if you want to remove the account you should move the call into the main thread)
runOnUiThread(new Runnable() {
@Override
public void run() {
// removeAccount(account);
notifyAccountDataChanged();
}
});
From your Activity:
this.getCurrentAccount();
From your Fragment:
((MaterialNavigationDrawer)this.getActivity()).getCurrentAccount();
From your Activity:
int position;
this.getAccountAtCurrentPosition(position);
From your Fragment:
((MaterialNavigationDrawer)this.getActivity()).getAccountAtCurrentPosition(position);
for default, it is disabled.
If you want to re-enable it add this to your init()
method:
allowArrowAnimation();
Well, if you want to follow exactly the material design guidelines you have not to do it. If you want to mock this functionality, on your extended Fragment class insert this code:
@Override
public void onResume() {
super.onResume();
((MaterialNavigationDrawer)this.getActivity()).changeToolbarColor(primaryColor,primaryColorDark);
}
Ripple support activate the ripple when a section is clicked/tapped.
As default is enabled on Lollipop devices and on Kitkat devices if Theme use a TranslucentKitKatStatusBar
Theme
To enable it on all 14+ devices, add this line to your custom theme:
<item name="rippleBackport">true</item>
You could set a Text as your notification using:
section.setNotificationsText("MyValue");
If your fragment is a section target, you can get the MaterialNavigationDrawer parsing it from the fragment.
example:
((MaterialNavigationDrawer)this.getActivity()).setFragment( ... )
((MaterialNavigationDrawer)this.getActivity()).setSection( ... )
((MaterialNavigationDrawer)this.getActivity()).setSectionChild( ... )