myanmarking
09/29/2021, 5:09 PMOrhan Tozan
09/29/2021, 7:14 PMadjpd
09/29/2021, 7:28 PMtextAlign = TextAlign.Justify
mean the whitespace is stretched to fill the width? Or am I misunderstanding TextAlign.Justify
?
Text(
"heebie-jeebies ".repeat(4),
Modifier.fillMaxWidth().background(Color.Yellow),
textAlign = TextAlign.Justify
)
adjpd
09/29/2021, 9:00 PMBrush.verticalGradient
in a white Box
renders gray with drawWithCache
. A bug? Code in 🧵Daniel Oliveira
09/30/2021, 1:52 AMVladas
09/30/2021, 9:24 AMmyanmarking
09/30/2021, 9:56 AMChris Miller
09/30/2021, 10:45 AM@Preview @Composable
fun PreviewTest() { Random.nextBoolean(); Text("Hello World") }
Rafiul Islam
09/30/2021, 10:50 AMmyanmarking
09/30/2021, 10:53 AMHeikki Rauhala
09/30/2021, 11:42 AMmyanmarking
09/30/2021, 12:08 PMval hasError by remember(textFieldValue.value) {
derivedStateOf {
textFieldValue.value.text.isNotEmpty() && isInputValid(textFieldValue.value.text).not()
}
}
I want the caller code to access this value, but i don’t want to change it outsidenilTheDev
09/30/2021, 12:26 PMonLongClick
event handler to a button? There is no parameter in the constructor. I tried with Modifier.combinedClickable
with a onLongClick
event listener. But it isn't working.
Column(modifier = Modifier.padding(30.dp)) {
Button(
onClick = {
Toast.makeText(
applicationContext,
"hi",
Toast.LENGTH_SHORT
).show()
},
modifier = Modifier.combinedClickable(
onLongClick = {
Toast.makeText(
applicationContext,
"hello",
Toast.LENGTH_SHORT
).show()
},
onClick = {}
)
) {
Text(text = "Click Me")
}
}
}
myanmarking
09/30/2021, 12:40 PMZoltan Demant
09/30/2021, 1:07 PMModifier.alpha
, due to the underlying call to `graphicsLayer`; is there a way to work around this?Marko Gajić
09/30/2021, 1:33 PMmyanmarking
09/30/2021, 2:30 PMshahroz
09/30/2021, 2:46 PMCompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Rtl){
}
I only want this to happen when the locale is RTL, is there any efficient way to find out what layout direction should be used?theapache64
09/30/2021, 2:47 PMjava.lang.IllegalStateException: No compose views found in the app. Is your Activity resumed?
➡️ More details in the SO threadSkolson5903
09/30/2021, 5:28 PMorg.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: <path>/GridDisplay.kt
The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.backend.common.lower.loops.RangeLoopTransformer.gatherLoopVariableInfo(ForLoopsLowering.kt:375)
Anyone else seen this? I started stripping stuff down and have a small function now that doesn't
do much but builds fine, then a change to one line causes the build to fail with this error.
I'll post the good code/failing code in a thread in case someone is interested. Weird.
Searches show a similar error when trying to use kotlinx serialization and compose in the same
module, but I don't have that scenario. My app does have three multi-platform modules using
serialization, but the app module specific to android and using compose does not use serialization.
Would this be a jetbrains defect or a Compose/google defect? Thanks in advance for any suggestions. FWIW this happens with kotlin 1.5.30 and compose 1.1.0-alpha04brabo-hi
09/30/2021, 7:58 PM@Composable
fun MyComposable() {
val cameraPermissionState = rememberPermissionState(Manifest.permission.READ_CONTACTS)
}
I am getting the following error `
java.lang.IllegalStateException: Permissions should be called in the context of an Activity
`Colton Idle
09/30/2021, 8:02 PMScott Kruse
09/30/2021, 9:45 PMdarkmoon_uk
10/01/2021, 12:15 AMTextField
inside a scrollable area then this affects you.
Currently, Compose does not maintain visibility of focused elements inside a scrollable viewport, when it shrinks.
This affects the very common case, where a user taps a Text Field and keyboard pops up. Often the field will become hidden behind the keyboard due to the viewport not scrolling (this is not an Activity adjustResize
or Insets issue).
Currently the only workaround is a hacky solution with a delay and RelocationRequester
.
This needs a proper solution!mcpiroman
10/01/2021, 9:15 AMPiotr Prus
10/01/2021, 9:35 AMFlorian
10/01/2021, 9:40 AMFlorian
10/01/2021, 9:56 AM(context as Activity).apply {}
block directly into the composable function or do I have to wrap it into one of the side effects methods? I just can't wrap my head around it.
@Composable
fun TimerScreen(
viewModel: TimerViewModel = hiltViewModel(),
) {
val uiState by viewModel.uiState.collectAsState(null)
val context = LocalContext.current
[...]
val screenBrightness = if (uiState?.timerRunning == true) 0.15f else -1f // default
(context as Activity).apply {
val attributes = window.attributes
attributes.screenBrightness = screenBrightness
window.attributes = attributes
}
ScreenContent(
uiState = uiState,
actions = viewModel,
scaffoldState = scaffoldState,
bodyScrollState = bodyScrollState,
)
}
Mikołaj Kąkol
10/01/2021, 10:27 AMyschimke
10/01/2021, 11:37 AM