Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected bottom sheet behaviour with IME #39

Open
Plovotok opened this issue Apr 17, 2024 · 2 comments
Open

Unexpected bottom sheet behaviour with IME #39

Plovotok opened this issue Apr 17, 2024 · 2 comments
Labels
bug Something isn't working component: Sheet

Comments

@Plovotok
Copy link

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
Copy link
Author

Plovotok commented Apr 17, 2024

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
Copy link
Author

as possible solution:
AndroidManifest:

    android:windowSoftInputMode="adjustResize"

Theme:

    WindowCompat.setDecorFitsSystemWindows(window, false)

@alexzhirkevich alexzhirkevich added bug Something isn't working component: Sheet labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: Sheet
Projects
None yet
Development

No branches or pull requests

2 participants