mg6maciej
06/06/2017, 1:10 PMprivate lateinit var title: TextView
and finding it in code later with
private val title by lazy(NONE) { findViewById(R.id.title) as TextView }
or even
private val title: TextView by find(R.id.title)
if you create find extension for View similar to this:
@Suppress("UNCHECKED_CAST")
internal fun <T : View> ViewGroup.find(@IdRes id: Int): Lazy<T> = lazy(NONE) { findViewById(id) as T }