Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ android {
dependencies {
// ๊ธฐ์กด ์˜์กด์„ฑ ์œ ์ง€
implementation(project(":core:ui"))
implementation(project(":data"))
implementation(project(":domain"))
implementation(project(":core:common"))
implementation(project(":presentation"))
implementation(project(":feature:onboarding"))
implementation(project(":feature:auth"))
Expand All @@ -80,6 +83,8 @@ dependencies {

implementation("androidx.core:core-splashscreen:1.0.1")
implementation("androidx.navigation:navigation-compose:2.7.5")
implementation("androidx.hilt:hilt-navigation-compose:1.1.0")

implementation(libs.balloon)
implementation(libs.core.splashscreen)

Expand Down
62 changes: 48 additions & 14 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,61 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<!-- ์ธํ„ฐ๋„ท ๊ถŒํ•œ -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- ์ด๋ฏธ์ง€ ๊ด€๋ จ ๊ถŒํ•œ (API ๋ ˆ๋ฒจ๋ณ„๋กœ ์ ์ ˆํžˆ ์„ค์ •) -->
<uses-permission android:name="android.permission.CAMERA" />

<!-- Android 13 ์ดํ•˜์šฉ -->
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />

<!-- Android 13 ์ด์ƒ์šฉ -->
<uses-permission
android:name="android.permission.READ_MEDIA_IMAGES"
android:minSdkVersion="33" />

<!-- ํ•˜๋“œ์›จ์–ด ๊ธฐ๋Šฅ ๋ช…์‹œ (ํ•„์ˆ˜ ์•„๋‹˜) -->
<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<application
android:name=".BarrionApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Barrion"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="@xml/network_security_config"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Barrion.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.Barrion.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- FileProvider ์ถ”๊ฐ€ -->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

</application>
</manifest>
136 changes: 120 additions & 16 deletions app/src/main/java/com/example/barrion/navigation/BarrionNavHost.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// app/src/main/java/com/example/barrion/navigation/BarrionNavHost.kt (์ตœ์ข… ๋ฒ„์ „)
// BarrionNavHost.kt - ๋ฉ”์ธ ๋„ค๋น„๊ฒŒ์ด์…˜ ํ˜ธ์ŠคํŠธ (์ˆ˜์ •๋œ ๋ฒ„์ „)
package com.example.barrion.navigation

import androidx.compose.foundation.layout.Box
Expand All @@ -8,20 +8,26 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavHostController
import androidx.navigation.NavType
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.navArgument
import com.barrion.navigation.HomeScreen
import com.example.auth.screen.LoginScreen
import com.example.auth.screen.WelcomeScreen
import com.example.menu.screen.MenuScreen
import com.example.menu.screen.AddMenuScreen
import com.example.menu.screen.CategoryDetailScreen
import com.example.menu.screen.CategoryManagementScreen
import com.example.menu.screen.EditMenuScreen
import com.example.menu.viewmodel.MenuViewModel
import com.example.onboarding.presentation.OnboardingScreen
import com.example.onboarding.presentation.SetupStoreInfoScreen
import com.example.onboarding.presentation.SetupBusinessTypeScreen
import com.example.onboarding.presentation.SetupKioskCategoryScreen
import com.example.order.screen.OrderScreen
import com.example.sales.screen.SalesScreen
import com.example.staff.screen.StaffScreen
import com.example.staff.screen.StaffDetailScreen
import com.example.staff.screen.StaffEditScreen

/**
* ์•ฑ์˜ ๋ฉ”์ธ ๋„ค๋น„๊ฒŒ์ด์…˜ ํ˜ธ์ŠคํŠธ
Expand Down Expand Up @@ -113,26 +119,124 @@ fun BarrionNavHost(navController: NavHostController) {
)
}

// ํ™ˆ ํ™”๋ฉด - ๋ฐ”ํ…€ ๋„ค๋น„๊ฒŒ์ด์…˜ ํฌํ•จ
// โœ… ํ™ˆ ํ™”๋ฉด - ๋ฐ”ํ…€ ๋„ค๋น„๊ฒŒ์ด์…˜ ํฌํ•จ (๋ชจ๋“  ํƒญ์€ ์—ฌ๊ธฐ์„œ ๊ด€๋ฆฌ)
composable(route = NavRoutes.Home.route) {
HomeScreen()
HomeScreen(navController = navController)
}

// ๋ฐ”ํ…€ ๋„ค๋น„๊ฒŒ์ด์…˜ ํ™”๋ฉด๋“ค
composable(route = NavRoutes.Menu.route) {
MenuScreen()
// ========== ๋ฉ”๋‰ด ๊ด€๋ฆฌ ์ƒ์„ธ ํ™”๋ฉด๋“ค ==========
composable(route = NavRoutes.CategoryManagement.route) {
val viewModel: MenuViewModel = hiltViewModel()
CategoryManagementScreen(
viewModel = viewModel,
onNavigateBack = {
navController.popBackStack()
}
)
}

composable(route = NavRoutes.Orders.route) {
OrderScreen()
composable(
route = NavRoutes.CategoryDetail.route,
arguments = listOf(
navArgument("categoryId") { type = NavType.LongType },
navArgument("categoryName") { type = NavType.StringType }
)
) { backStackEntry ->
val categoryId = backStackEntry.arguments?.getLong("categoryId") ?: 0L
val categoryName = backStackEntry.arguments?.getString("categoryName") ?: ""
val viewModel: MenuViewModel = hiltViewModel()

CategoryDetailScreen(
categoryId = categoryId,
categoryName = categoryName,
viewModel = viewModel,
onNavigateBack = {
navController.popBackStack()
},
onNavigateToAddMenu = { categoryId ->
navController.navigate(NavRoutes.AddMenu.createRoute(categoryId))
},
onNavigateToEditMenu = { menuId ->
navController.navigate(NavRoutes.EditMenu.createRoute(menuId))
}
)
}

composable(route = NavRoutes.Sales.route) {
SalesScreen()
composable(
route = NavRoutes.AddMenu.route,
arguments = listOf(
navArgument("categoryId") {
type = NavType.LongType
defaultValue = 0L
nullable = false
}
)
) { backStackEntry ->
val categoryId = backStackEntry.arguments?.getLong("categoryId")?.takeIf { it != 0L }
val viewModel: MenuViewModel = hiltViewModel()

AddMenuScreen(
selectedCategoryId = categoryId,
viewModel = viewModel,
onNavigateBack = {
navController.popBackStack()
}
)
}

composable(route = NavRoutes.Staff.route) {
StaffScreen()
composable(
route = NavRoutes.EditMenu.route,
arguments = listOf(
navArgument("menuId") { type = NavType.LongType }
)
) { backStackEntry ->
val menuId = backStackEntry.arguments?.getLong("menuId") ?: 0L
val viewModel: MenuViewModel = hiltViewModel()

EditMenuScreen(
menuId = menuId,
viewModel = viewModel,
onNavigateBack = {
navController.popBackStack()
}
)
}

// ========== ์ง์› ๊ด€๋ฆฌ ์ƒ์„ธ ํ™”๋ฉด๋“ค ==========

// โœ… Staff ์ƒ์„ธ ํ™”๋ฉด - onEditClick ํŒŒ๋ผ๋ฏธํ„ฐ ์ œ๊ฑฐ
composable(
route = NavRoutes.StaffDetail.route,
arguments = listOf(navArgument("staffId") { type = NavType.LongType })
) { backStackEntry ->
val staffId = backStackEntry.arguments?.getLong("staffId") ?: 0L
StaffDetailScreen(
staffId = staffId,
// โœ… onEditClick ํŒŒ๋ผ๋ฏธํ„ฐ ์ œ๊ฑฐ๋จ
onBack = {
navController.popBackStack()
}
)
}

composable(
route = NavRoutes.StaffEdit.route,
arguments = listOf(
navArgument("id") {
type = NavType.LongType
defaultValue = 0L
nullable = false
}
)
) { backStackEntry ->
val staffId = backStackEntry.arguments?.getLong("id")?.takeIf { it != 0L }

StaffEditScreen(
staffId = staffId,
onBack = {
navController.popBackStack()
}
)
}
}
}
Loading