mangubatrj
Angga Ardinata
abstract class BaseScreen : Screen, BaseScreenContent, ScreenLifecycleOwner { @Composable override fun Content() { val navigator = LocalNavigator.currentOrThrow var offsetState by remember { mutableFloatStateOf(0f) } Box( modifier = Modifier.background(Color.White) ) { ScreenContent() if (Platform.os == PlatformOS.iOS){ Box( modifier = Modifier .fillMaxHeight() .width(20.dp) .pointerInput(Unit){ detectHorizontalDragGestures( onDragEnd = { if (offsetState > 100) { if (navigator.items.size > 1) navigator.pop() } offsetState = 0f } ) { _, dragAmount -> if (offsetState < 0) return@detectHorizontalDragGestures offsetState += dragAmount } } ) } } } } private interface BaseScreenContent { @Composable fun ScreenContent() }
A modern programming language that makes developers happier.