[gallery] improve demo experience to keep the screen always on.

PiperOrigin-RevId: 775825781
This commit is contained in:
Google AI Edge Gallery 2025-06-25 13:54:34 -07:00 committed by Copybara-Service
parent 3c5302b4fc
commit db0242fe88

View file

@ -18,6 +18,7 @@ package com.google.ai.edge.gallery
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.WindowManager
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge import androidx.activity.enableEdgeToEdge
@ -39,5 +40,7 @@ class MainActivity : ComponentActivity() {
window.isNavigationBarContrastEnforced = false window.isNavigationBarContrastEnforced = false
} }
setContent { GalleryTheme { Surface(modifier = Modifier.fillMaxSize()) { GalleryApp() } } } setContent { GalleryTheme { Surface(modifier = Modifier.fillMaxSize()) { GalleryApp() } } }
// Keep the screen on while the app is running for better demo experience.
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
} }
} }