Jamie Craane
10/09/2020, 2:54 PMAfzal Najam
10/09/2020, 3:04 PMWajahat Karim
10/09/2020, 6:54 PMjaqxues
10/09/2020, 8:02 PMAdam Bennett
10/10/2020, 9:53 AMrepeatable
with AnimationConstants.Infinite
and animatedFloat
. I'm basically trying to force a canvas redraw every 300msDavide Cazzorla
10/10/2020, 11:20 AMSe7eN
10/10/2020, 3:41 PMsavedInstanceState
with MutableState
val themeColor by savedInstanceState(user) { mutableStateOf(Color.Blue) }
but I'm getting this error:
java.lang.IllegalArgumentException: Please use savedInstanceState() if you want to save a MutableState
What am I doing wrong here?blakelee
10/11/2020, 3:12 AM@Preview
@Composable
fun Counter() {
var count by remember { mutableStateOf(0) }
Row {
Image(vectorResource(R.drawable.ic_remove), Modifier.clickable { count-- })
Text(text = count.toString(), modifier = Modifier.align(Alignment.CenterVertically))
Image(vectorResource(R.drawable.ic_add), Modifier.clickable { count++ })
}
}
Prashant Priyadarshi
10/11/2020, 6:58 AMzoha131
10/11/2020, 8:54 AMCiprian Grigor
10/11/2020, 9:48 AMNat Strangerweather
10/11/2020, 10:24 AM@Composable
fun CustomToggle(
color: Color, gradientColor: Color, selected: Boolean,
onSelected: () -> Unit
) {
val toggleAlign = animate(if (selected) 65.dp else 5.dp)
Box() {
Box(
modifier = Modifier
.height(40.dp)
.width(100.dp)
.clip(RoundedCornerShape(50))
.background(HorizontalGradient(
0.0f to color,
0.5f to gradientColor,
1.0f to color,
startX = 0.0f,
endX = with(DensityAmbient.current) { 100.dp.toPx() }
)
),
) {}
Surface(
modifier = Modifier.size(30.dp)
.align(Alignment.CenterStart)
.offset(toggleAlign)
.clip(RoundedCornerShape(50))
.toggleable(value = selected, onValueChange = { onSelected() }),
color = Color.White,
elevation = 7.dp
) {}
}
}
Se7eN
10/11/2020, 12:32 PMLinearProgressIndicator
over time. Like I want it to go from 0 to 100 in 3 seconds. How do I approach this?Vsevolod Ganin
10/11/2020, 2:09 PMonCommit
with input of some SnapshotMutableState
doesn’t trigger its lambda when value changes. onCommit
with SnapshotMutableState::value
does. That’s more likely because SnapshotMutableState
doesn’t implement and delegate equals
to its value
. Is this intentional behavior?Oussama Haff.
10/11/2020, 4:39 PMdeprecated
without mentioning alternatives !
Am I missing something ? 🤔Vinay Gaba
10/11/2020, 7:32 PMAlexander Karkossa
10/12/2020, 6:58 PMjava.lang.IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied
at androidx.compose.runtime.snapshots.SnapshotKt.readError(Snapshot.kt:1525)
at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1521)
at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1512)
at androidx.compose.runtime.SnapshotMutableState.getValue(MutableState.kt:294)
at androidx.compose.foundation.text.TextFieldState.getHasFocus(CoreTextField.kt:537)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$4$focusObserver$1.invoke(CoreTextField.kt:198)
at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$4$focusObserver$1.invoke(Unknown Source:3)
at androidx.compose.ui.node.ModifiedFocusObserverNode.propagateFocusStateChange(ModifiedFocusObserverNode.kt:32)
....
at androidx.compose.runtime.Composer.recomposeToGroupEnd(Composer.kt:1560)
at androidx.compose.runtime.Composer.skipToGroupEnd(Composer.kt:1784)
at androidx.compose.ui.LayoutKt.WithConstraints(Layout.kt:532)
at androidx.compose.material.DrawerKt.BottomDrawerLayout-rxTpieo(Drawer.kt:427)
at de.charlex.xxx.ui.MyAppKt$MyAppContent$1.invoke(MyApp.kt:171) <----- Thats the first line in stacktrace where my sources are referenced.
Line MyApp.kt171
BottomDrawerLayout(
I was not able to find the reason. If i remove the BottomDrawerLayout, the app don't crash anymore. I tried another app, added a BottomDrawerLayout there and .... it worked fine...
I think the reason for the crash is not the BottomDrawerLayout.
Any ideas?caelum19
10/12/2020, 7:20 PMspierce7
10/12/2020, 7:33 PMGuy Bieber
10/12/2020, 9:27 PMHalil Ozercan
10/12/2020, 9:39 PMcompose-richtext
and abundance of Markdown parsers, I was able to have a working prototype in 2 evenings. Hopefully I can share the code once it is more organized and readable.
Irving
10/13/2020, 11:22 AMCircularProgressIndicator
to learn how to write a custom view.But I'm confused about the Modifier.semantics
. I thought it's SemanticsModifierCore
may store the properties of `CircularProgressIndicator`,but i did't see anything about SemanticsModifierCore
in CircularProgressIndicator
.So what does Modifier.semantics
do for us?😢Alexander Karkossa
10/13/2020, 12:31 PMRobert Menke
10/13/2020, 1:50 PMPasswordTextField
depcreated?Pedro Gomez
10/13/2020, 2:17 PMRoundedCornerShape(size = 16.dp)
The error reported by the screenshot testing shows a bunch of small different pixels making the tests fail. Red dots in the screenshot are the errors reported by the testing tool. Do you know if the rendering can vary depending on the build or any other param?Hitanshu Dhawan
10/13/2020, 4:08 PMSe7eN
10/13/2020, 4:50 PMval emojiState = remember { mutableStateOf(EmojiState.HIDDEN) }
val definition = transitionDefinition<EmojiState> {
state(EmojiState.HIDDEN) {
this[emojiSize] = 0.dp
}
state(EmojiState.START) {
this[emojiSize] = 20.dp
}
state(EmojiState.END) {
this[emojiSize] = 50.dp
}
transition(fromState = EmojiState.START, toState = EmojiState.END) {
interruptionHandling = InterruptionHandling.SNAP_TO_END
emojiSize using tween(3000, easing = FastOutSlowInEasing)
}
}
val transitionState = transition(
definition = createEmojiTransition(),
initState = emojiState.value,
toState = if (emojiState.value == EmojiState.START) EmojiState.END else EmojiState.HIDDEN,
onStateChangeFinished = {
emojiState.value = it
}
)
When I change emojiState
to HIDDEN
while the transition from START
to END
is going on, it looks like the transition isn't interrupted and still going on in the background.
For example, I change the transition to HIDDEN
1000 millis after starting the START
to END
transition, then after 2000 millis the onStateChangeFinished
is run and it sets my state back to END
. Is there some way I can interrupt the transition and prevent onStateChangeFinished
to be called for interrupted transitions. Or maybe my logic is at fault here?Mohammad Sianaki
10/13/2020, 6:33 PMLazyColumn
or LazyRow
scroll position across process death?Sebastian Neagrau
10/13/2020, 9:08 PMbruno.aybar
10/14/2020, 4:51 AMOutlinedTextField
, is there any way to always keep the label at the top , instead of having it inside when the text is empty / unfocused?
I know the answer here usually is that that's the recommended material behavior, however, in this case I feel that such a small change is not worth creating a new TextFieldImpl
implementation (but of course, I may be wrong).