File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
ui-generator-base/src/main/java/ru/impression/ui_generator_base Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,6 @@ interface Component<C, VM : ComponentViewModel> {
5353 }
5454 }
5555
56- fun render (attachToContainer : Boolean = true): ViewDataBinding ? =
57- renderer.render(scheme.getBindingClass?.invoke(this as C , viewModel), attachToContainer )
56+ fun render (immediately : Boolean = true): ViewDataBinding ? =
57+ renderer.render(scheme.getBindingClass?.invoke(this as C , viewModel), immediately )
5858}
Original file line number Diff line number Diff line change @@ -12,11 +12,12 @@ class Renderer(private val component: Component<*, *>) {
1212
1313 fun render (
1414 newBindingClass : KClass <out ViewDataBinding >? ,
15- attachToContainer : Boolean
15+ immediately : Boolean
1616 ): ViewDataBinding ? {
1717 currentBinding?.let {
1818 if (newBindingClass != null && newBindingClass == currentBindingClass) {
1919 it.setViewModel(component.viewModel)
20+ if (immediately) it.executePendingBindings()
2021 return it
2122 }
2223 (component.container as ? ViewGroup )?.removeAllViews()
@@ -26,8 +27,8 @@ class Renderer(private val component: Component<*, *>) {
2627 ? : throw UnsupportedOperationException (" Component must be ViewGroup" ),
2728 component.viewModel,
2829 component.boundLifecycleOwner,
29- attachToContainer
30- )
30+ immediately
31+ )?. apply { if (immediately) executePendingBindings() }
3132 currentBindingClass = newBindingClass
3233 return currentBinding
3334 }
You can’t perform that action at this time.
0 commit comments