https://kotlinlang.org logo
#anko
Title
j

josephivie

08/05/2016, 4:59 PM
@simon.vergauwen: I think that's just unsupported in Anko. I don't actually even see an Anko function that takes a style resource - maybe it's new? I've never used style resources with any Anko. To style it, you could do it the Anko way - programmatically. When I do style something the same way in multiple places, I usually make an extension function called
SomeViewType.styleDefault()
in a file I name
Style.kt
and style it in there, calling
styleDefault()
whenever I make a view. However, in your case, the style part is in the
LayoutParams
. That's a bit trickier. I usually don't even bother breaking that out into a function, but if you need to, making an extension function on the containing view for it makes the most sense.