Davide Giuseppe Farella
08/28/2020, 3:59 PMEsmaeel Nabil
08/28/2020, 4:01 PMmerono
08/28/2020, 4:31 PMConfiguration
changes stop working recently? That’s what it seems like when I use the code snippet below and specify android:configChanges="uiMode"
in my manifest.
MaterialTheme(
colors = if (isSystemInDarkTheme()) darkColors() else lightColors()
) {
Box(
Modifier.size(48.dp),
backgroundColor = MaterialTheme.colors.onBackground
)
}
The color of the Box
doesn’t change when I toggle dark mode on my device (pixel 3), but I feel like it did on an older version of compose. The color does get updated correctly if I kill the app and re-open it. I’m seeing this behavior on alpha01
and dev17
, using API 29.
I also tried similar things by using ConfigurationAmbient.current
directly, and saw the same behavior. When debugging the app, I was able to see AndroidComposeView.onConfigurationChanged
get called with the new Configuration
though.Vinay Gaba
08/28/2020, 5:19 PMmattinger
08/28/2020, 5:46 PMJCollardBovy
08/28/2020, 6:29 PMNemanja Mladenović
08/28/2020, 7:17 PMjaqxues
08/28/2020, 7:43 PMSergey Y.
08/28/2020, 9:48 PMSergey Y.
08/28/2020, 10:25 PMJavier
08/28/2020, 11:14 PMansman
08/28/2020, 11:45 PMColton Idle
08/29/2020, 4:23 AMText("A day in Shark Fin Cove")
Text("Davenport, California")
Text("December 2018")
and then tells you to wrap it in a column
Column {
Text("A day in Shark Fin Cove")
Text("Davenport, California")
Text("December 2018")
}
Is there an easy way to wrap elements in a layout? I think swift UI had an easy way to highlight and right click > wrap with X layout or something. I could see myself using that a lot. Would also be nice to get a list of all layouts when you "surround with" or something.
Unless this already exists... and I'm missing it.Colton Idle
08/29/2020, 4:28 AMZhelyazko Atanasov
08/29/2020, 7:40 AMVerticalScroller
was deprecated in dev15 and ScrollableColumn
is the Composable to be used. Also LazyColumnItems
was renamed to LazyColumnFor
in dev16.Philip Blandford
08/29/2020, 9:42 AMCaused by: java.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:1495)
at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1491)
at androidx.compose.runtime.snapshots.SnapshotKt.readable(Snapshot.kt:1482)
at androidx.compose.runtime.SnapshotMutableState.getValue(MutableState.kt:294)
...then my code
It's happening pretty randomly, in code WAY down in my base layers that has absolutely nothing to do with Compose, and at expressions that are very simple and shouldn't fail (one example is just creating a Fraction instance from the apache library).Halil Ozercan
08/29/2020, 10:18 AMUnable to load class 'kotlin.KotlinNothingValueException'.
This is an unexpected error. Please file a bug containing the idea.log file.
jannis
08/29/2020, 11:50 AMe: java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.common.messages.MessageCollector$DefaultImpls.report$default(org.jetbrains.kotlin.cli.common.messages.MessageCollector, org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity, java.lang.String, org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation, int, java.lang.Object)'
Execution failed for task ':app:kaptGenerateStubsDebugKotlin'.
> Internal compiler error. See log for more details
Anyknow knows how to solve this? (AS 4.2, Canary 8, Gradle 6.6, Gradle Plugin 4.2 beta Alpha 8, Kotlin 1.4.0, Compose 1.0.0-alpha01)Davide Giuseppe Farella
08/29/2020, 12:35 PM@Composable
fun SearchMovie(viewModel: SearchViewModel, query: String) {
val vm = remember(0) { viewModel }
vm.search(query)
val state by vm.result.collectAsState()
...
Also is there a way to “assign” a CoroutineScope
to a given @Composable
function?
My ViewModel does not inherit from the Android’s one, so I’m free to pass a Scope in the constructor and cancel it, but I’m not sure how to deal with a Composable’s life-cycleChatterjeekaustav11
08/29/2020, 12:37 PMJan Skrasek
08/29/2020, 7:25 PMJan Skrasek
08/29/2020, 8:21 PMColton Idle
08/29/2020, 9:02 PMFor example, if you wanted to add some outer spacing, change the background color of the composable, and round the corners of the ripple, you could use the following code:specifically the "round the corners of the ripple". This is the code snippet they're talking about:
Row(modifier
.padding(8.dp)
.clip(RoundedCornerShape(4.dp))
.background(MaterialTheme.colors.surface)
.clickable(onClick = { /* Ignoring onClick */ })
.padding(16.dp)
) {
We're not actually rounding the corner of the ripple, we're more so rounding the corner of the row, and so the ripple only goes up to the clipped area which gives you a rounded corner ripple... right?Afzal Najam
08/29/2020, 9:09 PMCircularProgressIndicator
inside an AlertDialog
seems like it's not as smooth outside of it. I'll post a video of this + sample code in a few hours.Colton Idle
08/29/2020, 9:23 PMJan Skrasek
08/29/2020, 10:10 PMButton(backgroundColor = Color.MyColor)
, but of course, also content color has to be handled. Explicit passing of such seems to be pretty verbose, but there is not probably any way to modify contentColorFor() behavior for my color. Other options is to create own Button implementation but that's not much elegant.Sergey Y.
08/30/2020, 12:01 AMdimsuz
08/30/2020, 12:21 AMSlackbot
08/30/2020, 3:54 AMMehdi Haghgoo
08/30/2020, 8:38 AMMehdi Haghgoo
08/30/2020, 8:38 AMgildor
08/30/2020, 9:23 AMZach Klippenstein (he/him) [MOD]
08/30/2020, 1:52 PM