-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I would like to be able to set interactivity modifiers to SnizzorsUIView so that I can move the view around with touch gestures.
It seems like even if I set interactivity to false, the UiKitView still consumes the events.
It would be great to be great to be able to use it. Potentially possible to make proper use of Liquid Glass with this technique.
My code:
@Composable
fun InteractiveView() {
var offsetX by remember { mutableStateOf(0f) }
var offsetY by remember { mutableStateOf(0f) }
SnizzorsUIView(
// UIKitView(
properties = UIKitInteropProperties(
isInteractive = false,
isNativeAccessibilityEnabled = false
),
modifier = Modifier
.offset { IntOffset(offsetX.roundToInt(), offsetY.roundToInt()) }
.pointerInput(Unit) {
detectDragGestures { change, dragAmount ->
change.consume()
offsetX += dragAmount.x
offsetY += dragAmount.y
}
}.border(1.dp, Color.Red).size(48.dp),
factory = {
UIVisualEffectView()
}
)
}
PS: If i replace the SnizzorsUIView with UIKitView interactivity works, but then I lose the transparency.
Metadata
Metadata
Assignees
Labels
No labels