| 166 | configuration: ValdiContextConfiguration?, |
| 167 | completion: (ValdiContext) -> Unit) { |
| 168 | val context = doCreateValdiContext(componentPath, viewModel, componentContext, owner, configuration) |
| 169 | context.onCreate() |
| 170 | runOnMainThreadIfNeeded { |
| 171 | completion(context) |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | override fun inflateViewAsync(rootView: ValdiRootView, |
| 176 | componentPath: String, |
| 177 | viewModel: Any?, |
| 178 | componentContext: Any?, |
| 179 | owner: ValdiViewOwner?, |
| 180 | completion: InflationCompletion?, |
| 181 | configuration: ValdiContextConfiguration?) { |
| 182 | val context = doCreateValdiContext(componentPath, viewModel, componentContext, owner, configuration) |
| 183 | |
| 184 | runOnMainThreadIfNeeded { |
| 185 | if (rootView.destroyed) { |
| 186 | // destroyed was called before the completion was called |
| 187 | context.destroy() |
| 188 | return@runOnMainThreadIfNeeded |
| 189 | } |
| 190 | |
| 191 | rootView.destroyValdiContextOnFinalize = true |
| 192 | context.rootView = rootView |
| 193 | |
| 194 | if (completion != null) { |
| 195 | context.enqueueNextRenderCallback { completion(null) } |
| 196 | } |
no test coverage detected