কীবোর্ড 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 এলিমেন্ট কীভাবে উপর-নিচে স্ক্রল করে তা অ্যানিমেশনে দেখানো হয়েছে
ছবি ৩. IME অ্যানিমেশন।