alexzhirkevich / compose-cupertino

Compose Multiplatform UI components for iOS (Cupertino Widgets)
Apache License 2.0
1.05k stars 35 forks source link

Unexpected bottom sheet behaviour with IME #39

Open Plovotok opened 5 months ago

Plovotok commented 5 months ago

Looks like "camera" move along the screen. M3 Bottom sheet scaffold has other behaviour https://github.com/alexzhirkevich/compose-cupertino/assets/59875059/e56c66d4-7c80-4e30-86f4-c6192e53bc75

Plovotok commented 5 months ago

code:

CupertinoBottomSheetScaffold(
        scaffoldState = scaffoldState,
        sheetDragHandle = {
            CupertinoBottomSheetDefaults.DragHandle()
        },
        sheetContent = {
            CupertinoBottomSheetContent(
                modifier = Modifier.navigationBarsPadding(),
                topBar = {
                    CupertinoTopAppBar(
                        title = {
                            CupertinoText(text = "Information")
                        },
                        actions = {
                            CupertinoIconButton(
                                onClick = { }
                            ) {
                                CupertinoIcon(
                                    CupertinoIcons.Filled.XmarkCircle,
                                    null,
                                    tint = CupertinoTheme.colorScheme.placeholderText
                                )
                            }
                        }
                    )
                }
            ) {
                Column(
                    modifier = Modifier
                        .fillMaxSize()
                        .padding(
                            top = it.calculateTopPadding(),
                            bottom = it.calculateBottomPadding()
                        )

                ) {

                    CupertinoSearchTextField(
                        value = text.value,
                        onValueChange = { text.value = it },
                    )

                    Column(
                        modifier = Modifier
                            .fillMaxSize()
                            .verticalScroll(scrollState)
                    ) {
                        list.forEach {
                            CupertinoText(
                                text = it,
                                modifier = Modifier
                                    .fillMaxWidth()
                                    .padding(horizontal = 16.dp, vertical = 4.dp),
                                fontSize = 14.sp
                            )
                        }
                    }
                }
            }
        }
    ) {
        //My content
    }
Plovotok commented 5 months ago

as possible solution: AndroidManifest:

    android:windowSoftInputMode="adjustResize"

Theme:

    WindowCompat.setDecorFitsSystemWindows(window, false)