get icon by id without loading all icons in the pack.
See original GitHub issue private Drawable loadIcon(int index) {
// Create an icon pack loader with application context.
IconPackLoader loader = new IconPackLoader(this);
// Create an icon pack and load all drawables.
iconPack = iconPack != null ? iconPack : IconPackDefault.createDefaultIconPack(loader);
return iconPack.getIconDrawable(index, loader.getDrawableLoader());
}
Loaded Icons: 1045
Can we have separate memory efficient method to load requested icon only?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How can I get the application's icon from the package name?
Try this: try { Drawable icon = getContext().getPackageManager().getApplicationIcon("com.example.testnotification"); imageView.setImageDrawable(icon); } ...
Read more >App Icons - Foundations - Human Interface Guidelines - Design
Beautiful app icons are an important part of the user experience on all Apple ... Keep primary content within the icon grid bounding...
Read more >How to theme iOS 14 icons without Shortcut redirect - Smartprix
1. Open the Shortcut app. In the My Shortcuts section, click on the Icon Themer shortcut. It will take a sec to load....
Read more >antfu/unplugin-icons - GitHub
On-demand - Only bundle the icons you really use, while having all the options. SSR / SSG friendly - Ship the icons with...
Read more >Iconify Icon Bundles
Icon bundle is a simple JSON object that contains data for multiple icons from the same icon set, wrapped in a callback. It...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use
IconPack.getIconDrawable
: https://github.com/maltaisn/icondialoglib/blob/c561f68bf302a94626631d1930b88f4faf45528c/lib/src/main/kotlin/com/maltaisn/icondialog/pack/IconPack.kt#L81-L85The icon will be loaded if it hasn’t been already.
No you have to load the entire pack to get one icon if that’s what you mean. If we’re gonna parse the entire XML file we might as well load it fully instead of just loading one icon. You can load a single icon drawable though as I explained previously.