Kotlin / anko

Pleasant Android application development
Apache License 2.0
15.9k stars 1.28k forks source link

What if I don't want to add the view directly? #772

Closed BugRui closed 3 years ago

BugRui commented 3 years ago

inline fun Context.ankoView(factory: (ctx: Context) -> T, theme: Int, init: T.() -> Unit): T { val ctx = AnkoInternals.wrapContextIfNeeded(this, theme) val view = factory(ctx) view.init() AnkoInternals.addView(this, view) return view }

AnkoInternals.addView(this, view)????