KotlinLeaner
09/20/2022, 2:00 PMSpacer
in jetpack compose?
Spacer(modifier = Modifier.height(16.dp))
v/s
Spacer(modifier = Modifier.preferredHeight(16.dp))
what is the difference between height
and preferredHeight
?Slackbot
09/20/2022, 4:28 PMBrandon Howard
09/20/2022, 5:18 PMdata class Ref<T>(var current: T? = null)
@Composable
fun SomeCmpt() {
var jobRef = remember { Ref<Job>() }
...
}
Travis Griggs
09/20/2022, 6:28 PMcolor
of Text
, but not of ClickableText
?spierce7
09/20/2022, 8:11 PMmattinger
09/20/2022, 9:16 PMval screens = listOfScreens.sortedBy {
stringResource(it.label)
}
it complains that i can’t execute the stringResource function outside of composable scope. Instead i have to do this:
val context = LocalContext.current
val screens = listOfScreens.sortedBy {
context.getString(it.label)
}
I’m a little confused what has changed between either kotlin or compose that this became a compile errorColton Idle
09/21/2022, 6:32 AMSlackbot
09/21/2022, 9:57 AMKotlinLeaner
09/21/2022, 11:39 AMLaunchedEffect
and SideEffect
in which scenario. I am adding some piece of code using both effect. Please lemme know if I am doing wrong here.Zoltan Demant
09/21/2022, 12:23 PM@Preview
annotations to generate screenshots for the play store? This was a #showerthought but its been a few hours and I havent been able to pick it apart yet. Seems like an easy approach, as compared to generating all that fake data. Any cons, besides it being very tied to compose (which I dont mind ❤️)?Chris Fillmore
09/21/2022, 1:01 PM@Preview
? (font size, display scale) ThanksValentin Gusselnikov
09/21/2022, 3:44 PMModifier.progressSemantics
causes recompositions.
I've a custom ProgressIndicator
, and if I use Modifier.progressSemantics
Android Studio "Layout inspector" shows thousand recompositions.
Is it a bug of "Layout inspector", or it is normal?Samy Benmeddour
09/21/2022, 5:22 PMAlexander Karkossa
09/21/2022, 8:10 PMcorneil
09/21/2022, 8:34 PMSlackbot
09/21/2022, 11:34 PMJaime
09/21/2022, 11:51 PMAaron Waller
09/22/2022, 2:08 AMButton(
onClick = { /*TODO*/ },
colors = ButtonDefaults.buttonColors(backgroundColor = Color(0xF7B500))){
}
Is showing me a Grey button but it should be Yellow/GoldGal Kohen
09/22/2022, 8:14 AMTolriq
09/22/2022, 8:51 AMAnimatedVisibility
? Clipping passed to the AnimatedVisibility
modifier is not working and the animation runs with a square .clip(CircleShape)
oday
09/22/2022, 9:53 AMColumn {
TopAppBarSearch(
searchText = searchState.searchText,
placeholderText = stringResource(id = R.string.search_for_a_city),
showClearButton = searchState.showClearButton,
showProgressBar = searchState.showProgressBar,
matchesFound = searchState.cities.isNotEmpty(),
onSearchTextChanged = { viewModel.onSearchTextChanged(it) },
onClearClick = { viewModel.onClearClick() },
onNavigateBack = { navigateBack() },
onEmptySearchResults = { NoSearchResults() },
onSearchResults = {
Cities(cities = searchState.cities) { city ->
viewModel.selectLocation(city)
navigateBack()
}
}
)
AnimatedVisibility(
visible = !searchState.isNetworkError
&& !searchState.isOtherError
&& searchState.cities.isEmpty(),
enter = fadeIn(),
exit = fadeOut()
) {
MyLocationHeader {
viewModel.selectCurrentLocation()
}
}
}
miqbaldc
09/22/2022, 9:59 AM@Preview
with rememberAsyncImagePainter
inside it, and showing an error instead?
stacktrace in 🧵
Bino
09/22/2022, 12:44 PMbarriers
in compose? I’m trying to archive something really easy, but stuck.
#00FF00 should stick to #FFFF00
#FFFF00 should be centered vertically
#0000FF should stick to the right
⚠️ when #FFFF00 expands, #00FF00 is gone (moved outside)
https://gist.github.com/thebino/6fee572f5f69b06fd44ec3b849a583a2Simona Stojanovic
09/22/2022, 3:16 PMChris Fillmore
09/22/2022, 5:28 PMAsyncImage
where data
is a File
, after upgrading to Android 13 (the issue does not repro on Android 12). These images don’t load anymore. Images which load from URI strings still load correctly. Anyone encountered something like this? Thanks in advance.
Tested Coil v 2.2.0 and 2.2.1nuhkoca
09/22/2022, 8:37 PMrememberSaveable
for Animatable
?
val pathPortion = rememberSaveable { Animatable(initialValue = 0f) }
Colton Idle
09/23/2022, 3:01 AMStaggered Grid
(I10b82)
• Introduce content padding to experimental Staggered Grid
(I342ea)
• Added Modifier.withConsumedWindowInsets()
to get consumed WindowInsets
for use outside windowInsetsPadding
.
• Added MutableWindowInsets
to allow easily changing WindowInsets
without recomposition.
• Fix fling animation cancellation issue (i wonder if this fixes flinging bottom sheet modals getting stuck when fully open)
• Add a Pull-To-Refresh component to Compose (I29168) OOOH What is this!? Another thing from accompanist that can die? (commit message: Migrates Accompanist's SwipeToRefresh to Compose with major changes.) so yes. it can die it seems.
• Behavior Breaking Changes (next two points)
• The parameter to remember
and rememberCoroutineScope
where changed to be crossinline
. This will report an error for early returns instead of allowing an early return which will cause a later internal error to be reported.
• This change can potentially lead to new compiler errors to be reported requiring non-local returns to be removed from the lambdas passed to these functions. (Ibea62)
• AndroidX Activity's BackHandler
API now works within a Dialog
composable. (I35342) OH YEAH
M3:
• ExposedDropdownMenuDefaults
now exposes a padding value for menu items. (I34ee1)
⚠️ Looks like coil and latest compose don't play well together. https://github.com/coil-kt/coil/issues/1473肖志康
09/23/2022, 4:16 AMTextField
with some annotations
in the TextFieldValue
, but in the onValueChange
callback all the annotations
are gone. How can I restore them?Saketh
09/23/2022, 8:13 AMAmrJyniat
09/23/2022, 9:25 AM