zt
10/19/2022, 1:32 AMif (targetState == SettingsDestination.Main) {
slideInHorizontally { width -> -width } + fadeIn() with fadeOut()
} else {
slideInHorizontally { width -> width } + fadeIn() with fadeOut()
}
Manojna Chintapalli
10/19/2022, 2:06 AMTim Malseed
10/19/2022, 6:21 AMElio Maroun
10/19/2022, 7:54 AMAbdul Hafeez Sajid
10/19/2022, 8:09 AMTower Guidev2
10/19/2022, 9:44 AMabbic
10/19/2022, 10:32 AMKwok Wong
10/19/2022, 12:17 PMPHondogo
10/19/2022, 2:59 PMJasmin Fajkic
10/19/2022, 3:50 PMrps
10/19/2022, 5:49 PMPHondogo
10/19/2022, 6:53 PMAfzal Najam
10/19/2022, 7:06 PMComposeView
(match_parent
width and height) inside a FrameLayout
. I’m using this ComposeView
as a place to show Compose Snackbars (and some other overlays) right now but the ComposeView
doesn’t allow Talkback
interactions with anything below it, even when no content is set inside it.Yingding Wang
10/19/2022, 8:57 PMPiotr Prus
10/19/2022, 9:02 PMmutableStateListOf
where I am adding new items on each click. Then I call list.onEach { } to render new composable. I feel like this solution is not ideal, cause the list teorytically may have ♾️ elements. I tried to delete the items when animatino ends, but that is causing the view to recompose with some elements “inProgress” and introduce a lot of glitches.
What is the proper way to fire these emojis?lilypuchi
10/19/2022, 10:16 PMIconButton
in a list item of a LazyColumn
to which I pass Icon
in two ways:
1. using painterResource()
with my in app Image drawables (vector)
Icon(
modifier = Modifier.size(16.dp),
painter = painterResource(
id = if (isLiked) R.drawable.ic_like_filled else R.drawable.ic_like
),
contentDescription = null,
tint = if (isLiked) AppTheme.colors.selected else AppTheme.colors.unselected
)
This leads to Recomposition of Icon.
2. using imageVector
with MaterialIcons
Icon(
modifier = Modifier.size(16.dp),
imageVector = if (isLiked) Icons.Rounded.Favorite else Icons.Rounded.FavoriteBorder,
contentDescription = null,
tint = if (isLiked) AppTheme.colors.selected else AppTheme.colors.unselected
)
This skips Recomposition of Icon.
Internally both seem to using rememberVectorPainter()
and I’m failing to see why painterResource
internal implementation can cause a Recomposition. Am I missing something here? 🤔
(Attaching the recomposition counter screenshots for reference. Attached in order of the above cases)Slackbot
10/19/2022, 10:20 PMAmrJyniat
10/20/2022, 7:46 AMAlertDialog
on a specific action and I'm thinking in tow ways:
1- Pass the action to the root Composable fun then show the dialog.
2- Show the dialog from the Composable that manage the action and then pass the result to the root Composable?
I tend to the first option since it's more manageable, what do you think?CLOVIS
10/20/2022, 8:14 AM// this is not idiomatic, just an extremely simplified example
fun foo(bar: String): Int {
val int = bar.toIntOrNull()
requireNotNull(int) { "Early return here" }
return int
}
Using Arrow, the either
comprehension enables similar features:
fun foo(bar: String): Either<String, Int> {
val int = bar.toIntOrNull()
ensureNotNull(int) { "Early return here" }
return int
}
Using Flows, similar behavior can be emulated using catch
:
fun foo(bar: Stirng): Flow<Result> = flow {
val int = bar.toIntOrNull()
requireNotNull(int) { "Early return here" }
emit(Result.success(int))
}.catch {
if (it !is IllegalArgumentException) throw it
emit(Result.failure(it))
}
Which brings it to my question: what is the equivalent with @Composable
functions?harry248
10/20/2022, 9:22 AMAnnotatedString
with `SpanStyle`'s defining large font sizes the space between lines becomes smaller and smaller. It seems to be fine until font sizes larger then 24 sp. Anyone noticed this too? What could be wrong?Blaž Vantur
10/20/2022, 10:09 AMTower Guidev2
10/20/2022, 11:04 AMJason Toms
10/20/2022, 12:34 PMAppCompatDelegate.setDefaultNightMode
I can see that onConfigurationChanged
is called in the Activity, but nothing automatically changes in my composables. Is there more setup needed that I have missed in a thread?gowtham 6674
10/20/2022, 12:34 PMOleksandr Balan
10/20/2022, 12:56 PMrememberSaveable
could store a list of instances, but not an instance alone?
Code in the 🧵ste
10/20/2022, 4:00 PMSnapLayoutInfoProvider
for a ScrollState
(used by a Pager
composable, where all the items have fillMaxSize
), but I don't really get what calculateSnappingOffsetBounds
is expected to return. I don't understand the doc either.
I mean, shouldn't an offset be enough (i.e. the new `ScrollState`'s value
)?Ryan Smith
10/20/2022, 4:17 PMRyan Smith
10/20/2022, 4:27 PMGuilherme Delgado
10/20/2022, 4:49 PMZach Klippenstein (he/him) [MOD]
10/20/2022, 6:41 PM