Giter VIP home page Giter VIP logo

Comments (6)

madcyph3r avatar madcyph3r commented on August 17, 2024

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.

patelakshay13890 avatar patelakshay13890 commented on August 17, 2024

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:

https://github.com/madcyph3r/AdvancedMaterialDrawer/blob/master/example/src/main/java/de/madcyph3r/example/example/functionally/ActionBarButtonsActivity.java


Reply to this email directly or view it on GitHub
#40 (comment)
.

from advancedmaterialdrawer.

madcyph3r avatar madcyph3r commented on August 17, 2024

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.

patelakshay13890 avatar patelakshay13890 commented on August 17, 2024

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.

madcyph3r avatar madcyph3r commented on August 17, 2024

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.

madcyph3r avatar madcyph3r commented on August 17, 2024

I close this issue for now. If the problem not fixed, make a new thread please.

from advancedmaterialdrawer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.