birdsofparadise
01/18/2021, 8:54 PMabstract class ComposeAbstractTest {
@Composable
abstract fun createView()
}
class ComposeTest: ComposeAbstractTest {
@Composable
fun createView() {
Column { }
}
}
Hi is such a thing possible?
I'm getting a runtime error with my provided example and my understanding of Compose it seems like this shouldn't be possible.alorma
01/18/2021, 8:59 PMComposeTest
extends ComposeAbstractTest
?birdsofparadise
01/18/2021, 9:01 PMAdam Powell
01/18/2021, 9:07 PMComposeView
is implemented so it's definitely intended to work 🙂birdsofparadise
01/18/2021, 9:19 PMjava.lang.NoSuchMethodError: No virtual method createView(Landroidx/compose/runtime/Composer;I)V in class Ldev/birdsofparadise/mua/lifecycle/ComposeView; or its super classes (declaration of 'dev.birdsofparadise.mua.lifecycle.ComposeView' appears in /data/data/dev.birdsofparadise.notestand.app.androidApp/code_cache/.overlay/base.apk/classes5.dex)
at dev.birdsofparadise.mua.lifecycle.ComposeActivityKt$addComposableViewRoute$1.invoke(ComposeActivity.kt:59)
Usage:
val platformInterface = createComposeView()
if (platformInterface is ComposeView) {
platformInterface.createView()
} else {
throw Error("TODO")
}
birdsofparadise
01/18/2021, 9:27 PMval platformInterface = ComposeTest()
platformInterface.createView()
worksbirdsofparadise
01/18/2021, 9:37 PMval platformInterface = createComposeView() as ComposeTest
platformInterface.createView()
worksAdam Powell
01/18/2021, 9:38 PMandylamax
01/18/2021, 10:44 PMbirdsofparadise
01/18/2021, 11:01 PMbirdsofparadise
01/19/2021, 12:42 AMchao
10/14/2021, 11:44 PMbirdsofparadise
10/14/2021, 11:45 PMbirdsofparadise
10/14/2021, 11:46 PMbirdsofparadise
10/14/2021, 11:46 PMchao
10/14/2021, 11:52 PMchao
10/14/2021, 11:52 PMbirdsofparadise
10/14/2021, 11:52 PMbirdsofparadise
10/14/2021, 11:52 PMchao
10/15/2021, 12:26 AMchao
10/15/2021, 2:27 AMandroid.buildFeatures.compose true
in the module hosting the base abstract class.