Skip to content

Commit

Permalink
Merge pull request #313 from Nexters/refactor/253
Browse files Browse the repository at this point in the history
Refactor/253 Navigation 2.8.x Safe Args 적용
  • Loading branch information
HamBP authored Jan 1, 2025
2 parents 49acd12 + a5c5217 commit 8c09242
Show file tree
Hide file tree
Showing 52 changed files with 780 additions and 847 deletions.
3 changes: 3 additions & 0 deletions domain/src/main/java/com/nexters/boolti/domain/model/Sns.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.nexters.boolti.domain.model

import kotlinx.serialization.Serializable

data class Sns(
val id: String,
val type: SnsType,
val username: String,
) {
@Serializable
enum class SnsType {
INSTAGRAM, YOUTUBE;

Expand Down
2 changes: 2 additions & 0 deletions presentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.hilt)
alias(libs.plugins.kotlin.serialization)
id("kotlin-kapt")
id("kotlin-parcelize")
}
Expand Down Expand Up @@ -78,6 +79,7 @@ dependencies {

implementation(libs.hilt.android)
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.kotlinx.serialization.json)
implementation(libs.androidx.material3.android)
implementation(libs.zoomable)
kapt(libs.hilt.compiler)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.nexters.boolti.presentation.extension

import androidx.navigation.NavController
import com.nexters.boolti.presentation.screen.MainDestination
import com.nexters.boolti.presentation.screen.navigation.MainRoute

fun NavController.navigateToHome() {
popBackStack(graph.startDestinationId, true)
try {
navigate(MainDestination.Home.route)
navigate(MainRoute.Home)
} catch (e: IllegalArgumentException) {
navigate(graph.startDestinationId)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@ package com.nexters.boolti.presentation.reservationdetail

import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import com.nexters.boolti.presentation.screen.MainDestination
import com.nexters.boolti.presentation.screen.LocalNavController
import com.nexters.boolti.presentation.screen.navigation.MainRoute

fun NavGraphBuilder.ReservationDetailScreen(
navigateTo: (String) -> Unit,
popBackStack: () -> Unit,
) {
composable(
route = MainDestination.ReservationDetail.route,
arguments = MainDestination.ReservationDetail.arguments,
) {
fun NavGraphBuilder.reservationDetailScreen() {
composable<MainRoute.ReservationDetail> {
val navController = LocalNavController.current
ReservationDetailScreen(
onBackPressed = popBackStack,
onBackPressed = navController::popBackStack,
navigateToRefund = { id, isGift ->
navigateTo(MainDestination.Refund.createRoute(id = id, isGift = isGift))
navController.navigate(MainRoute.Refund(reservationId = id, isGift = isGift))
},
)
}
Expand Down
Loading

0 comments on commit 8c09242

Please sign in to comment.