Fix edge-to-edge on three-button nav bar

This commit is contained in:
Goooler 2025-05-29 17:36:34 +08:00
parent ebb605131d
commit 44f1252990
No known key found for this signature in database
GPG key ID: 020BDA623C651E0E

View file

@ -16,6 +16,7 @@
package com.google.ai.edge.gallery
import android.os.Build
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
@ -32,6 +33,12 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
// Fix for three-button nav not properly going edge-to-edge.
// TODO: https://issuetracker.google.com/issues/298296168
window.isNavigationBarContrastEnforced = false
}
setContent {
GalleryTheme {
Surface(