amar_1995
01/22/2020, 11:24 AMkapt
and compose
and so that it throws backend IR
error.
But now in build gradle file i removed below line and it worked.
buildFeatures {
compose true
}
Now even removing this line I am able to call compose function and load ui.
So, what does this line means and its purpose.Mark Murphy
01/22/2020, 11:59 AMsindrenm
01/22/2020, 12:15 PMIan Warwick
01/22/2020, 12:15 PMsindrenm
01/22/2020, 12:20 PMamar_1995
01/22/2020, 12:23 PMMaterialTheme {
val value = +state { 0 }
Column {
Greeting(value.value.toString())
Button(text = "Click", onClick = {
value.value += 1
})
}
}
And on every click value is changingMark Murphy
01/22/2020, 12:25 PM@Composable
function and see what happens (or is it in a @Composable
function already?)amar_1995
01/22/2020, 12:27 PMMark Murphy
01/22/2020, 12:28 PMMaterialTheme {
renderGoodStuff()
}
@Composable
fun renderGoodStuff() {
val value = +state { 0 }
Column {
Greeting(value.value.toString())
Button(text = "Click", onClick = {
value.value += 1
})
}
}
amar_1995
01/22/2020, 12:29 PMamar_1995
01/22/2020, 12:29 PMsetContent {
MaterialTheme {
TestBind()
// val value = +state { 0 }
// Column {
// Greeting(value.value.toString())
// Button(text = "Click", onClick = {
// value.value += 1
// })
// }
}
}
amar_1995
01/22/2020, 12:29 PM@Composable
fun TestBind() {
val value = +state { 0 }
Column {
Greeting(value.value.toString())
Button(text = "Click", onClick = {
value.value += 1
})
}
}
Mark Murphy
01/22/2020, 12:30 PMbuildFeatures
is enabling -- sorry!Manuel Wrage
01/22/2020, 1:28 PMamar_1995
01/22/2020, 1:30 PMjava.lang.IllegalStateException: Expected a group start
when disabled the compose feature.amar_1995
01/22/2020, 2:10 PMsindrenm
01/22/2020, 2:32 PMUserRepository
in the users module, for instance), so … I guess it just depends on preference. 😛Ian Warwick
01/22/2020, 5:03 PM:net
module but again this is personal, @sindrenm makes some great points about modularisation, at my company we tend to modularise by feature so often we have an api
counterpart such as feature-search
could have a search-api
when we want to share its API functionality with other feature modulesKlaas Kabini
01/22/2020, 5:57 PM