Comments (6)
Can you elaborate on which navigation drawer library are you using?
from material-icon-lib.
I have used the Google template within android studio. I think it uses android design library.
from material-icon-lib.
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.
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.
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.
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)
- Icon Color not changing in Samsung Galaxy Note 4 HOT 2
- Crash on API level 19 and below HOT 1
- New icon HOT 2
- MaterialDrawableBuilder does not care about Drawable.setBounds HOT 2
- Can I use MaterialMenuInflater in android.support.design.widget.NavigationView HOT 4
- Attribute "materialIcon" already defined with incompatible format. HOT 1
- Cannot instantiate class
- Missing Icons HOT 4
- Asset not found
- Arrow_left_bold & arrow_right_bold show either nothing or Japanese characters. HOT 5
- Wrong images shown Android Oreo HOT 1
- On certain Samsung devices, there's an inflate issue using the "materialIconColor" attribute HOT 1
- API 16 crash. Need help HOT 6
- Missing human-female-boy HOT 2
- Oreo Wrong İmages HOT 1
- Update icons
- Wrong images after 1.1.4 HOT 2
- Some of the icons which do not have alias unable to use on android
- Update to current materialdesignicons version please HOT 4
- Missing icon: weather-night-partly-cloudy
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 material-icon-lib.