2023-08-23 00:03:42 +03:00
|
|
|
package com.x8bit.bitwarden
|
|
|
|
|
2023-10-03 22:34:51 +03:00
|
|
|
import android.content.Intent
|
2023-08-23 00:03:42 +03:00
|
|
|
import android.os.Bundle
|
|
|
|
import androidx.activity.ComponentActivity
|
|
|
|
import androidx.activity.compose.setContent
|
2023-10-03 22:34:51 +03:00
|
|
|
import androidx.activity.viewModels
|
2023-09-28 22:18:03 +03:00
|
|
|
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
2023-09-05 21:13:26 +03:00
|
|
|
import com.x8bit.bitwarden.ui.platform.feature.rootnav.RootNavScreen
|
|
|
|
import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
|
2023-08-23 00:03:42 +03:00
|
|
|
import dagger.hilt.android.AndroidEntryPoint
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Primary entry point for the application.
|
|
|
|
*/
|
|
|
|
@AndroidEntryPoint
|
|
|
|
class MainActivity : ComponentActivity() {
|
2023-10-03 22:34:51 +03:00
|
|
|
|
|
|
|
private val mainViewModel: MainViewModel by viewModels()
|
|
|
|
|
2023-08-23 00:03:42 +03:00
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
2023-09-28 22:18:03 +03:00
|
|
|
var shouldShowSplashScreen = true
|
|
|
|
installSplashScreen().setKeepOnScreenCondition { shouldShowSplashScreen }
|
2023-08-23 00:03:42 +03:00
|
|
|
super.onCreate(savedInstanceState)
|
2023-08-29 17:43:15 +03:00
|
|
|
setContent {
|
|
|
|
BitwardenTheme {
|
2023-09-28 22:18:03 +03:00
|
|
|
RootNavScreen(
|
|
|
|
onSplashScreenRemoved = { shouldShowSplashScreen = false },
|
|
|
|
)
|
2023-08-29 17:43:15 +03:00
|
|
|
}
|
|
|
|
}
|
2023-08-23 00:03:42 +03:00
|
|
|
}
|
2023-10-03 22:34:51 +03:00
|
|
|
|
|
|
|
override fun onNewIntent(intent: Intent) {
|
|
|
|
super.onNewIntent(intent)
|
|
|
|
mainViewModel.sendAction(
|
|
|
|
action = MainAction.ReceiveNewIntent(
|
|
|
|
intent = intent,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
}
|
2023-08-23 00:03:42 +03:00
|
|
|
}
|