Giter Site home page Giter Site logo

Comments (6)

code-mc avatar code-mc commented on July 30, 2024

Can you elaborate on which navigation drawer library are you using?

from material-icon-lib.

feliperaymundo avatar feliperaymundo commented on July 30, 2024

I have used the Google template within android studio. I think it uses android design library.

from material-icon-lib.

code-mc avatar code-mc commented on July 30, 2024

Grab your NavigationView that you have defined inside your layout file. Then you can simply set icons in code:

navigationView = (NavigationView) findViewById(R.id.nav);
navigationView.getMenu().findItem(R.id.your_menu_item_id).setIcon(yourMaterialIconDrawable);

That's all there is to it. This however isn't a question that belongs on github. This has most likely already been answered on stackoverflow.

from material-icon-lib.

feliperaymundo avatar feliperaymundo commented on July 30, 2024

Yes, but navigation drawer uses a menu inflation to set icons on items. Your library can be used for settings icons on menu's xml, and using your menu inflation. I would like to know how can I use icons like menu's xml, but for navigation drawer menu inflation.

from material-icon-lib.

code-mc avatar code-mc commented on July 30, 2024

You most likely can't as I made the custom inflater specifically for toolbar menus. The navigation drawer uses menu XML files but uses a custom XML parser under the hood which would not play well with my custom menu inflater. It's a bit of an inconvenience that you have to set them in code but it is still better than not being able to use it at all :)

from material-icon-lib.

feliperaymundo avatar feliperaymundo commented on July 30, 2024

I agree. Thanks for replying.

On Tue, Oct 18, 2016, 6:59 PM code-mc [email protected] wrote:

You most likely can't as I made the custom inflater specifically for
toolbar menus. The navigation drawer uses menu XML files but uses a custom
XML parser under the hood which would not play well with my custom menu
inflater. It's a bit of an inconvenience that you have to set them in code
but it is still better than not being able to use it at all :)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#30 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AApmtZKRTNppcfvF3eZ-WkaTaGN4nIeDks5q1TNGgaJpZM4KYGzJ
.

from material-icon-lib.

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.