Hook navigation up
This commit is contained in:
parent
0f61eb136b
commit
5847f668d2
7
data/src/main/java/com/nto/data/utils/Constants.kt
Normal file
7
data/src/main/java/com/nto/data/utils/Constants.kt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
package com.nto.data.utils
|
||||||
|
|
||||||
|
sealed class Destinations{
|
||||||
|
object Login
|
||||||
|
object Profile
|
||||||
|
object Scan
|
||||||
|
}
|
@ -5,11 +5,12 @@ import androidx.activity.ComponentActivity
|
|||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.navigation.compose.rememberNavController
|
||||||
|
import com.nto.presentation.composable.Navigation
|
||||||
import com.nto.presentation.theme.NTOTheme
|
import com.nto.presentation.theme.NTOTheme
|
||||||
import com.nto.presentation.theme.OnomatopoeiafrontTheme
|
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
|
||||||
|
|
||||||
@ -21,7 +22,13 @@ class MainActivity : ComponentActivity() {
|
|||||||
setContent {
|
setContent {
|
||||||
NTOTheme {
|
NTOTheme {
|
||||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||||
//TODO
|
val navController = rememberNavController()
|
||||||
|
Navigation(
|
||||||
|
navController = navController,
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(innerPadding)
|
||||||
|
.fillMaxSize()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.nto.presentation.composable
|
||||||
|
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.navigation.NavHostController
|
||||||
|
import androidx.navigation.compose.NavHost
|
||||||
|
import androidx.navigation.compose.composable
|
||||||
|
import com.nto.data.utils.Destinations
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun Navigation(navController: NavHostController, modifier: Modifier = Modifier) {
|
||||||
|
NavHost(
|
||||||
|
navController = navController,
|
||||||
|
modifier = modifier,
|
||||||
|
startDestination = Destinations.Login.toString()
|
||||||
|
) {
|
||||||
|
composable(Destinations.Login.toString()) {
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
composable(Destinations.Profile.toString()){
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
composable(Destinations.Scan.toString()){
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user