dalexander
04/03/2017, 1:29 PMimport kotlinx.android.synthetic.main.some_layout.view.*
//class defined here, custom view, which extends FrameLayout
init {
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
inflater.inflate(R.layout.some_layout, this, true)
}
Note the debugger seems to be confused about what's actually imported, but the code works.deviant
04/03/2017, 1:52 PMPresenter
dalexander
04/03/2017, 1:57 PMdeviant
04/03/2017, 1:59 PMdalexander
04/03/2017, 2:02 PMfindViewById()
, which might be difficult without it being a subclass of Fragment/Activity/View, I could be wrong though.