TheMrCodes
03/29/2021, 4:50 PMMichal Klimczak
03/29/2021, 8:01 PMLaunchedEffect(true)
. There's probably some other Effect
that I should use, right?
val pagerState = rememberPagerState(pageCount = pages.size)
LaunchedEffect(true) {
//SharedFlow
pageChangeFlow.collect {
pagerState.animateScrollToPage(it)
}
}
HorizontalPager(state = pagerState)
Shivam Sethi
03/30/2021, 4:35 AMTim Malseed
03/30/2021, 11:15 AMGabriel
03/30/2021, 11:37 AMLukasz Burcon
03/30/2021, 11:41 AMColumn(modifier = Modifier.pointerInteropFilter {
when (it.action) {
ACTION_DOWN -> {
true
}
else -> {
false
}
}
}
... some other code
)
But sadly that code blocks all scroll interactions. How can I intercept clicks to my buttons on a scrollable column without disabling the scroll?Denis Ismailaj
03/30/2021, 12:32 PMNthily
03/30/2021, 3:09 PMval getContent = registerForActivityResult(ActivityResultContracts.GetContent()) {
viewModel.imageUriState.value = it
// Handle the returned Uri
}
if (viewModel.imageUriState.value != null) {
Log.d(TAG, "${viewModel.imageUriState.value}")
}
getContent.launch("image/*")
Hi, I got the Uri of the photo from the user's album using registerForActivityResult, how can I convert the Uri to ImageBitmap and store it in my room? i've searched a lot from StackOverflow, but there doesn't seem to be a very standard answerTheMrCodes
03/30/2021, 4:59 PMBocWithConstraints
skips a Frame before rendering its child nodes? [wrong call]dzaitsev
03/30/2021, 5:11 PMGeert
03/30/2021, 7:16 PMAlejo
03/30/2021, 8:46 PMTim Malseed
03/30/2021, 10:16 PMJoe Jensen
03/31/2021, 12:43 AMModalBottomSheetLayout
as a root component to the app?
My use case: I have an existing app with bottom navigation implemented as a fragment, and I will slowly migrate each tab (each its own fragment) to jetpack compose. How would I render a bottom sheet on top of all that UI? There doesn't seem to be an equivalent to AlertDialog
but for bottom sheetsShivam Sethi
03/31/2021, 1:58 AMMarko Novakovic
03/31/2021, 7:31 AMCompose
MVI
example?Alan Yin
03/31/2021, 9:01 AMSamir Basnet
03/31/2021, 9:27 AMsubashz
03/31/2021, 10:03 AMMikołaj Kąkol
03/31/2021, 10:15 AMModifier
that is passed to compose function. What the idea there? Should it be passed to first composable function, or to most inner function? Should we treat it like layoutparams
, so it’s for the most outer composable? Is it okay to pass multiple Modifiers
to different composables?escodro
03/31/2021, 11:53 AMNavHost(navController = navController, startDestination = startDestination) {
composable(Destinations.Home) {
Home()
}
composable(Destination.TaskDetail) {
TaskDetailSection()
}
composable(Destination.About) {
About()
}
}
But I don’t see how I can make my graph call a compose from a DFM ou how could the DFM register on this graph.
Thanks a lot in advance! ❤️Geert
03/31/2021, 12:35 PMJesse Hill
03/31/2021, 12:37 PMmutableStateOf
when the activity hit onPause
but then in the app switcher it still showed the old UI. I also was trying to use the Lifecycle architecture component to update the state but that didn’t work either. Is this something that can be achieved with Compose? The current code is in the thread.Samir Basnet
03/31/2021, 1:26 PMText(
text = "Online",
style = MaterialTheme.typography.subtitle2,
maxLines = 1,
color = MaterialTheme.colors.onSurface,
modifier = Modifier
.drawWithContent {
drawCircle(color = green, radius = 25f)
drawContent()
}
.constrainAs(online) {
start.linkTo(name.start)
top.linkTo(verifiedLogo.bottom, 10.dp)
}
)
Alex
03/31/2021, 3:20 PMVerticalScrollbar
seems no longer to exist..?Nthily
03/31/2021, 4:18 PMDaniel Candeias
03/31/2021, 4:46 PMonActive{}
.
• Does it still exist, or does it have a different name/approach now? Currently using compose version 1.0.0-beta3
, i did import runtime
, livedata
and rxjava2
but still cant see these methods.
• I would like the animation to start as soon as its rendered. For this I would use animateFloatAsState
for this together with onActive{}
. I guess the is how we handle animation.wisdom
03/31/2021, 6:20 PMjulioromano
03/31/2021, 6:44 PMe: This version (1.0.0-alpha13) of the Compose Compiler requires Kotlin version 1.4.31 but you appear to be using Kotlin version 1.4.32 which is not known to be compatible. Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
I knew about this (that this needs to be suppressed if one wants to upgrade kotlin), but the curious thing is the “1.0.0-alpha13” version of compose compiler part.
Why alpha13 if I’m using beta03?Shivam Sethi
03/31/2021, 8:26 PMShivam Sethi
03/31/2021, 8:26 PMZach Klippenstein (he/him) [MOD]
03/31/2021, 8:28 PMModifier.heightIn
is what you’re looking for? https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/package-summary.html#(androidx.compose.ui.[…]x.compose.ui.unit.Dp)Shivam Sethi
03/31/2021, 8:36 PMAdam Powell
03/31/2021, 8:52 PM.fillMaxHeight
or something similar)Shivam Sethi
03/31/2021, 8:56 PM