I'm trying to use Jetpack Compose UI element in the existed XML from the activity, using databinding and setContent().
This is the xml element:
<androidx.compose.ui.platform.ComposeView
android:id="@+id/save_btn_compose"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
I'm use this syntax in kotlin activity file and it works smoothly:
binding.ComposeView.setContent{
MainActionButtonKt.MainActionButton(true, R.string.complete_job, R.drawable.ic_complete_btn_icon, false);
}
What is the equivalent for java activity file? I I tried to do that:
binding.saveBtnCompose.setContent((composer, integer) -> {
MainActionButton(true, R.string.complete_job, R.drawable.ic_complete_btn_icon, false);
return null;
});
but I got a compile error:
required: boolean, int, Integer, boolean, Composer, int, int
found: boolean, int, int, boolean
reason: actual and formal argument lists differ in length
What am I doing wrong? Thanks !
@Composableannotated from java.