sashjakk
11/29/2020, 11:26 AMSpikey Sanju
11/29/2020, 1:15 PMKshitij Patil
11/29/2020, 2:26 PMVivek Sharma
11/29/2020, 2:48 PMDavide Bertola
11/29/2020, 3:02 PMHitanshu Dhawan
11/29/2020, 8:52 PMscrollToPosition(int position)
in Compose?Vivek Sharma
11/30/2020, 9:42 AMSnackbar
? I found 2 methods on docs, 1 is taking boolean state
and making it visible/hide
on button click but here Snackbar doesn't get disappear after some interval (as we are controlling through state).
2 is when using Scaffold
, it has snackbarHost
where we customize our snackbar and display using a Coroutine Scope
.
So how can we make Snackbar hide after some time in 1 method? or should we use 2 methodThiago
11/30/2020, 12:53 PMTristan
11/30/2020, 2:38 PMby state
and remember
differences. Could someone guide me towards some documentation about it?spierce7
11/30/2020, 4:20 PMmanueldidonna
11/30/2020, 5:13 PMgrandstaish
11/30/2020, 5:30 PMRoundedCornerShape
take a percentage as an Int
instead of a float between 0f-1f? I keep finding myself creating custom CornerSizes to work around thistylerwilson
11/30/2020, 5:32 PMDominaezzz
12/01/2020, 12:52 AMtranslate { scale { rotate { drawImage(...) } } }
in what order are these transformations applied to the drawn image?Nate Ridderman
12/01/2020, 2:54 AMrepo init …
Vincent tiensi
12/01/2020, 5:19 AMKshitij Patil
12/01/2020, 7:24 AMLazyColumnFor
? Like adding or removing items and expect the changes to be reflected in the LazyColumn
?
Something like adapter.notifyDatasetChanged()
we used to do with RecyclerView
Geert
12/01/2020, 11:31 AMSpacer(modifier = Modifier.width(4.dp))
Daniele B
12/01/2020, 3:13 PMJordi Saumell
12/01/2020, 8:10 PMJulianK
12/02/2020, 11:05 AMArchie
12/02/2020, 11:29 AMNavGraph
?
NavHost(mainNavController, startDestination = STARTING) {
composable(STARTING) {
StartScreen(navController)
}
composable(NEXT) {
Scaffold(
topbar = { TopAppBar(...) }
) {
val nestedNavController = ...
NavHost(nestedNavController, startDestination = FLOW1) {
composable(FLOW1) {
Flow1Screen(navController)
}
composable(FLOW2) {
Flow1Screen(navController)
}
...
}
}
}
}
Joseph D
12/02/2020, 11:57 AMVal Salamakha
12/02/2020, 12:14 PMKshitij Patil
12/02/2020, 4:39 PMcollectAsState()
or adding each element in a local MutableSnapshotList
using something like onEach
or collect { }
tcracknell
12/02/2020, 6:31 PMBradleycorn
12/02/2020, 6:34 PMFlow
with Composables and produceState
?
For example, consider:
@Composable
fun MyUi(viewModel: ViewModel) {
val data by produceState(initialValue = "data", viewModel) {
viewModel.getDataFlow().collect {
value = it
}
}
}
What if the viewModel.getDataFlow()
method uses some flow operator(s)? For example:
fun getDataFlow(): Flow<String> {
return myRoomDb.getData().distinctUntilChanged().map { convertEntityToString(it) }
}
I think I remember reading awhile back that this can be a problem, because every time there is a recomposition, the operators (in this case map) have to get re-wired up. Which (I think) I understand. So if so, what’s the solution?koufa
12/02/2020, 6:46 PMkobby
12/02/2020, 7:22 PMColton Idle
12/02/2020, 7:56 PMandroidx.compose.compiler.plugins.kotlin.IncompatibleComposeRuntimeVersionException: You are using an outdated version of Compose Runtime that is not compatible with the version of the Compose Compiler plugin you have installed. The compose compiler plugin you are using (version 1.0.0-alpha08) expects a minimum runtime version of 1.0.0-alpha08.
Anyone else get this?Colton Idle
12/02/2020, 7:56 PMandroidx.compose.compiler.plugins.kotlin.IncompatibleComposeRuntimeVersionException: You are using an outdated version of Compose Runtime that is not compatible with the version of the Compose Compiler plugin you have installed. The compose compiler plugin you are using (version 1.0.0-alpha08) expects a minimum runtime version of 1.0.0-alpha08.
Anyone else get this?kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
buildFeatures {
compose true
viewBinding true
}
composeOptions {
kotlinCompilerVersion '1.4.20'
kotlinCompilerExtensionVersion '1.0.0-alpha08'
}
root level build.gradle was changed to this:
classpath 'com.android.tools.build:gradle:7.0.0-alpha01'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20"
and gradle was updated to 6.7.1
I've tried cleaning, building, etc. Any other debugging steps I can take here?jaqxues
12/02/2020, 9:56 PMimplementation
clauses?Colton Idle
12/03/2020, 3:11 AMimplementation
yet.
@jim or @Leland Richardson [G] any ideas?jim
12/03/2020, 3:30 AMalpha07
? In particular, what is your androidx.compose.runtime:runtime
dependency version?Colton Idle
12/03/2020, 5:45 AMkotlinOptions {
jvmTarget = '1.8'
useIR = true
}
buildFeatures {
compose true
viewBinding true
}
composeOptions {
kotlinCompilerVersion '1.4.20'
kotlinCompilerExtensionVersion '1.0.0-alpha08'
}
and that's enough to not allow me to compile.implementation "androidx.compose.runtime:runtime:1.0.0-alpha08"
and it worked.
Someone should really clarify in the "Add Jetpack Compose to an existing project" what is mandatory and what's not 😄
https://developer.android.com/jetpack/compose/setup#add-compose
It tells you have to configure kotlin, and gradle, but the toolkit dependencies seem optional. tooling previews, material, etc. No mention of androidx.compose.runtime:runtime:
jim
12/03/2020, 10:02 PM