Tash
03/15/2021, 2:29 AMdetectDragGestures
to a Composable that wraps an AndroidView
. It ends up glitching as shown in the GIF below. Should I file an issue, or am I doing something wrong? Code is here. Thanks in advance!gbaldeck
03/15/2021, 3:24 AMDeepak Gahlot
03/15/2021, 3:49 AMval registerTakeFile = registerForActivityResult(
ActivityResultContracts.OpenDocument()
and after updating to implementation "androidx.activity:activity-compose:1.3.0-alpha04" i'm getting an error
Can only use lower 16 bits for requestCode
Samir Basnet
03/15/2021, 6:34 AMSamir Basnet
03/15/2021, 7:26 AMUtkarsh Tiwari
03/15/2021, 11:19 AMDaniele B
03/15/2021, 1:37 PMmodel.loadDetailData(it)
call to the composable("detail/{item}")
, but I can’t find a Compose API to do that. If I include the call inside the composable
block, above DetailView
, such call gets executed at each recomposition, creating a never-ending loop.
@Composable
fun Navigation(model: KMPViewModel) {
val appState by model.stateFlow.collectAsState()
val navController = rememberNavController()
NavHost(navController, startDestination = "master") {
composable("master") {
MasterView(masterState = appState.masterState,
onListItemClick = {
navController.navigate("detail/$it")
model.loadDetailData(it)
}
)
}
composable("detail/{item}") {
DetailView(detailState = appState.detailState)
}
}
}
what is the right way to make it work with deep linking?julioromano
03/15/2021, 1:54 PMAndroidView
in sheetContent
of a BottomSheetScaffold
Please see the example code and video showing the bug in the thread.Rick Regan
03/15/2021, 2:07 PMText
that gets recomposed even though its value is not based on mutable state. In particular, this happens when I include it in another composable that has a Slider
with its own mutable state, and it doesn't happen when I put it in a separate composable (see thread for code). I know we're not supposed to depend on when recomposition happens or doesn't happen; I'm just trying to understand how Compose works (and avoid bugs that are hidden until code is refactored :) )escodro
03/15/2021, 2:39 PMState
wrapping the default ModalBottomSheetState
and one State
I created to handle which content should be shown for the user.
The implementation is on the comments and I need help to understand if I’m correctly saving the State
in order to use rememberSaveable
with it.
(It is working as expected, but I’m a little afraid of my “inner remember” inside the Saver
😬)
Thanks a lot in advance! ❤️Denis
03/15/2021, 2:52 PMbeta02
? My app can switch from light to dark, but not back. And I can't understand what happened with it. It worked before beta02.
https://kotlinlang.slack.com/archives/CJLTWPH7S/p1615651080120600Zach Klippenstein (he/him) [MOD]
03/15/2021, 2:56 PMDaniel Candeias
03/15/2021, 4:30 PMShawn Tucker
03/15/2021, 5:24 PModay
03/15/2021, 7:37 PM@Composable
internal fun Handler(
enabled: Boolean = true,
onBackPressed: () -> Unit
) {
val dispatcher =
(AmbientBackPressedDispatcher.current ?: return).onBackPressedDispatcher
val handler = remember { ComposableBackHandler(enabled) }
onCommit(dispatcher) {
dispatcher.addCallback(handler)
onDispose { handler.remove() }
}
onCommit(enabled) {
handler.isEnabled = enabled
handler.onBackPressed = onBackPressed
}
}
the onCommit
and onDispose
methods are now unresolved, not sure what to replace them with or howDylan
03/15/2021, 8:09 PMfirstVisibleItemScrollOffset
from LazyListState, I can compare it to the current value so if lastOffset
is lower than firstVisibleItemScrollOffset
, that means the user is scrolling down, however if lastOffset
is higher than firstVisibleItemScrollOffset
, that means the user is scrolling up. At least that's the result I was hoping for but unfortunately firstVisibleItemScrollOffset
is often equal to lastOffset
.
So what is the best way to know the scroll direction of a LazyColumn? 🤔
(What I would like to achieve is similar to what we used to do with the XML Toolbar View using app:layout_scrollFlags)Tim Malseed
03/16/2021, 2:02 AMKlaas Kabini
03/16/2021, 3:55 AMNathan Castlehow
03/16/2021, 4:30 AMMutableStateFlow
. I then want to “proxy” these through my view model to the view and expose them as something that the view can bind to. I want to avoid exposing them to the view as flows and then calling collectAsState
inside the view as i want to keep most things inside the view model.Jason Ankers
03/16/2021, 5:06 AMderivedStateOf
business logic inside itRafs
03/16/2021, 8:06 AMDeepak Gahlot
03/16/2021, 8:45 AMjulioromano
03/16/2021, 8:50 AMAndroidView
useless in 99% of its use cases.fabio.carballo
03/16/2021, 9:05 AMGeert
03/16/2021, 9:33 AM2021-03-16 10:31:43.170 21227-21227/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: app.medxpert.medxpert, PID: 21227
java.lang.ArrayIndexOutOfBoundsException: length=0; index=-5
at androidx.compose.runtime.SlotTableKt.key(SlotTable.kt:2531)
at androidx.compose.runtime.SlotTableKt.access$key(SlotTable.kt:1)
at androidx.compose.runtime.SlotReader.groupKey(SlotTable.kt:619)
at androidx.compose.runtime.ComposerImpl.end(Composer.kt:2065)
at androidx.compose.runtime.ComposerImpl.endGroup$runtime_release(Composer.kt:1462)
at androidx.compose.runtime.ComposerImpl.endRoot(Composer.kt:1147)
at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:2602)
at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:348)
Geert
03/16/2021, 9:33 AMHatice Sarp
03/16/2021, 11:05 AMArun
03/16/2021, 11:54 AMOutlinedTextField
include it somewhere?Mjahangiry75
03/16/2021, 1:24 PMWebView
inside an AndroidView
and it's so heavy, while it works smoothly in traditional way
see the code in threadoday
03/16/2021, 2:30 PModay
03/16/2021, 2:30 PM