caelum19
08/02/2020, 10:41 AMjava.lang.IllegalArgumentException: Key -1277534736 was already registered. Please call unregister before registering again
at androidx.ui.savedinstancestate.UiSavedStateRegistryImpl.registerProvider(UiSavedStateRegistry.kt:96)
at androidx.ui.savedinstancestate.ValueProvider.updateAndReturnValue(RememberSavedInstanceState.kt:103)
at androidx.ui.savedinstancestate.RememberSavedInstanceStateKt.rememberSavedInstanceState(RememberSavedInstanceState.kt:68)
Any thoughts?
Thanks 🙂Archie
08/02/2020, 12:45 PMHorizontal Scroller
just like how ViewPager
snaps per page?Sinan Kozak
08/02/2020, 3:17 PMbohregard
08/02/2020, 5:03 PMSurface(
color = Color(0xFFFF0000),
modifier = Modifier.width(5.dp).fillMaxHeight()
) {
Text("")
}
I’ve got this, but if I remove the Text item the color isn’t drawn which is really all I care aboutgalex
08/03/2020, 7:00 AMmutableStateOf<User>
to the children as parameter so some Composables
in the hierarchy can update that state so that all the hierarchy will be recomposed? In this case, I have a screen/composable that will sign-in the user, and when the user is signed in I’d like to update the rest of the hierarchy that it happened. The goal is to show all my screens if a user signed-in or not (I’m using compose-router
for the backstack)brandonmcansh
08/03/2020, 1:14 PMRicardo C.
08/03/2020, 6:07 PMGriffin.Park
08/04/2020, 3:30 AMColton Idle
08/04/2020, 5:01 AMgalex
08/04/2020, 7:19 AMlaunchInComposition() {}
inside a @Composable
extension function? The extension function looks like the following:
@Composable
fun <I, O> ActivityResultRegistry.activityResultLauncher(): : ActivityResultLauncher<I> {}
But inside of it inside another Composable
, I am unable to call launchInComposition
(see screenshot).Philip Blandford
08/04/2020, 10:21 AMbrandonmcansh
08/04/2020, 12:42 PMtest9
causes test8
to also be removed visually but remain in the list at the repository level as well as the list that the UI is fed. The test8
gets added back on "undo" and test9
gets returned on scrollzak.taccardi
08/04/2020, 5:54 PM@Compose
does not support backstack handling automatically, like FragmentManager
does, and that we would be forced to track backstack behavior ourselves in business logic (which makes more sense, as it’s just so flexible).
Assuming I’m correct about this, is there any documentation or information anywhere that advocates managing backstack logic ourselves in a @Compose
world? Like representing a backstack like listOf(screen1, screen2)
? I’m looking to share this info with colleagues rather than argue for it myself hahahuannguyen
08/05/2020, 7:42 AMRecyclerView
) would not work with a Composable
function. Anyone knows if there is any guide at this stage to convert such libraries to Compose
?MBegemot
08/05/2020, 11:02 AM@Composable
fun startScreen() {
FlowComponent(sflow = myfirstFlow())
}
@Composable
fun FlowComponent(sflow: Flow<String>){
val cnt:String by sflow.collectAsState("")
val sl =state { mutableListOf<String>()}
sl.value.add(cnt)
Box(Modifier.preferredHeight(150.dp)){
sl.value.forEach {
Text(it)
}
}
}
fun myfirstFlow()=flow<String>{
val t=110L
emit("task 1 succeded")
delay(t)
emit("task 2 failed")
delay(t)
emit("task 3 succeded")
delay(t)
emit("task 4 failed")
delay(t)
//emit("uuu"+getNewsPapers(null))
This is a startup screen as I run several functions I intend to emit a string to the flow component that will add it to a list of stings and then write them on screen. And it works but only if I add a certain delay between emits, if the delay is to small or null then I only get the first and last emit. I I'm wrong if i believe that this should work without any delay at all?tcracknell
08/05/2020, 5:35 PMromainguy
08/05/2020, 6:00 PMamar_1995
08/06/2020, 12:12 AMZach Klippenstein (he/him) [MOD]
08/06/2020, 1:07 AMbohregard
08/06/2020, 4:21 AMCaused by: java.lang.IllegalStateException: Couldn't obtain compiled function body for public final inline fun <get-current>(): T defined in androidx.compose.runtime.Ambient[PropertyGetterDescriptorImpl@6d6b1e59]
Mehdi Haghgoo
08/06/2020, 5:05 AM@Composable
fun Surface(
modifier: Modifier = Modifier,
shape: Shape = RectangleShape,
color: Color = MaterialTheme.colors.surface,
contentColor: Color = contentColorFor(color),
border: Border? = null,
elevation: Dp = 0.dp,
content: @Composable () -> Unit
)
Mehdi Haghgoo
08/06/2020, 5:21 AMText(text = "Hello Android!", modifier = Modifier.clickable(onClick = /*Code to change the text Hello Android */))
Adrian Blanco
08/06/2020, 10:37 AMKlaas Kabini
08/06/2020, 12:00 PMclass Position(x: Int, y: Int) {
var x by mutableStateOf(x)
var y by mutableStateOf(y)
}
tjohnn
08/06/2020, 1:14 PMmaven(url = "<https://dl.bintray.com/kotlin/kotlin-eap/>")
jcenter()
google()
dam5s
08/06/2020, 1:15 PMNeal Sanche
08/06/2020, 3:04 PMDominaezzz
08/06/2020, 3:45 PMZach Klippenstein (he/him) [MOD]
08/06/2020, 9:23 PMLayoutNode
and walking the node tree, but many Composables just wrap other Composables and don’t have their own `LayoutNode`s, modifiers are often contributed from multiple composables for a single node, etc, so that’s not ideal either.
I’ve seen some work being done for Android Studio tooling around extracting some data about stuff like this by inspecting the slot table directly. Would it be reasonable to request a public API for exposing that parsing in debug builds?Patrick Yin
08/06/2020, 9:50 PMemitView(::TextView)
with a compose Text("")
, it works well. Is it an intentional behavior? Or there is something wrong?
@Composable
fun MarketLabel(text: String) {
// Android classic view
emitView(::TextView) {
it.text = text
}
}
@Composable
fun SomeThing() {
Box(
modifier = Modifier
.clickable(
onClick = {
doingSomething()
}
)
.padding(16.dp)
) {
MarketLabel("Test")
}
}
Patrick Yin
08/06/2020, 9:50 PMemitView(::TextView)
with a compose Text("")
, it works well. Is it an intentional behavior? Or there is something wrong?
@Composable
fun MarketLabel(text: String) {
// Android classic view
emitView(::TextView) {
it.text = text
}
}
@Composable
fun SomeThing() {
Box(
modifier = Modifier
.clickable(
onClick = {
doingSomething()
}
)
.padding(16.dp)
) {
MarketLabel("Test")
}
}
romainguy
08/06/2020, 9:54 PMPatrick Yin
08/06/2020, 10:11 PM