|
@@ -8,8 +8,17 @@ import androidx.compose.foundation.layout.Box
|
|
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
import androidx.compose.material3.Scaffold
|
|
|
+import androidx.compose.runtime.Composable
|
|
|
+import androidx.compose.runtime.mutableStateOf
|
|
|
+import androidx.compose.runtime.remember
|
|
|
import androidx.compose.ui.Modifier
|
|
|
+import androidx.compose.ui.platform.LocalContext
|
|
|
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
|
|
+import androidx.hilt.navigation.compose.hiltViewModel
|
|
|
+import androidx.navigation.NavHostController
|
|
|
+import androidx.navigation.compose.rememberNavController
|
|
|
+import com.example.wabi.domain.navigation.Navigation
|
|
|
+import com.example.wabi.domain.repository.PrefManager
|
|
|
import com.example.wabi.ui.theme.WabiTheme
|
|
|
import dagger.hilt.android.AndroidEntryPoint
|
|
|
|
|
@@ -21,15 +30,31 @@ class MainActivity : ComponentActivity() {
|
|
|
enableEdgeToEdge()
|
|
|
|
|
|
setContent {
|
|
|
- WabiTheme {
|
|
|
- Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
|
|
+ val context = LocalContext.current
|
|
|
+ val navHostController = rememberNavController()
|
|
|
+ val isBottomBar = remember { mutableStateOf(false) }
|
|
|
+ val isTopBar = remember { mutableStateOf(false) }
|
|
|
+ PrefManager.initPrefManager(context)
|
|
|
+
|
|
|
+ WabiTheme(themeState = 0) {
|
|
|
+ Scaffold(modifier = Modifier.fillMaxSize(),
|
|
|
+ containerColor = WabiTheme.colors.backgroundColor,
|
|
|
+ bottomBar = {},
|
|
|
+ topBar = {}) { innerPadding ->
|
|
|
Box(
|
|
|
- modifier = Modifier.padding(innerPadding)
|
|
|
+ modifier = Modifier
|
|
|
+ .fillMaxSize()
|
|
|
+ .padding(innerPadding)
|
|
|
) {
|
|
|
-
|
|
|
+ InitApp(navHostController)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+@Composable
|
|
|
+fun InitApp(navHostController: NavHostController, vm: MainActivityViewModel = hiltViewModel()) {
|
|
|
+ Navigation(navHostController)
|
|
|
}
|