Comments (6)
You mean onCreateOptionsMenu() , or?
For an optionsMenu, look here:
https://github.com/madcyph3r/AdvancedMaterialDrawer/blob/master/example/src/main/java/de/madcyph3r/example/example/functionally/ActionBarButtonsActivity.java
from advancedmaterialdrawer.
But instead of Having Dynamic Menu Item I want to inflate from menu in res
& have onOptionsItemSelected Method for the same, so how can I do this ??
& How Can we have same Title for the application & Change Icon for drawer
when it's open & Closed ??
On Thu, Apr 30, 2015 at 3:46 PM, madcyph3r [email protected] wrote:
You mean onCreateOptionsMenu() , or?
For an optionsMenu, look here:
—
Reply to this email directly or view it on GitHub
#40 (comment)
.
from advancedmaterialdrawer.
Then inflate the menu like this:
@Override
@TargetApi(11)
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.mainmenu, menu);
// on click listener (same as onOptionsItemSelected) or use onOptionsItemSelected(MenuItem item), but don't forget to call the super method. (return super.onOptionsItemSelected(item);)
return true;
}
To have the same title in all fragments, call the setFragmentTitle() for every section, like this:
MaterialSection section = this.newSection("Section 1", new FragmentDummy(), false, menu);
section.setFragmentTitle("your title");
// do this for all your sections.
Which icon do you want to change? The menu icon is not visible, if the drawer open.
from advancedmaterialdrawer.
Yes I want to change Menu Icon & I m using Theme Below ToolBar so how can I
achieve this ??
On Thu, Apr 30, 2015 at 4:38 PM, madcyph3r [email protected] wrote:
Then inflate the menu like this:
@OverRide
@TargetApi(11)
@Overridepublic boolean onCreateOptionsMenu(Menu menu)
{
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.mainmenu, menu);// on click listener (same as onOptionsItemSelected) or use onOptionsItemSelected(MenuItem item), but don't forget to call the super method. (return super.onOptionsItemSelected(item);)
return true;
}
To have the same title in all fragments, call the setFragmentTitle() for
every section, like this:MaterialSection section = this.newSection("Section 1", new FragmentDummy(), false, menu);
section.setFragmentTitle("your title");// do this for all your sections.Which icon do you want to change? The menu icon is not visible, if the
drawer open.—
Reply to this email directly or view it on GitHub
#40 (comment)
.
from advancedmaterialdrawer.
To change the icon do this:
if(getActionBarToggle() != null)
getActionBarToggle().setDrawerIndicatorEnabled(false);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// set the icon
getSupportActionBar().setHomeAsUpIndicator(Drawable indicator)
getSupportActionBar().invalidateOptionsMenu();
For all methods see here: https://developer.android.com/reference/android/support/v7/app/ActionBar.html
from advancedmaterialdrawer.
I close this issue for now. If the problem not fixed, make a new thread please.
from advancedmaterialdrawer.
Related Issues (20)
- RTL slide shod HOT 1
- Header title text font HOT 1
- Account photo is changed to color HOT 9
- retain selected fragment on rotation HOT 1
- Master Child Navigation - Update? HOT 1
- support navigation bar in different api levels
- Toolbar cut off HOT 6
- Crashes on API 10 HOT 1
- app:theme is now deprecated. Please move to using android:theme instead. HOT 1
- Color of divider for section bottom HOT 1
- how to change drawer icon? HOT 1
- how to change height of actionbar? HOT 1
- PreferenceFragment support HOT 2
- failed to resolve HOT 2
- Keep fragment on orientation change HOT 2
- ActionBarActivity is deprecated HOT 3
- change background color of ActionBar to primaryColor HOT 2
- ActionBar Style (Colors and background)
- Closed
- Customize Item Background Colour HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from advancedmaterialdrawer.