cb
12/02/2020, 8:47 PMKshitij Patil
12/02/2020, 8:52 PMRobert Menke
12/02/2020, 9:24 PMNate Ridderman
12/02/2020, 9:39 PMjaqxues
12/02/2020, 9:49 PMDominaezzz
12/02/2020, 11:31 PMderivedStateOf
vs remember
. When should I prefer one over the other?Nipun Rajput
12/03/2020, 10:30 AMRafs
12/03/2020, 10:32 AMallan.conda
12/03/2020, 10:35 AMVivek Sharma
12/03/2020, 11:02 AMscaffold
with bottomBar
, and the body
content , the body
content goes below bottomBar
, how can we avoid it? so that our content dont hide behind bottomBar
Rafs
12/03/2020, 11:27 AMFloatingActionButton
?Irving
12/03/2020, 11:47 AMandroidx.compose.ui.util.fastAny
and androidx.compose.ui.util.fastForEach
can't resolve. The util lib need i resolve manually?ds3fdfd3
12/03/2020, 11:52 AMallan.conda
12/03/2020, 12:05 PMcreateComposeRule
is in alpha08?nrobi
12/03/2020, 12:42 PM@Composable registerForActivityResult()
from the callback of a clickable()
. Are there any options/workarounds to call it directly from the callback?Kshitij Patil
12/03/2020, 12:42 PMarrangement.End
and spacedBy(x.dp)
for a row?Maik
12/03/2020, 12:54 PM@Composable
fun Greeting() {
Box(
modifier = Modifier.height(250.dp)
) {
Box(
modifier = Modifier
.align(Alignment.TopCenter)
.size(100.dp)
.border(3.dp, Color.Cyan)
)
Box(
modifier = Modifier
.align(Alignment.BottomCenter)
.size(100.dp)
.border(3.dp, Color.Cyan, GenericShape { size ->
moveTo(0f, 0f)
lineTo(size.width, 0f)
})
)
}
}
As you can see in the screenshot, the border is drawn, but it does not have the right width and also not the right color.
Maybe someone can explain me where my mistake is or how I can draw a corresponding border at the top edge.
I used the current version of Compose and Kotlin.Rafs
12/03/2020, 1:10 PMArrangement.SpaceEvenly
for LazyRowFor
?Mini
12/03/2020, 1:12 PMcomposeOptions {
kotlinCompilerVersion '1.4.20'
kotlinCompilerExtensionVersion '1.0.0-alpha08'
}
kotlinOptions {
useIR = true
jvmTarget = "1.8"
}
Everything works until I add buildFeatures { compose true }
When compose is enabled the project never finishes building. I have multiple attempts, and my last one has been running for 3 hours 36 minutes 😕
Any ideas what might be wrong?mattinger
12/03/2020, 2:02 PMmattinger
12/03/2020, 2:33 PMjava.lang.IncompatibleClassChangeError: Found interface org.jetbrains.kotlin.ir.declarations.IrClass, but class was expected
at androidx.compose.compiler.plugins.kotlin.VersionChecker.check(VersionChecker.kt:65)
at
Daniele B
12/03/2020, 2:33 PMVivek Sharma
12/03/2020, 3:13 PMnavController.popBackStack()
while navigating, and using this on pressing backButton
in 2nd composable
but when I am in 2nd compose and rotate
screen , and then press backButton
, it doesnt do anything
Any idea why ? 🤔zoha131
12/03/2020, 4:20 PMfillParentMaxWidth()
in ScrollableRow
? or can I scroll programmatically in LazyRow
?Kshitij Patil
12/03/2020, 4:34 PMfillMaxWidh()
? Seems like preferredSize()
is a compulsory step to do.Kirill Grouchnikov
12/03/2020, 11:08 PMButton
composable that uses enabled
to configure the surface and content color. Is AmbientContentColor
then used at the icon level to tint the child icon in the disabled state? What if the icon is not created from one of the material icons, but rather a "simple" bitmap? What would be the recommended way to propagate the disabled state to it so that it can draw itself at, say, 50% alpha?Timo Drick
12/04/2020, 12:05 AMzoha131
12/04/2020, 1:04 AMLilly
12/04/2020, 1:17 AM@Composable
fun BluetoothDeviceListAdapterComponent(
items: List<BluetoothDeviceWrapper>,
connectVM: ConnectViewModel,
onConnected: () -> Unit
) {
// initial state is a problem here
val connectState: BluetoothConnectState by connectVM.state.collectAsState()
onCommit(connectState) {
Timber.w("connectState changed")
when(connectState) {
is BluetoothConnectState.Loading -> {
Timber.w("Loading")
}
is BluetoothConnectState.Success -> {
Timber.w("GoTo next screen.")
onConnected()
}
is BluetoothConnectState.Failure -> {
// how to call toast from here?
}
}
}
state
is a MutableStateFlow
and can be Loading, Success or Failure(val errorMessage). First problem is that MutableStateFlow
needs an initial value which triggers onCommit
on first start but it should only be triggered when viewModel changes its state explicitly. Second problem is when state is Success and next screen is started: When I get back to the screen, onCommit
is trigged with value Success and starts the next screen again, although the state hasn't changed. Last question would be how to call a Toast from onCommit
? Is this approach even optimal for my use case?zoha131
12/04/2020, 1:34 AMvar expanded by remember { mutableStateOf(false) }
the error:
Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
zoha131
12/04/2020, 1:34 AMvar expanded by remember { mutableStateOf(false) }
the error:
Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
Lilly
12/04/2020, 1:35 AMimport androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
zoha131
12/04/2020, 1:37 AM