Open Rahulkr2 opened 7 years ago
I ran into the same problem with Anko. Currently using static constants for ids as a workaround. E.g.:
object Id {
@IdRes val toolbar = View.generateViewId()
@IdRes val container = View.generateViewId()
// ...
}
But I don't like adding a custom place to store ids, when there is a standardized location: ids.xml.
I'm using anko in recyclerView adapter for creating viewholder's view. I have done this successfully but don't know how to refer it using kotlin synthetic by view id (I want to get it without findViewById)
value/ids.xml `
`
My Anko getView Codes: ` private fun getView(context: Context): View{ return with(context){ linearLayout { lparams(width = matchParent, height = wrapContent) padding = dip(10) orientation = android.widget.LinearLayout.HORIZONTAL
`
I'm assigning custom ids from ids.xml but how to get it without findViewById
Thanks`