rnett
08/19/2021, 2:29 AMRavin Jain
08/19/2021, 3:05 AMList
and SnapshotStateList
Using List
instead of SnapshotStateList
with items.forEachIndexed
causes recomposition of all the composables.
For example in the below code when I click Button A
it calls a function in viewmodel which increments the progressState
by 10.
This state change should recompose only the A
composable but it causes recomposition of B
as well.
Any idea why ?
Example in the thread :thread-please:Anton Dmytryshyn
08/19/2021, 4:41 AMjava.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Set
at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost$lambda-3(AnimatedNavHost.kt:323)
at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost(AnimatedNavHost.kt:158)
at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost(AnimatedNavHost.kt:85)
allan.conda
08/19/2021, 5:15 AMnavigation-compose 2.4.0-alpha05 does not keep a subgraph’s BackStackEntry until the transition animation completes
aiidziis
08/19/2021, 6:41 AMzhagnfei
08/19/2021, 6:51 AMTextField(
value = feedContent.observeAsState().value ?: "",
onValueChange = {
if (it.length <= 200) {
feedContent.value = it
}
},
maxLines = 4,
colors = textFieldColors(
textColor = colorResource(id = R.color.color_22BE8C),
cursorColor = colorResource(id = R.color.colorPrimary),
backgroundColor = colorResource(id = R.color.color_f1f3f7),
focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent,
disabledIndicatorColor = Color.Transparent
),
shape = RoundedCornerShape(6.dp),
placeholder = {
Text(text = stringResource(id = R.string.feedback_input_desc),
modifier = Modifier.wrapContentSize(),
color = colorResource(id = R.color.color_BBBBC3), fontSize = 14.sp)
},
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(align = <http://Alignment.Top|Alignment.Top>)
.padding(top = 20.dp)
.background(Color(0xF1F3F7), RoundedCornerShape(6.dp)),
)
why show the textcolor is colorPrimary????Alex
08/19/2021, 8:11 AMjava.lang.ArrayIndexOutOfBoundsException: length=32; index=32
at androidx.compose.runtime.collection.IdentityArrayMap.remove(IdentityArrayMap.kt:100)
...
K Merle
08/19/2021, 9:44 AMAdib Faramarzi
08/19/2021, 11:14 AMSlackbot
08/19/2021, 12:23 PMhussan
08/19/2021, 12:24 PMAnastasia Rozovskaya
08/19/2021, 12:33 PMviewModel::onExampleButtonClicked
Florian
08/19/2021, 1:51 PMfillMaxSize
not work if the container is scrollable?Florian
08/19/2021, 2:45 PMText
with maxLines = 1
and overflow = TextOverflow.Ellipsis
breaks before a new word, causing the menu item to not take up the full available width. I there was no space behind the last "a", the item would have a larger width. My question is, how can I let this Text
wrap in the middle of words instead? I tried softWrap = false
but it has no effecttheapache64
08/19/2021, 3:25 PMNavHostController
?Mărcuţ Andrei
08/19/2021, 3:32 PMOutlinedTextField
, and i’ve set it up with PasswordVisualTransformation
. Autofill appears shortly after typing a few characters. Any hints on how to disable the built-in autofill? 😅 Thanks in advance!Ashu
08/19/2021, 4:21 PMe: This version (1.0.0-beta07) of the Compose Compiler requires Kotlin version 1.4.32 but you appear to be using Kotlin version 1.5.21 which is not known to be compatible. Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
But I am using compose 1.0.1 and the only place that uses beta is
androidx.constraintlayout:constraintlayout-compose:1.0.0-beta02
which itself is beta02 not beta07, I am not sure if internally it uses compose compiler beta07. How do I resolve this issue.??Chuck Stein
08/19/2021, 5:19 PMremember
but instead of recalculating if dependencies change, it recalculates if a given predicate is true?
My use case is I have some UI content within an AnimatedVisibility
block, where visible = uiState is InitialUiState
. (My UI state is a sealed class with subtypes we can call InitialUiState
and SecondaryUiState
.) Some of the UI content I'm animating depends on a property contained within InitialUiState
, but not SecondaryUiState
. So when it's animating out of visibility, my uiState
no longer contains the data needed in order to render the UI. I can wrap the content in if (uiState is InitialUiState)
, but then the content just disappears instead of animating out. My thought is I need to memoize the most recent InitialUiState
value, using something like val initialUiState = rememberUnless(uiState is InitialUiState) { uiState as? InitialUiState }
, so that we can access the data contained within the last InitialUiState
, even when the current value of uiState
is a SecondaryUiState
. In this example it would recalculate on every composition where uiState is InitialUiState
, but "remember" and return the previous calculation otherwise.Chris Johnson
08/19/2021, 5:53 PMNick
08/19/2021, 6:16 PMAshu
08/19/2021, 8:01 PMandroidx.compose.ui.tooling.PreviewActivity is not an Activity subclass or alias
.?? I am on the latest stable version of everything,
• Compose 1.0.1
• AGP 7.0.2
• Kotlin 1.5.21
• Android Studio Arctic Fox Patch 1
...and still this issue is coming. What's up with that. And how do I fix it.?? Its so annoying.
And why does making a duplication Run Configuration of the same just works perfectly fine.??Sam
08/19/2021, 8:42 PMkeys
to avoid recomposition of previously composed ones but can't seem to get it to work. Displaying a list with items and a button to shuffle the list item but all items are composed again (logging via SideEffect
)Colton Idle
08/19/2021, 9:17 PMInk
08/19/2021, 9:46 PMCRamsan
08/19/2021, 11:07 PMtad
08/20/2021, 12:08 AMzhagnfei
08/20/2021, 2:51 AMval state: MutableList<String>? by imageList.observeAsState(mutableListOf())
if (state.isNullOrEmpty()) {
feedbackPlaceView(addImgClick)
} else {
state?.forEachIndexed { listIndex, s ->
Carton Waffle
08/20/2021, 3:42 AMTlaster
08/20/2021, 4:40 AMAnton Dmytryshyn
08/20/2021, 5:02 AMAnton Dmytryshyn
08/20/2021, 5:02 AMColton Idle
08/20/2021, 5:53 AMDoris Liu
08/20/2021, 6:11 AM