We can use LocalConfiguration to listen for the orientation changes
@Composable
fun ConfigChangeExample() {
val configuration = LocalConfiguration.current
when (configuration.orientation) {
Configuration.ORIENTATION_LANDSCAPE -> {
Text("Landscape")
}
else -> {
Text("Portrait")
}
}
}
Note: This will not help to listen to the configuration change, This will just help to get the current Configuration.