infotech-group / android-drawable-dsl

DSL for constructing the drawables in Kotlin instead of in XML
Apache License 2.0
179 stars 9 forks source link

Add best practices #8

Open Miha-x64 opened 7 years ago

Miha-x64 commented 7 years ago

Hello. Nice DSL!

It would be better to add some best practices: — Where one should keep drawables? At a use-site (e. g. Anko UI declaration), in extension functions, in application class? — How and when one should reuse these drawables? (e. g., stateful drawables shouldn't be reused, or you may click one item and see ripple on the another one ;)

P. S. To avoid boxing, e. g., Float? in rectangleShape, you can use Float.NaN instead of null.

P. P. S. GradientDrawable.solidColor's getter should be @Deprecated(level = ERROR).

P. P. P. S. 80 methods

Thanks for your work!

meoyawn commented 7 years ago
meoyawn commented 7 years ago

how did you generate that badge?

meoyawn commented 7 years ago

best practices coming soon :) thanks for the suggestion

Miha-x64 commented 7 years ago

I've took this badge here: http://www.methodscount.com/?lib=com.github.infotech-group%3Aandroid-drawable-dsl%3A0.1.0