deviant
05/12/2017, 7:34 PMinclude
AnkoComponent into another AnkoComponent? like we do it with xml layoutyan
05/12/2017, 8:21 PMlinearLayout {
addView(SomeOtherComponent().createView(ui))
}
deviant
05/16/2017, 7:38 PMjava.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
my child view looks like this:
override fun createView(ui: AnkoContext<Activity>): View = with(ui) {
appBarLayout {
themedToolbar(R.style.ActionBarTheme) {
bind(viewModel { it::title_ }, this::setTitle)
popupTheme = R.style.ThemeOverlay_AppCompat_Light
}
}
}
and usage:
override fun createView(ui: AnkoContext<Activity>): View = with(ui) {
coordinatorLayout {
addView(ToolbarLayout(viewModel.toolbar).createView(ui))
...
deviant
05/17/2017, 1:36 PMaddView(ToolbarLayout(viewModel.toolbar).createView(AnkoContext.Companion.create(ctx,false)))
is it correct? i mean creating of new AnkoContext