কীবোর্ড IME অ্যানিমেশন ব্যবহার করুন

আপনি একটি স্ক্রলিং কন্টেইনারে Modifier.imeNestedScroll() প্রয়োগ করতে পারেন যাতে কন্টেইনারের নীচে স্ক্রোল করার সময় IME স্বয়ংক্রিয়ভাবে খুলতে এবং বন্ধ করতে পারে।

class WindowInsetsExampleActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        WindowCompat.setDecorFitsSystemWindows(window, false)

        setContent {
            MaterialTheme {
                MyScreen()
            }
        }
    }
}

@OptIn(ExperimentalLayoutApi::class)
@Composable
fun MyScreen() {
    Box {
        LazyColumn(
            modifier = Modifier
                .fillMaxSize() // fill the entire window
                .imePadding() // padding for the bottom for the IME
                .imeNestedScroll(), // scroll IME at the bottom
            content = { }
        )
        FloatingActionButton(
            modifier = Modifier
                .align(Alignment.BottomEnd)
                .padding(16.dp) // normal 16dp of padding for FABs
                .navigationBarsPadding() // padding for navigation bar
                .imePadding(), // padding for when IME appears
            onClick = { }
        ) {
            Icon(imageVector = Icons.Filled.Add, contentDescription = "Add")
        }
    }
}

অ্যানিমেশন একটি কীবোর্ডের জন্য পথ তৈরি করতে উপরে এবং নীচে স্ক্রোল করা একটি UI উপাদান দেখাচ্ছে
চিত্র 3. IME অ্যানিমেশন।