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).
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?
inrectangleShape
, you can useFloat.NaN
instead ofnull
.P. P. S.
GradientDrawable.solidColor
's getter should be@Deprecated(level = ERROR)
.P. P. P. S.
Thanks for your work!