Ronald Toshkollari
05/29/2022, 1:11 PMCristina Uroz
05/29/2022, 1:46 PMOmar
05/29/2022, 2:43 PMFloatingActionButton
when scrolling in compose?Sam Stone
05/30/2022, 2:38 AMSatyam G
05/30/2022, 7:36 AMsanggggg
05/30/2022, 8:16 AMHåkon Pettersen
05/30/2022, 10:50 AM@Composable
fun List<SecuritySensor>.asListOfRowImageText() = asList {
RowImageText(
leadingIconRes = it.icon,
text = { it.description },
textStyle = MaterialTheme.typography.body1
)
}
@Composable
private fun <T> List<T>.asList(
withDividers: Boolean = false,
itemBuilder: @Composable (T) -> Unit,
) = Column {
forEachIndexed { index, item ->
itemBuilder(item)
if (withDividers && index < lastIndex) {
EvaDivider()
}
}
}
I am currently getting warning message: Composable functions that return Unit should start with an uppercase letter
. Is there a better way of creating compose functions to avoid getting this message?Valentin Gusselnikov
05/30/2022, 11:38 AMRecyclerView
, what happened? We do not need to setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
and disposeComposition()
anymore?Tgo1014
05/30/2022, 3:30 PMjean
05/30/2022, 6:10 PMLazyColumn
with coil
items(photos) { photo ->
Card(
modifier = Modifier.fillMaxWidth()
) {
Column {
Image(
painter = rememberAsyncImagePainter(model = photo.url),
contentDescription = "location image",
contentScale = ContentScale.Crop,
modifier = Modifier.fillMaxWidth()
.height(160.dp)
)
Text(
text = photo.title,
style = MaterialTheme.typography.h6,
modifier = Modifier.padding(8.dp)
)
Text(
text = "lat: ${photo.lat} / lon: ${photo.lon}",
modifier = Modifier.padding(start = 8.dp, bottom = 16.dp)
)
}
}
}
This is quite unstable, some picture loads and some doesn’t. Any idea what I’m doing wrong here?Alex
05/30/2022, 8:09 PMAnimatedContent
? Like if I want to get notified if an animation has finished.
e.g. AnimatedContent
gets new targetState
, animates, calls my listener when animation has finishedColton Idle
05/31/2022, 1:13 AMMatej Drobnič
05/31/2022, 5:28 AMFrank van der Laan
05/31/2022, 6:47 AM@Composable
fun ConfigureSystemBars(
isContentDark: Boolean = defaultIsContentDark,
) {
val systemUiController = rememberSystemUiController()
val isDarkTheme = isSystemInDarkTheme()
LaunchedEffect(isContentDark) {
systemUiController.setSystemBarsColor(
color = Color.Transparent,
darkIcons = isContentDark && !isDarkTheme,
isNavigationBarContrastEnforced = false,
)
}
}
It sort of feels (when using it in a component), like it’s displaying a component now. It’s not returning anything, so it cannot be called configureSystemBars
(lower case).James Adefehinti
05/31/2022, 8:09 AMGumiku
05/31/2022, 8:37 AMset enabled
for modifier swipeable
Modifier.swipeable(enabled = false)
not work fine now, even set enabled = false
SwipeableState.offset still keep changing
any idea about this?nlindberg
05/31/2022, 10:07 AMjasu
05/31/2022, 11:33 AMlilypuchi
05/31/2022, 2:16 PMLocalConfiguration.current
line exists in calculateWindowSizeClass(activity: Activity)
? Am I wrong in thinking that it does nothing here? 🤔
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]ndroidWindowSizeClass.android.kt;l=37?q=calculateWindowSi&sq=Advitiay Anand
05/31/2022, 3:31 PMMehdi Haghgoo
05/31/2022, 6:09 PMtad
05/31/2022, 8:01 PMderivedStateOf
lambda walks out of a bar. The bartender waves and shouts, "Calculator!"darkmoon_uk
06/01/2022, 12:08 AMAaron Waller
06/01/2022, 8:21 AMvar snackBarMessage: MutableState<String?> = mutableStateOf(null)
private set
and the set function:
fun setSnackbarMessage(msg: String?){
snackBarMessage.value = null
snackBarMessage.value = msg
}
Here is my Launcheffect which unfortunately is not getting triggered twice:
LaunchedEffect(key1 = viewModel.snackBarMessage.value){
val message = viewModel.snackBarMessage.value
message?.let {
scaffoldState.snackbarHostState.showSnackbar(message, "Ok")
}
}
and on Favorite button click I call:
viewModel.setSnackbarMessage("Added to Favorite")
Eventhough I set the snackBarMessage to null it is not getting retriggered, only if the string message is different from the one before.
I want to show the snackbar every time the user clicks on the button and not just the first timehenrikhorbovyi
06/01/2022, 2:36 PMNoSuchMethod: No Static method setContent
My dependencies:
dependencies {
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.compose.ui:ui:1.1.1")
implementation("androidx.compose.material:material:1.1.1")
implementation("androidx.compose.ui:ui-tooling-preview:1.1.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.1")
implementation("androidx.activity:activity-compose:1.4.0")
debugImplementation("androidx.compose.ui:ui-tooling:1.1.1")
debugImplementation("androidx.compose.ui:ui-test-manifest:1.1.1")
}
Nikolas Guillen Leon
06/01/2022, 3:12 PMWindowCompat.setDecorFitsSystemWindows(window, false)
in MainActivity.
My Column’s modifier is
modifier = Modifier
.fillMaxSize()
.padding(horizontal = MaterialTheme.spacing.medium)
.padding(paddingValues)
.consumedWindowInsets(paddingValues)
.imePadding()
.verticalScroll(rememberScrollState())
(Modifier.systemBarsPadding() is in the NavHost)mattinger
06/02/2022, 2:14 AMoffset(5) should be less than line limit(0)
java.lang.IndexOutOfBoundsException: offset(5) should be less than line limit(0)
at android.text.TextLine.measure(TextLine.java:353)
at android.text.Layout.getHorizontal(Layout.java:1213)
at android.text.Layout.getHorizontal(Layout.java:1190)
at android.text.Layout.getPrimaryHorizontal(Layout.java:1160)
See thread for test code.jasu
06/02/2022, 5:06 AMallan.conda
06/02/2022, 5:37 AMallan.conda
06/02/2022, 5:37 AMDoris Liu
06/02/2022, 11:11 PMallan.conda
06/06/2022, 12:39 PM