MainActivity.kt

1.5 KB · raw

1package com.peachpasswords23import android.graphics.Color as AndroidColor4import android.graphics.drawable.ColorDrawable5import android.os.Bundle6import android.view.WindowManager7import androidx.activity.compose.setContent8import androidx.activity.enableEdgeToEdge9import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen10import androidx.fragment.app.FragmentActivity11import dagger.hilt.android.AndroidEntryPoint12import com.peachpasswords.ui.PeachAppNavHost13import com.peachpasswords.ui.theme.PeachTheme1415// FragmentActivity (not ComponentActivity) so androidx BiometricPrompt can attach.16@AndroidEntryPoint17class MainActivity : FragmentActivity() {18    override fun onCreate(savedInstanceState: Bundle?) {19        installSplashScreen()20        super.onCreate(savedInstanceState)2122        // Match the splash/window fill to --bg so launch never flashes white.23        window.setBackgroundDrawable(ColorDrawable(AndroidColor.parseColor("#0C0A06")))2425        enableEdgeToEdge()2627        // Block screenshots / recents thumbnails of the vault in release builds.28        if (!BuildConfig.DEBUG) {29            window.setFlags(30                WindowManager.LayoutParams.FLAG_SECURE,31                WindowManager.LayoutParams.FLAG_SECURE,32            )33        }3435        setContent {36            // Theme/accent are wired to persisted settings in a later phase; the37            // shell uses the dark default until SettingsViewModel lands.38            PeachTheme {39                PeachAppNavHost()40            }41        }42    }43}