I want to try Jetpack Compose and I encountered with issues.
Can I call composable from companion object?
companion object {
fun showDialog(context: Context){
ComposeView(context = context).apply {
setContent { //isAttachedToWindow = false
CustomDialog(progressIndicator = false) //custom dialog with @Composable
}
}
}
}
And additional question: Should I need ModelView class for logic which create data for this CustomDialog and catch callback from this dialog?
You can create a companion class, then call it inside your composable function. For example:
Hope this helps you out!