Orlando
07/09/2025, 10:29 PMnavigator.evaluateJavaScript
method to send a token and other information from the native app to the WebView on iOS, but it does not work on Android. Here's some sample code:
@Composable
fun MyWebViewScreen(webUrl: String) {
val webViewState =
rememberWebViewState("<https://www.mysite.com>")
val webViewNavigator = rememberWebViewNavigator()
val jsBridge = rememberWebViewJsBridge(webViewNavigator)
val token by dataStore.getUserToken().collectAsState(initial = null)
LaunchedEffect(Unit) {
initWebView(webViewState)
initJsBridge(jsBridge)
}
LaunchedEffect(
webViewState.loadingState,
token,
) {
if (webViewState.loadingState == LoadingState.Finished && token != null) {
val authMessage = {
"options": "userAuth",
"token": "$token",
}
webViewNavigator.evaluateJavaScript("window.postMessage($authMessage, '*');")
}
}
Column(Modifier.fillMaxSize()) {
WebView(
state = webViewState,
modifier = Modifier
.padding(WindowInsets.statusBars.asPaddingValues())
.fillMaxSize(),
navigator = webViewNavigator,
webViewJsBridge = jsBridge,
)
}
}
fun initWebView(webViewState: WebViewState) {
webViewState.webSettings.apply {
zoomLevel = 1.0
isJavaScriptEnabled = true
logSeverity = KLogSeverity.Debug
allowFileAccessFromFileURLs = true
allowUniversalAccessFromFileURLs = true
androidWebSettings.apply {
allowFileAccess = true
isAlgorithmicDarkeningAllowed = true
domStorageEnabled = true
}
}
}
fun initJsBridge(webViewJsBridge: WebViewJsBridge) {
webViewJsBridge.register(GreetJsMessageHandler())
}
does anybody have any experience/workaround for Android? thanks!ursus
07/10/2025, 6:15 PMmaxWidth
which is from the box with constraints scopeChristopher Mederos
07/11/2025, 4:23 AMZoltan Demant
07/11/2025, 4:56 AMBox { Box { } }
The inner box has a bunch of focusable, scrollable and clickable elements. I want to disable all of those, while still allowing the outer box to be clickable. How do I do that? More details in š§µagrosner
07/11/2025, 8:18 PMModalBottomSheetLayout
component where I need to nest content with a LazyColumn
. When i do that, the content refuses to scroll . I use a LazyVerticalGrid
, like magic it scrolls. Anyone have a workaround that lets you use a lazycolumn? It has to somewhat do with the draggable anchors code but not entirely sure why one works, but not the otherJonathan
07/11/2025, 8:41 PM.graphicsLayer {
scaleX = scale
scaleY = scale
translationX = translation.value.x
translationY = translation.value.y
}
change the size and location of the bounding box for click listeners?enighma
07/11/2025, 9:04 PMThierry Kh
07/12/2025, 5:53 PMNitesh Singh
07/13/2025, 5:35 AMAlex Styl
07/14/2025, 3:27 AMScrollbarAdapter
are contained within org.jetbrains.compose.foundation:foundation-desktop
but when i check the sources of that artifact the code is different (and they dont contain the scrollbar stuff)
Any ideas in which artifact are the sources of compose-multiplatform-core
released? link on github is https://github.com/JetBrains/compose-multiplatform-core/blob/jb-main/compose/found[ā¦]skikoMain/kotlin/androidx/compose/foundation/Scrollbar.skiko.ktkecaroh
07/14/2025, 10:31 AMrequestScrollToItem
in that version of Compose, so I trying to use it with scrollToItem
- it however behaves differently in some cases, reorder looks wonky etc.
Is there a way for me to get requestScrollToItem
in my older Compose version?Jonathan
07/14/2025, 2:21 PMandroidx.compose.material3:material3-window-size-class
and androidx.compose.material3.adaptive:adaptive-
? They both seem to contain code for determining window size classes.Zoltan Demant
07/14/2025, 4:31 PMval scope = rememberCoroutineScope()
and If I log scope.coroutineContext[CoroutineDispatcher]
I can see that its a ~_FlushingDispatcher_
But later on when I do scope.launch { .. }
and check, suddenly the thread being used is: DefaultDispatcher-worker-5 @coroutine#238
Can anyone explain? The tests are being run on the JVM with runSkikoComposeUiTest
.Andy Flisher
07/14/2025, 7:24 PMenighma
07/14/2025, 9:05 PMA
but I don't want any of the white space that is there for other letters.
In my real example I'm using unicode characters, all of which is of the same size, but I don't want the whitespace I'm getting
I.e. can I draw the glyph itself somehow.ursus
07/15/2025, 8:11 PMJetchat
sample
I want to keep scroll at 0 (if it was at 0) when new messages are inserted
val listState = rememberLazyListState()
SideEffect {
if (!listState.canScrollBackward) {
listState.requestScrollToItem(index = 0) <------------------
}
}
LazyColumn(
...
state = listState,
...
) {
...
}
this seems to do the trick.
However, I also have a next screen (image message detail). If I navigate there, and then back, the chat screen composable is "instantiated" again, therefore triggering SideEffect
lambda, and resetting the scroll -- which is not what I want -- the scroll offset should be kept (which it does by default, but then I don't get that "keep scroll at 0" behavior)
Any clean way around this other than hacks?Jonathan
07/15/2025, 8:22 PMInfiniteTransition
doesnāt have a pause/stop function. In the past I achieved it by using a while
loop inside of a LaunchedEffect
and manually updating an Animatable
instance. This feels a little clunky and I wonder if there is a proper API I should be using.ursus
07/15/2025, 8:24 PMSideEffect
has a quirk that the lambda gets triggered when there was navigation (backstack.push), and than back again to the list screen; and user expects the scroll to be kept as was -- but here, SideEffect
fires again, thuss resetting the scroll.. any idea what to do about it?ursus
07/15/2025, 11:46 PMLazyColumn
do a ādouble stepā scroll when calling animateScrollToItem (0)
? I would expect one smooth scroll like recycler used to do.Zoltan Demant
07/16/2025, 4:26 PMeygraber
07/16/2025, 9:10 PMribesg
07/17/2025, 7:35 AMandroidx.compose.material3.windowsizeclass.calculateWindowSizeClass()
in skikoMain
and not commonMain
in material3-window-size-class
1.9.0-alpha03
? I had to duplicate the function in my app's commonMain
ursus
07/17/2025, 2:09 PMTextField
and I enter a screen, it doesn't have focus, no keyboard is opened.
If I tap it, it gets focused, keyboard opens.
If I close the screen, and then come back to it again, focus is somehow preserved, and keyboard opens automatically
I don't want that (for a chat ui). I want the keyboard to never auto-open when I enter the screen.
Any way to fix this? I'm trying the keyboardOptions.showKeyboardOnFocus = false
but doesn't seem to have an effect
I think it's that the focus is preserved somehow across screen boundaries.
Is there a way to scope it?Arne Vanstraeseele
07/17/2025, 3:17 PMOrlando
07/17/2025, 7:50 PMColumn(Modifier.fillMaxSize()) {
WebView(
state = webViewState,
modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing).fillMaxSize()
)
}
if i use the following modifier, the keyboard covers the webview's text input:
modifier = Modifier.padding(WindowInsets.statusBars.asPaddingValues()).fillMaxSize()
Nish
07/17/2025, 8:31 PMVishal Sheoran
07/18/2025, 3:29 AMThomas Hormes
07/18/2025, 5:55 AMKyant
07/18/2025, 9:28 AMdetectTransformGestures
? I tried to use
val zoomVelocityTracker = VelocityTracker()
zoomVelocityTracker.addPosition(elapsedTimeMillis, Offset(totalZoom, 0f))
but got wrong velocity which is very smallPablichjenkov
07/18/2025, 8:11 PMval colorModifier = Modifier.background(CustomColor)
in a Surface
Surface(modifier = colorModifier) {...}
Show a different color than in a Box
Box(modifier = colorModifier) {...}
Not sure what could be the reason behind it but I am having this behavior where the color on the surface looks a bit more whitish. For a bit more context. It is a Composable very deep in the Composable tree, a leaf in the tree basically.