pocorall / scaloid

Scaloid makes your Android code easy to understand and maintain.
Other
2.09k stars 163 forks source link

implicit conversion for resource 2 color? #106

Closed swkimme closed 9 years ago

swkimme commented 9 years ago

I know there's implicit conversion for r2Color,

@inline def r2Color : Int = context.getResources.getColor(id)

but I'm afraid it's not working well because it's Int -> Int conversion. Any ideas?

pocorall commented 9 years ago

The trait ResourceConversion is intended to be used in this form:

button.backgroundColor = R.color.my_color.r2Color
swkimme commented 9 years ago

WOW, SO COOL! Thanks!