question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
maltaisncommented, Dec 17, 2021
0reactions
maltaisncommented, Dec 22, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found