akaita / easylauncher-gradle-plugin

Add a different ribbon to each of your Android app variants using this gradle plugin. Of course, configure it as you will
Apache License 2.0
959 stars 52 forks source link

Implemented passing custom font size as parameter #24

Closed arminelec closed 6 years ago

arminelec commented 6 years ago

With this change, the user can choose the font size instead of the auto-calculated size, using the CustomColorRibbonFilter method.

Related to: https://github.com/akaita/easylauncher-gradle-plugin/issues/17 and https://github.com/akaita/easylauncher-gradle-plugin/issues/15

akaita commented 6 years ago

Thanks so much for the PR 🎉 , and sorry for the delay on my side 🙇 .

Unfortunately I think this is the wrong approach. Setting the size to a specific amount of pixels results in this kinf of issue with different densities:

mdpi xxxdpi
ic_launcher_round_mdpi ic_launcher_round_xxxhdpi

Instead, the plugin should set the size based on a measurement indepenednt to screen density. I'm thinking on using either dps or fractions of the icon size (10% of the icon size, 20% of the icon size, ...)

akaita commented 6 years ago

@arminelec I Yesterday released v1.3.1. That version allows to define text sizes as a ratio of the icon. For example, this will make the text always have 20% of the height of the icon: customColorRibbonFilter("custom", "#556600CC", "#FFFFFF", "topLeft", 0.2))

Thanks for providing code and pushing for this to get done. I now will try to make the DSL a bit nicer (it's getting big O_o)