-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat/#6] 1주차 심화과제 (Compose) #8
base: develop-compose
Are you sure you want to change the base?
Changes from all commits
df5df9f
7ef7566
d83ff7a
087e159
afa41ce
f064a3c
3183684
ee5dafb
50e533e
98e009d
28fc376
886c440
bd25f09
7007cc4
66e0eba
d6f7892
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
plugins { | ||
id 'com.android.application' | ||
id 'org.jetbrains.kotlin.android' | ||
id 'com.google.devtools.ksp' | ||
id 'dagger.hilt.android.plugin' | ||
} | ||
|
||
android { | ||
|
@@ -50,24 +52,36 @@ dependencies { | |
implementation 'androidx.core:core-ktx:1.12.0' | ||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' | ||
implementation 'androidx.activity:activity-compose:1.8.2' | ||
|
||
// Compose BOM | ||
implementation platform('androidx.compose:compose-bom:2024.03.00') | ||
implementation 'androidx.compose.ui:ui' | ||
implementation 'androidx.compose.ui:ui-graphics' | ||
implementation 'androidx.compose.ui:ui-tooling-preview' | ||
implementation 'androidx.compose.material3:material3' | ||
implementation 'androidx.compose.ui:ui-graphics-android:1.6.8' | ||
implementation 'androidx.compose.ui:ui-test-android:1.6.8' | ||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.5' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' | ||
androidTestImplementation platform('androidx.compose:compose-bom:2024.03.00') | ||
androidTestImplementation 'androidx.compose.ui:ui-test-junit4' | ||
|
||
// Debugging and Testing | ||
debugImplementation 'androidx.compose.ui:ui-tooling' | ||
androidTestImplementation 'androidx.compose.ui:ui-test-junit4' | ||
debugImplementation 'androidx.compose.ui:ui-test-manifest' | ||
androidTestImplementation platform('androidx.compose:compose-bom:2024.03.00') | ||
|
||
// Navigation | ||
implementation 'androidx.navigation:navigation-compose:2.7.7' | ||
|
||
// Serialization | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") | ||
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0' | ||
|
||
// Hilt (Dependency Injection) | ||
implementation 'com.google.dagger:hilt-android:2.49' | ||
ksp 'com.google.dagger:hilt-compiler:2.49' | ||
implementation 'androidx.hilt:hilt-navigation-compose:1.2.0' | ||
|
||
// Testing | ||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.5' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' | ||
Comment on lines
+80
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. c: 위에도 테스팅 범주가 있고 아래도 있네요? |
||
|
||
implementation 'androidx.core:core-ktx:1.12.0' | ||
implementation 'androidx.appcompat:appcompat:1.6.1' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.sopt.now.compose | ||
|
||
import android.app.Application | ||
import android.content.Context | ||
import androidx.appcompat.app.AppCompatDelegate | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
@HiltAndroidApp | ||
class NOWSoptApp : Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
appContext = applicationContext | ||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) | ||
} | ||
|
||
companion object { | ||
lateinit var appContext: Context | ||
private set | ||
} | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,26 @@ | ||
package com.sopt.now.compose.presentation.ui.auth.navigation | ||
|
||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavType | ||
import androidx.navigation.compose.composable | ||
import androidx.navigation.navArgument | ||
import com.sopt.now.compose.presentation.ui.auth.screen.AuthViewModel | ||
import com.sopt.now.compose.presentation.ui.auth.screen.SignInRoute | ||
import com.sopt.now.compose.presentation.ui.auth.screen.SignUpRoute | ||
import com.sopt.now.compose.presentation.ui.home.navigation.HomeNavigator | ||
import com.sopt.now.compose.presentation.ui.home.screen.HomeRoute | ||
|
||
fun NavGraphBuilder.authNavGraph( | ||
authNavigator: AuthNavigator, | ||
homeNavigator: HomeNavigator | ||
authViewModel: AuthViewModel | ||
) { | ||
composable( | ||
route = "signIn/{id}/{password}/{nickname}/{phoneNumber}", | ||
arguments = listOf( | ||
navArgument("id") { type = NavType.StringType }, | ||
navArgument("password") { type = NavType.StringType }, | ||
navArgument("nickname") { type = NavType.StringType }, | ||
navArgument("phoneNumber") { type = NavType.StringType } | ||
composable(route = "signIn") { | ||
SignInRoute( | ||
authNavigator = authNavigator, | ||
authViewModel = authViewModel | ||
) | ||
) { backStackEntry -> | ||
val id = backStackEntry.arguments?.getString("id") ?: "" | ||
val password = backStackEntry.arguments?.getString("password") ?: "" | ||
val nickname = backStackEntry.arguments?.getString("nickname") ?: "" | ||
val phoneNumber = backStackEntry.arguments?.getString("phoneNumber") ?: "" | ||
SignInRoute(authNavigator, id, password, nickname, phoneNumber) | ||
} | ||
|
||
composable(route = "signUp") { | ||
SignUpRoute(authNavigator) | ||
} | ||
|
||
composable( | ||
route = "home/{id}/{password}/{nickname}/{phoneNumber}", | ||
arguments = listOf( | ||
navArgument("id") { type = NavType.StringType }, | ||
navArgument("password") { type = NavType.StringType }, | ||
navArgument("nickname") { type = NavType.StringType }, | ||
navArgument("phoneNumber") { type = NavType.StringType } | ||
SignUpRoute( | ||
authNavigator = authNavigator, | ||
authViewModel = authViewModel | ||
) | ||
) { backStackEntry -> | ||
val id = backStackEntry.arguments?.getString("id") ?: "" | ||
val password = backStackEntry.arguments?.getString("password") ?: "" | ||
val nickname = backStackEntry.arguments?.getString("nickname") ?: "" | ||
val phoneNumber = backStackEntry.arguments?.getString("phoneNumber") ?: "" | ||
HomeRoute(homeNavigator, id, password, nickname, phoneNumber) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,15 @@ import androidx.navigation.NavController | |
class AuthNavigator( | ||
private val navController: NavController | ||
) { | ||
fun navigateToSignIn(id: String, password: String, nickname: String, phoneNumber: String) { | ||
navController.navigate("signIn/$id/$password/$nickname/$phoneNumber") | ||
fun navigateToSignIn() { | ||
navController.navigate("signIn") | ||
} | ||
|
||
fun navigateToSignUp() { | ||
navController.navigate("signUp") | ||
} | ||
|
||
fun navigateToHome(id: String, password: String, nickname: String, phoneNumber: String) { | ||
fun navigateToHome(id: String?, password: String?, nickname: String?, phoneNumber: String?) { | ||
navController.navigate("home/$id/$password/$nickname/$phoneNumber") | ||
} | ||
Comment on lines
+16
to
18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. c: data class를 활용한 네비게이션의 활용도 배워보시면 좋을듯! |
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c: 이제 버전 카탈로그의 사용도 고민해보시면 좋을듯?