Coder Social home page Coder Social logo

Comments (10)

mikepenz avatar mikepenz commented on May 21, 2024

I think it is because you do not register the Google material nor the fontawesome font. This is required now if you try to use a specific font addon via string or xml

from android-iconics.

mikepenz avatar mikepenz commented on May 21, 2024

Totally missed to add it as upgrade notes. Just mentioned it down in the how to use section

from android-iconics.

wKovacs64 avatar wKovacs64 commented on May 21, 2024

Oh I see it now, yep. Thanks.

from android-iconics.

mikepenz avatar mikepenz commented on May 21, 2024

@wKovacs64 will add it as upgrade notes ;). I have not yet found a solution that existing fonts register them on their own. do you have an idea how i could solve this?

from android-iconics.

mikepenz avatar mikepenz commented on May 21, 2024

@wKovacs64 the main difference in the new version is that i had split up the fonts and the core. so the core is only the classes without any font included (this was previously done because so the 2 fonts were automatically in), this now allows you to save on app size by creating your own icon font with just the icons you need. (i have done this for the MaterialDrawer v4.0.0 now ;). A MaterialDrawerFont with just 3 icons -> size 5kb ;) )

from android-iconics.

mikepenz avatar mikepenz commented on May 21, 2024

README updated with upgrade notes ;)

from android-iconics.

wKovacs64 avatar wKovacs64 commented on May 21, 2024

@mikepenz Great, thanks. Hopefully that helps anyone else who might run into this.

If iconics (not core) includes the fonts, why can't you register them automatically or however you did prior to 1.5.x? I haven't looked at the code changes yet, maybe that isn't possible. I might take a look if I can find some time.

from android-iconics.

mikepenz avatar mikepenz commented on May 21, 2024

@wKovacs64 the registering happens in the Iconics class which is now part of the core. Prior v1.5.x the Iconics included the GoogleMaterial, FontAwesome fonts in it's constructor. So they were added automatically, and you only had to register additional fonts.

The registering is only required if you try to use the fonts via xml or programmatically via string (when you want to create the icon via the string name). I somehow have to find out the font class by the 3 char identifier --> "gmd" --> via the Iconics font map --> GoogleMaterial.class

I have not found yet that a class is automatically instantiated and it will register itself. (as far as i've found this is not possible), then i tried to have it via pre processor annotations, but this was not possible as this works only when i have only one module.

I do not want compile time annotations as those will lower the performance.

Perhaps i can go a similar approach as with the AboutLibraries, to define the fonts via xml in the resources, and i will then just try to instantiate the class via reflection and add it to the map of registered fonts. should be possible, but i would have hopped for a better solution for this problem :/

from android-iconics.

wKovacs64 avatar wKovacs64 commented on May 21, 2024

@mikepenz Hmm, I see your point. Although I would personally take a compile time hit from annotation processing before a runtime hit from reflection (not that it would be that much). I don't care how long it takes to build as much as I care how it performs once it's on the device.

Maybe if I get some free time I will take a closer look.

from android-iconics.

mikepenz avatar mikepenz commented on May 21, 2024

@wKovacs64 great ;)

from android-iconics.

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.