mertceyhan
05/15/2021, 8:17 PMremember
is a great solution for recomposition but is there any lifecycle aware solution for that? Because, when I rotate the app, and activity recreated I can’t achieve to remembered value. I guess, I should put this data into my model and get with the livedata?Nthily
05/15/2021, 8:28 PMaccompanist Pager
, how i change my interface when i click button?Colton Idle
05/16/2021, 5:53 AMAn idempotent composable always produces the same result for the same inputs and has no side-effects on recomposition.But since this composable is in a LazyColumn, if you scroll up and down then Random is triggered again after the composable goes off the screen and comes back. Doesn't this go against the whole "same result for the same inputs"? Is the codelab "wrong" in stating that this is idempotent? https://developer.android.com/codelabs/jetpack-compose-state#4
Colton Idle
05/16/2021, 6:24 AMPrashast Rastogi
05/16/2021, 7:48 AMNat Strangerweather
05/16/2021, 3:03 PMdelay.value
does not appear to update. Any ideas? 🧵curtjrees
05/16/2021, 3:05 PMGenericShape
?
For example, I’ve drawn a simple Triangle, but if I zoom slightly you can see how messy the lines areTudor Luca
05/16/2021, 3:20 PMnavigation-compose
, is there an example on how to have a main bottom-nav based navigation that also has some "full-screen" composables? Essentially the Jetsnack
sample but ported to the Navigation library: a shared bottom-nav for some screen and some screens going over the bottom-nav.Filip Wiesner
05/16/2021, 4:31 PMInk
05/16/2021, 4:38 PMLazyColumn {
items(postList) {
Post(
onPostClick = { post -> PostDetailsScreen() },
it
)
}
}
I display list with post. When I select post I want to open new @Composable view with post's details. Now I get error:
@Composable invocations can only happen from the context of a @Composable function.
Why?alexsullivan114
05/16/2021, 7:49 PMLazyColumn
?Spikey Sanju
05/16/2021, 9:07 PMColton Idle
05/17/2021, 12:36 AMJustin Yue
05/17/2021, 3:49 AMCompositionLocal
and CompositionLocalProvider
. My question is, why are these 2 not recommended for state management?Chachako
05/17/2021, 6:24 AMAlex
05/17/2021, 6:58 AMNestedScrollConnectionSample
but can't seem to find it anywhere. My usecase is building a collapsing toolbar layout. Would love it someone could point me in the right direction here, cheers!Alex
05/17/2021, 9:15 AMnestedScroll(...)
to create a collapsing toolbar (code in thread). However implementing it this way is disabling any flinging on the list. I am not sure why, because I am not consuming the Flings in my nested scroll, or do I? Will I have to reimplement flinging animations when using nested scrolling?Klaas Kabini
05/17/2021, 9:49 AMMarko Novakovic
05/17/2021, 10:41 AMMuhammad Zaryab Rafique
05/17/2021, 10:46 AMNthily
05/17/2021, 12:22 PMcuongtd
05/17/2021, 1:04 PMGaurav Gangwar
05/17/2021, 1:29 PMBilly Newman
05/17/2021, 2:09 PMInk
05/17/2021, 2:26 PM@Parcelize
data class Post(
val author: String,
val title: String,
val description: String,
val reactionNumber: Int
) : Parcelable
In my `navigationController`;
composable(
"PostDetails/{post}",
arguments = listOf(
navArgument("post") { type = NavType.ParcelableType(Post::class.java)}
)
) {
PostDetailsScreen(it.arguments?.get("post") as Post)
}
Now I get error: Parcelables don't support default values.
Should I pass object using GSON ot this way is corretly?
I heard that NavType.ParcelableType didn't work but right now it's implemented and developers can use it (?)Kyle Lehman
05/17/2021, 3:40 PM@Preview
composables in AS (currently Canary 15) with an error similar to this?
java.lang.NoClassDefFoundError: androidx/lifecycle/runtime/R$id
at androidx.lifecycle.ViewTreeLifecycleOwner.set(ViewTreeLifecycleOwner.java:49)
at androidx.compose.ui.tooling.preview.ComposeViewAdapter.init(ComposeViewAdapter.kt:612)
at androidx.compose.ui.tooling.preview.ComposeViewAdapter.<init>(ComposeViewAdapter.kt:206)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
This is only happening for some members on our team but once it does its persistent and the only way to get it to compile is add the following dependencies which doesnt seem necessary:
androidx.savedstate:savedstate-ktx
androidx.lifecycle:lifecycle-viewmodel-compose
androidx.lifecycle:lifecycle-runtime-ktx
androidx-core-ktx
Sergey B
05/17/2021, 4:06 PMScott Kruse
05/17/2021, 4:21 PMBradleycorn
05/17/2021, 8:27 PMRow(modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()) {
Surface() {
Text(...)
}
Column {
Text(...)
Text(...)
Text(...)
}
}
How do I get the Surface
to be the same height as the Column
?Nthily
05/17/2021, 9:02 PMSelectionContainer
interface?Nthily
05/17/2021, 9:02 PMSelectionContainer
interface?Siyamed
05/17/2021, 9:03 PMNthily
05/17/2021, 9:04 PMSiyamed
05/17/2021, 9:06 PMNthily
05/17/2021, 9:06 PMSiyamed
05/17/2021, 9:08 PMNthily
05/17/2021, 9:13 PMSurface(
color = Color.White,
elevation = 5.dp,
modifier = Modifier
.fillMaxSize()
.height(100.dp)
) {
SelectionContainer{
Text(
text = "",
)
}
}
Siyamed
05/17/2021, 9:19 PMNthily
05/17/2021, 9:21 PMSiyamed
05/17/2021, 9:22 PM