Skip to content

Commit

Permalink
Use safe insets to draw content
Browse files Browse the repository at this point in the history
Currently edge to edge is enabled but we are not making use of safe
insets which causes app to draw behind display cutouts. This is
not a good UX, especially in landscape mode.
  • Loading branch information
thesohelshaikh committed Nov 22, 2024
1 parent ab6e2ae commit 3fe2f20
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import androidx.activity.enableEdgeToEdge
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.scaleIn
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeContent
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBar
Expand Down Expand Up @@ -100,7 +102,8 @@ fun App() {
)
}
}
}
},
contentWindowInsets = WindowInsets.safeContent
) { innerPadding ->
NavHost(
modifier = Modifier
Expand Down

0 comments on commit 3fe2f20

Please sign in to comment.