From fa6a19daf1ec4c7df41f89318a255705fd069698 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 16:57:47 +0900 Subject: [PATCH 01/19] [FIX/#180] SplashScreen -> SplashRoute --- .../splash/{SplashScreen.kt => SplashRoute.kt} | 16 +++++++++++----- .../feature/onboarding/splash/SplashState.kt | 2 +- .../splash/navigation/SplashNavigation.kt | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) rename feature/src/main/java/com/terning/feature/onboarding/splash/{SplashScreen.kt => SplashRoute.kt} (93%) diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashRoute.kt similarity index 93% rename from feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt rename to feature/src/main/java/com/terning/feature/onboarding/splash/SplashRoute.kt index 7d66dfeac..7a71c3f5a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashScreen.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashRoute.kt @@ -21,12 +21,12 @@ import com.terning.feature.onboarding.signin.navigation.navigateSignIn import com.terning.feature.onboarding.splash.navigation.Splash @Composable -fun SplashScreen( +fun SplashRoute( navController: NavController, viewModel: SplashViewModel = hiltViewModel(), - modifier: Modifier = Modifier ) { val systemUiController = rememberSystemUiController() + SideEffect { systemUiController.setStatusBarColor( color = TerningMain @@ -46,10 +46,10 @@ fun SplashScreen( viewModel.sideEffects.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle) .collect { sideEffect -> when (sideEffect) { - is SplashState.GetHasAccessToken -> { + is SplashState.GetAccessToken -> { if (sideEffect.hasAccessToken) navController.navigateHome( navOptions = NavOptions.Builder().setPopUpTo( - route = Splash, + route = Splash, inclusive = true ).build() ) @@ -65,6 +65,13 @@ fun SplashScreen( } + SplashScreen() +} + +@Composable +fun SplashScreen( + modifier: Modifier = Modifier, +) { Column( modifier = modifier .fillMaxSize() @@ -75,5 +82,4 @@ fun SplashScreen( modifier = Modifier.fillMaxSize() ) } - } diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt index 1ace71e67..ca91227dd 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt @@ -1,5 +1,5 @@ package com.terning.feature.onboarding.splash sealed class SplashState { - data class GetHasAccessToken(val hasAccessToken: Boolean) : SplashState() + data class GetAccessToken(val hasAccessToken: Boolean) : SplashState() } diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/navigation/SplashNavigation.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/navigation/SplashNavigation.kt index a24d639f5..515e94a2e 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/navigation/SplashNavigation.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/navigation/SplashNavigation.kt @@ -8,7 +8,7 @@ import androidx.navigation.NavHostController import androidx.navigation.NavOptions import androidx.navigation.compose.composable import com.terning.core.navigation.Route -import com.terning.feature.onboarding.splash.SplashScreen +import com.terning.feature.onboarding.splash.SplashRoute import kotlinx.serialization.Serializable fun NavController.navigateSplash(navOptions: NavOptions? = null) { @@ -35,7 +35,7 @@ fun NavGraphBuilder.splashNavGraph( EnterTransition.None } ) { - SplashScreen( + SplashRoute( navController = navHostController, ) } From a966a62389690fb0ebd83111839d9bdf72cae239 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 17:00:12 +0900 Subject: [PATCH 02/19] [FIX/#180] SplashScreen -> SplashRoute --- .../java/com/terning/feature/onboarding/splash/SplashRoute.kt | 3 +-- .../java/com/terning/feature/onboarding/splash/SplashState.kt | 2 +- .../com/terning/feature/onboarding/splash/SplashViewModel.kt | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashRoute.kt index 7a71c3f5a..e57e57f4a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashRoute.kt @@ -46,7 +46,7 @@ fun SplashRoute( viewModel.sideEffects.flowWithLifecycle(lifecycle = lifecycleOwner.lifecycle) .collect { sideEffect -> when (sideEffect) { - is SplashState.GetAccessToken -> { + is SplashState.HasAccessToken -> { if (sideEffect.hasAccessToken) navController.navigateHome( navOptions = NavOptions.Builder().setPopUpTo( route = Splash, @@ -62,7 +62,6 @@ fun SplashRoute( } } } - } SplashScreen() diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt index ca91227dd..a86d6a33a 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashState.kt @@ -1,5 +1,5 @@ package com.terning.feature.onboarding.splash sealed class SplashState { - data class GetAccessToken(val hasAccessToken: Boolean) : SplashState() + data class HasAccessToken(val hasAccessToken: Boolean) : SplashState() } diff --git a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashViewModel.kt index c58795db3..37c9db467 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/splash/SplashViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/splash/SplashViewModel.kt @@ -20,12 +20,12 @@ class SplashViewModel @Inject constructor( private val _sideEffects = MutableSharedFlow() val sideEffects: SharedFlow get() = _sideEffects.asSharedFlow() - private fun getHasAccessToken(): Boolean = tokenRepository.getAccessToken().isNotBlank() + private fun getAccessToken(): Boolean = tokenRepository.getAccessToken().isNotBlank() fun showSplash(lifecycleOwner: LifecycleOwner) { lifecycleOwner.lifecycleScope.launch { delay(DELAY_TIME) - _sideEffects.emit(SplashState.GetHasAccessToken(getHasAccessToken())) + _sideEffects.emit(SplashState.HasAccessToken(getAccessToken())) } } From ea433032e2689b7587f162dc62f8f69f60d532ec Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 18:39:19 +0900 Subject: [PATCH 03/19] =?UTF-8?q?[FIX/#180]=20AUTH=20Mapper=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../terning/data/dto/request/SignInRequestDto.kt | 6 +----- .../terning/data/dto/request/SignUpRequestDto.kt | 10 +--------- .../terning/data/dto/response/SignInResponseDto.kt | 11 +---------- .../terning/data/dto/response/SignUpResponseDto.kt | 10 +--------- .../data/mapper/auth/SignInRequestMapper.kt | 7 +++++++ .../data/mapper/auth/SignInResponseMapper.kt | 13 +++++++++++++ .../data/mapper/auth/SignUpRequestMapper.kt | 11 +++++++++++ .../data/mapper/auth/SignUpResponseMapper.kt | 12 ++++++++++++ .../data/repositoryimpl/AuthRepositoryImpl.kt | 14 ++++++++------ .../entity/{request => auth}/SignInRequestModel.kt | 2 +- .../{response => auth}/SignInResponseModel.kt | 2 +- .../entity/{request => auth}/SignUpRequestModel.kt | 2 +- .../{response => auth}/SignUpResponseModel.kt | 2 +- .../terning/domain/repository/AuthRepository.kt | 8 ++++---- .../feature/onboarding/signin/SignInViewModel.kt | 2 +- .../feature/onboarding/signup/SignUpViewModel.kt | 2 +- 16 files changed, 65 insertions(+), 49 deletions(-) create mode 100644 data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt create mode 100644 data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt create mode 100644 data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt create mode 100644 data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt rename domain/src/main/java/com/terning/domain/entity/{request => auth}/SignInRequestModel.kt (58%) rename domain/src/main/java/com/terning/domain/entity/{response => auth}/SignInResponseModel.kt (79%) rename domain/src/main/java/com/terning/domain/entity/{request => auth}/SignUpRequestModel.kt (72%) rename domain/src/main/java/com/terning/domain/entity/{response => auth}/SignUpResponseModel.kt (76%) diff --git a/data/src/main/java/com/terning/data/dto/request/SignInRequestDto.kt b/data/src/main/java/com/terning/data/dto/request/SignInRequestDto.kt index f87431913..98123268c 100644 --- a/data/src/main/java/com/terning/data/dto/request/SignInRequestDto.kt +++ b/data/src/main/java/com/terning/data/dto/request/SignInRequestDto.kt @@ -1,6 +1,5 @@ package com.terning.data.dto.request -import com.terning.domain.entity.request.SignInRequestModel import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -8,7 +7,4 @@ import kotlinx.serialization.Serializable data class SignInRequestDto( @SerialName("authType") val authType: String -) - -fun SignInRequestModel.toSignInRequestDto(): SignInRequestDto = - SignInRequestDto(authType = authType) \ No newline at end of file +) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/dto/request/SignUpRequestDto.kt b/data/src/main/java/com/terning/data/dto/request/SignUpRequestDto.kt index dc8cea494..fbfc3d0bf 100644 --- a/data/src/main/java/com/terning/data/dto/request/SignUpRequestDto.kt +++ b/data/src/main/java/com/terning/data/dto/request/SignUpRequestDto.kt @@ -1,6 +1,5 @@ package com.terning.data.dto.request -import com.terning.domain.entity.request.SignUpRequestModel import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -12,11 +11,4 @@ data class SignUpRequestDto( val profileImage: Int, @SerialName("authType") val authType: String -) - -fun SignUpRequestModel.toSignUpRequestDto(): SignUpRequestDto = - SignUpRequestDto( - name = name, - profileImage = profileImage, - authType = authType - ) \ No newline at end of file +) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/dto/response/SignInResponseDto.kt b/data/src/main/java/com/terning/data/dto/response/SignInResponseDto.kt index 6bb151547..f68e837bd 100644 --- a/data/src/main/java/com/terning/data/dto/response/SignInResponseDto.kt +++ b/data/src/main/java/com/terning/data/dto/response/SignInResponseDto.kt @@ -1,6 +1,5 @@ package com.terning.data.dto.response -import com.terning.domain.entity.response.SignInResponseModel import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -16,12 +15,4 @@ data class SignInResponseDto( val authId: String, @SerialName("authType") val authType: String, -) { - fun toSignInModel() = SignInResponseModel( - accessToken = accessToken, - refreshToken = refreshToken, - userId = userId, - authId = authId, - authType = authType - ) -} \ No newline at end of file +) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/dto/response/SignUpResponseDto.kt b/data/src/main/java/com/terning/data/dto/response/SignUpResponseDto.kt index 7f9f2b1d4..579049fdd 100644 --- a/data/src/main/java/com/terning/data/dto/response/SignUpResponseDto.kt +++ b/data/src/main/java/com/terning/data/dto/response/SignUpResponseDto.kt @@ -1,6 +1,5 @@ package com.terning.data.dto.response -import com.terning.domain.entity.response.SignUpResponseModel import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -14,11 +13,4 @@ data class SignUpResponseDto( val userId: Long, @SerialName("authType") val authType: String, -) { - fun toSignUpModel() = SignUpResponseModel( - accessToken = accessToken, - refreshToken = refreshToken, - userId = userId, - authType = authType - ) -} \ No newline at end of file +) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt b/data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt new file mode 100644 index 000000000..a468feec4 --- /dev/null +++ b/data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt @@ -0,0 +1,7 @@ +package com.terning.data.mapper.auth + +import com.terning.data.dto.request.SignInRequestDto +import com.terning.domain.entity.auth.SignInRequestModel + +fun SignInRequestModel.toSignInRequestDto(): SignInRequestDto = + SignInRequestDto(authType = authType) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt b/data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt new file mode 100644 index 000000000..85c46b25d --- /dev/null +++ b/data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt @@ -0,0 +1,13 @@ +package com.terning.data.mapper.auth + +import com.terning.data.dto.response.SignInResponseDto +import com.terning.domain.entity.auth.SignInResponseModel + +fun SignInResponseDto.toSignInModel(): SignInResponseModel = + SignInResponseModel( + accessToken = accessToken, + refreshToken = refreshToken, + userId = userId, + authId = authId, + authType = authType + ) diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt b/data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt new file mode 100644 index 000000000..84c9c23cf --- /dev/null +++ b/data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt @@ -0,0 +1,11 @@ +package com.terning.data.mapper.auth + +import com.terning.data.dto.request.SignUpRequestDto +import com.terning.domain.entity.auth.SignUpRequestModel + +fun SignUpRequestModel.toSignUpRequestDto(): SignUpRequestDto = + SignUpRequestDto( + name = name, + profileImage = profileImage, + authType = authType + ) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt b/data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt new file mode 100644 index 000000000..cdbff04d8 --- /dev/null +++ b/data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt @@ -0,0 +1,12 @@ +package com.terning.data.mapper.auth + +import com.terning.data.dto.response.SignUpResponseDto +import com.terning.domain.entity.auth.SignUpResponseModel + +fun SignUpResponseDto.toSignUpModel(): SignUpResponseModel = + SignUpResponseModel( + accessToken = accessToken, + refreshToken = refreshToken, + userId = userId, + authType = authType + ) diff --git a/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt index 531d3c3d2..76079a4ab 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt @@ -1,12 +1,14 @@ package com.terning.data.repositoryimpl import com.terning.data.datasource.AuthDataSource -import com.terning.data.dto.request.toSignInRequestDto -import com.terning.data.dto.request.toSignUpRequestDto -import com.terning.domain.entity.request.SignInRequestModel -import com.terning.domain.entity.request.SignUpRequestModel -import com.terning.domain.entity.response.SignInResponseModel -import com.terning.domain.entity.response.SignUpResponseModel +import com.terning.data.mapper.auth.toSignInModel +import com.terning.data.mapper.auth.toSignInRequestDto +import com.terning.data.mapper.auth.toSignUpModel +import com.terning.data.mapper.auth.toSignUpRequestDto +import com.terning.domain.entity.auth.SignInRequestModel +import com.terning.domain.entity.auth.SignInResponseModel +import com.terning.domain.entity.auth.SignUpRequestModel +import com.terning.domain.entity.auth.SignUpResponseModel import com.terning.domain.repository.AuthRepository import javax.inject.Inject diff --git a/domain/src/main/java/com/terning/domain/entity/request/SignInRequestModel.kt b/domain/src/main/java/com/terning/domain/entity/auth/SignInRequestModel.kt similarity index 58% rename from domain/src/main/java/com/terning/domain/entity/request/SignInRequestModel.kt rename to domain/src/main/java/com/terning/domain/entity/auth/SignInRequestModel.kt index c51066a71..a56bdad6b 100644 --- a/domain/src/main/java/com/terning/domain/entity/request/SignInRequestModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/auth/SignInRequestModel.kt @@ -1,4 +1,4 @@ -package com.terning.domain.entity.request +package com.terning.domain.entity.auth data class SignInRequestModel( val authType: String diff --git a/domain/src/main/java/com/terning/domain/entity/response/SignInResponseModel.kt b/domain/src/main/java/com/terning/domain/entity/auth/SignInResponseModel.kt similarity index 79% rename from domain/src/main/java/com/terning/domain/entity/response/SignInResponseModel.kt rename to domain/src/main/java/com/terning/domain/entity/auth/SignInResponseModel.kt index 9c9c87752..5e715d8d2 100644 --- a/domain/src/main/java/com/terning/domain/entity/response/SignInResponseModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/auth/SignInResponseModel.kt @@ -1,4 +1,4 @@ -package com.terning.domain.entity.response +package com.terning.domain.entity.auth data class SignInResponseModel( val accessToken: String?, diff --git a/domain/src/main/java/com/terning/domain/entity/request/SignUpRequestModel.kt b/domain/src/main/java/com/terning/domain/entity/auth/SignUpRequestModel.kt similarity index 72% rename from domain/src/main/java/com/terning/domain/entity/request/SignUpRequestModel.kt rename to domain/src/main/java/com/terning/domain/entity/auth/SignUpRequestModel.kt index 98a902afd..193bb7962 100644 --- a/domain/src/main/java/com/terning/domain/entity/request/SignUpRequestModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/auth/SignUpRequestModel.kt @@ -1,4 +1,4 @@ -package com.terning.domain.entity.request +package com.terning.domain.entity.auth data class SignUpRequestModel ( val name : String, diff --git a/domain/src/main/java/com/terning/domain/entity/response/SignUpResponseModel.kt b/domain/src/main/java/com/terning/domain/entity/auth/SignUpResponseModel.kt similarity index 76% rename from domain/src/main/java/com/terning/domain/entity/response/SignUpResponseModel.kt rename to domain/src/main/java/com/terning/domain/entity/auth/SignUpResponseModel.kt index 9966c62fc..bde9c1617 100644 --- a/domain/src/main/java/com/terning/domain/entity/response/SignUpResponseModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/auth/SignUpResponseModel.kt @@ -1,4 +1,4 @@ -package com.terning.domain.entity.response +package com.terning.domain.entity.auth data class SignUpResponseModel( val accessToken: String, diff --git a/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt b/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt index e26254562..754508870 100644 --- a/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt @@ -1,9 +1,9 @@ package com.terning.domain.repository -import com.terning.domain.entity.request.SignInRequestModel -import com.terning.domain.entity.request.SignUpRequestModel -import com.terning.domain.entity.response.SignInResponseModel -import com.terning.domain.entity.response.SignUpResponseModel +import com.terning.domain.entity.auth.SignInRequestModel +import com.terning.domain.entity.auth.SignUpRequestModel +import com.terning.domain.entity.auth.SignInResponseModel +import com.terning.domain.entity.auth.SignUpResponseModel interface AuthRepository { diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt index 95172e193..1d0e67a10 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt @@ -7,7 +7,7 @@ import com.kakao.sdk.auth.model.OAuthToken import com.kakao.sdk.common.model.ClientError import com.kakao.sdk.common.model.ClientErrorCause import com.kakao.sdk.user.UserApiClient -import com.terning.domain.entity.request.SignInRequestModel +import com.terning.domain.entity.auth.SignInRequestModel import com.terning.domain.repository.AuthRepository import com.terning.domain.repository.TokenRepository import com.terning.feature.R diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt index dc8c4b37a..369104575 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt @@ -6,7 +6,7 @@ import com.terning.core.designsystem.theme.Grey400 import com.terning.core.designsystem.theme.Grey500 import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.WarningRed -import com.terning.domain.entity.request.SignUpRequestModel +import com.terning.domain.entity.auth.SignUpRequestModel import com.terning.domain.repository.AuthRepository import com.terning.domain.repository.TokenRepository import com.terning.feature.R From 8861bb917e16bcf405584a345bce726c92725eb1 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 18:52:06 +0900 Subject: [PATCH 04/19] =?UTF-8?q?[FIX/#180]=20AUTH=20=ED=95=A8=EC=88=98?= =?UTF-8?q?=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/mapper/auth/SignInRequestMapper.kt | 4 ++-- .../data/mapper/auth/SignInResponseMapper.kt | 6 ++--- .../data/mapper/auth/SignUpRequestMapper.kt | 4 ++-- .../data/mapper/auth/SignUpResponseMapper.kt | 6 ++--- .../data/repositoryimpl/AuthRepositoryImpl.kt | 24 +++++++++---------- ...SignInRequestModel.kt => SignInRequest.kt} | 2 +- ...gnInResponseModel.kt => SignInResponse.kt} | 2 +- ...SignUpRequestModel.kt => SignUpRequest.kt} | 2 +- ...gnUpResponseModel.kt => SignUpResponse.kt} | 2 +- .../domain/repository/AuthRepository.kt | 16 ++++++------- .../onboarding/signin/SignInViewModel.kt | 4 ++-- .../onboarding/signup/SignUpViewModel.kt | 4 ++-- 12 files changed, 38 insertions(+), 38 deletions(-) rename domain/src/main/java/com/terning/domain/entity/auth/{SignInRequestModel.kt => SignInRequest.kt} (68%) rename domain/src/main/java/com/terning/domain/entity/auth/{SignInResponseModel.kt => SignInResponse.kt} (84%) rename domain/src/main/java/com/terning/domain/entity/auth/{SignUpRequestModel.kt => SignUpRequest.kt} (78%) rename domain/src/main/java/com/terning/domain/entity/auth/{SignUpResponseModel.kt => SignUpResponse.kt} (82%) diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt b/data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt index a468feec4..35e56142e 100644 --- a/data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt @@ -1,7 +1,7 @@ package com.terning.data.mapper.auth import com.terning.data.dto.request.SignInRequestDto -import com.terning.domain.entity.auth.SignInRequestModel +import com.terning.domain.entity.auth.SignInRequest -fun SignInRequestModel.toSignInRequestDto(): SignInRequestDto = +fun SignInRequest.toSignInRequestDto(): SignInRequestDto = SignInRequestDto(authType = authType) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt b/data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt index 85c46b25d..f3f50d0df 100644 --- a/data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt @@ -1,10 +1,10 @@ package com.terning.data.mapper.auth import com.terning.data.dto.response.SignInResponseDto -import com.terning.domain.entity.auth.SignInResponseModel +import com.terning.domain.entity.auth.SignInResponse -fun SignInResponseDto.toSignInModel(): SignInResponseModel = - SignInResponseModel( +fun SignInResponseDto.toSignInResponse(): SignInResponse = + SignInResponse( accessToken = accessToken, refreshToken = refreshToken, userId = userId, diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt b/data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt index 84c9c23cf..b8387b828 100644 --- a/data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt @@ -1,9 +1,9 @@ package com.terning.data.mapper.auth import com.terning.data.dto.request.SignUpRequestDto -import com.terning.domain.entity.auth.SignUpRequestModel +import com.terning.domain.entity.auth.SignUpRequest -fun SignUpRequestModel.toSignUpRequestDto(): SignUpRequestDto = +fun SignUpRequest.toSignUpRequestDto(): SignUpRequestDto = SignUpRequestDto( name = name, profileImage = profileImage, diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt b/data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt index cdbff04d8..f2613b55d 100644 --- a/data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt @@ -1,10 +1,10 @@ package com.terning.data.mapper.auth import com.terning.data.dto.response.SignUpResponseDto -import com.terning.domain.entity.auth.SignUpResponseModel +import com.terning.domain.entity.auth.SignUpResponse -fun SignUpResponseDto.toSignUpModel(): SignUpResponseModel = - SignUpResponseModel( +fun SignUpResponseDto.toSignUpResponse(): SignUpResponse = + SignUpResponse( accessToken = accessToken, refreshToken = refreshToken, userId = userId, diff --git a/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt index 76079a4ab..ad6991354 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt @@ -1,14 +1,14 @@ package com.terning.data.repositoryimpl import com.terning.data.datasource.AuthDataSource -import com.terning.data.mapper.auth.toSignInModel import com.terning.data.mapper.auth.toSignInRequestDto -import com.terning.data.mapper.auth.toSignUpModel +import com.terning.data.mapper.auth.toSignInResponse import com.terning.data.mapper.auth.toSignUpRequestDto -import com.terning.domain.entity.auth.SignInRequestModel -import com.terning.domain.entity.auth.SignInResponseModel -import com.terning.domain.entity.auth.SignUpRequestModel -import com.terning.domain.entity.auth.SignUpResponseModel +import com.terning.data.mapper.auth.toSignUpResponse +import com.terning.domain.entity.auth.SignInRequest +import com.terning.domain.entity.auth.SignInResponse +import com.terning.domain.entity.auth.SignUpRequest +import com.terning.domain.entity.auth.SignUpResponse import com.terning.domain.repository.AuthRepository import javax.inject.Inject @@ -18,21 +18,21 @@ class AuthRepositoryImpl @Inject constructor( override suspend fun postSignIn( authorization: String, - request: SignInRequestModel - ): Result = runCatching { + request: SignInRequest + ): Result = runCatching { authDataSource.postSignIn( authorization, request.toSignInRequestDto() - ).result.toSignInModel() + ).result.toSignInResponse() } override suspend fun postSignUp( authId: String, - request: SignUpRequestModel - ): Result = runCatching { + request: SignUpRequest + ): Result = runCatching { authDataSource.postSignUp( authId, request.toSignUpRequestDto() - ).result.toSignUpModel() + ).result.toSignUpResponse() } } \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/entity/auth/SignInRequestModel.kt b/domain/src/main/java/com/terning/domain/entity/auth/SignInRequest.kt similarity index 68% rename from domain/src/main/java/com/terning/domain/entity/auth/SignInRequestModel.kt rename to domain/src/main/java/com/terning/domain/entity/auth/SignInRequest.kt index a56bdad6b..6ca451043 100644 --- a/domain/src/main/java/com/terning/domain/entity/auth/SignInRequestModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/auth/SignInRequest.kt @@ -1,5 +1,5 @@ package com.terning.domain.entity.auth -data class SignInRequestModel( +data class SignInRequest( val authType: String ) \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/entity/auth/SignInResponseModel.kt b/domain/src/main/java/com/terning/domain/entity/auth/SignInResponse.kt similarity index 84% rename from domain/src/main/java/com/terning/domain/entity/auth/SignInResponseModel.kt rename to domain/src/main/java/com/terning/domain/entity/auth/SignInResponse.kt index 5e715d8d2..e53afffe2 100644 --- a/domain/src/main/java/com/terning/domain/entity/auth/SignInResponseModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/auth/SignInResponse.kt @@ -1,6 +1,6 @@ package com.terning.domain.entity.auth -data class SignInResponseModel( +data class SignInResponse( val accessToken: String?, val refreshToken: String?, val userId: Long?, diff --git a/domain/src/main/java/com/terning/domain/entity/auth/SignUpRequestModel.kt b/domain/src/main/java/com/terning/domain/entity/auth/SignUpRequest.kt similarity index 78% rename from domain/src/main/java/com/terning/domain/entity/auth/SignUpRequestModel.kt rename to domain/src/main/java/com/terning/domain/entity/auth/SignUpRequest.kt index 193bb7962..f8d91e62a 100644 --- a/domain/src/main/java/com/terning/domain/entity/auth/SignUpRequestModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/auth/SignUpRequest.kt @@ -1,6 +1,6 @@ package com.terning.domain.entity.auth -data class SignUpRequestModel ( +data class SignUpRequest ( val name : String, val profileImage : Int, val authType : String diff --git a/domain/src/main/java/com/terning/domain/entity/auth/SignUpResponseModel.kt b/domain/src/main/java/com/terning/domain/entity/auth/SignUpResponse.kt similarity index 82% rename from domain/src/main/java/com/terning/domain/entity/auth/SignUpResponseModel.kt rename to domain/src/main/java/com/terning/domain/entity/auth/SignUpResponse.kt index bde9c1617..84cac1f2a 100644 --- a/domain/src/main/java/com/terning/domain/entity/auth/SignUpResponseModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/auth/SignUpResponse.kt @@ -1,6 +1,6 @@ package com.terning.domain.entity.auth -data class SignUpResponseModel( +data class SignUpResponse( val accessToken: String, val refreshToken: String, val userId: Long, diff --git a/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt b/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt index 754508870..8ba8f5b41 100644 --- a/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt @@ -1,20 +1,20 @@ package com.terning.domain.repository -import com.terning.domain.entity.auth.SignInRequestModel -import com.terning.domain.entity.auth.SignUpRequestModel -import com.terning.domain.entity.auth.SignInResponseModel -import com.terning.domain.entity.auth.SignUpResponseModel +import com.terning.domain.entity.auth.SignInRequest +import com.terning.domain.entity.auth.SignUpRequest +import com.terning.domain.entity.auth.SignInResponse +import com.terning.domain.entity.auth.SignUpResponse interface AuthRepository { suspend fun postSignIn( authorization: String, - request: SignInRequestModel - ): Result + request: SignInRequest + ): Result suspend fun postSignUp( authId: String, - request: SignUpRequestModel - ): Result + request: SignUpRequest + ): Result } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt index 1d0e67a10..4ef6cd91d 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt @@ -7,7 +7,7 @@ import com.kakao.sdk.auth.model.OAuthToken import com.kakao.sdk.common.model.ClientError import com.kakao.sdk.common.model.ClientErrorCause import com.kakao.sdk.user.UserApiClient -import com.terning.domain.entity.auth.SignInRequestModel +import com.terning.domain.entity.auth.SignInRequest import com.terning.domain.repository.AuthRepository import com.terning.domain.repository.TokenRepository import com.terning.feature.R @@ -80,7 +80,7 @@ class SignInViewModel @Inject constructor( ) { authRepository.postSignIn( accessToken, - SignInRequestModel(authType = authType) + SignInRequest(authType = authType) ).onSuccess { response -> when { response.accessToken == null -> _signInSideEffects.emit( diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt index 369104575..923f498ad 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt @@ -6,7 +6,7 @@ import com.terning.core.designsystem.theme.Grey400 import com.terning.core.designsystem.theme.Grey500 import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.WarningRed -import com.terning.domain.entity.auth.SignUpRequestModel +import com.terning.domain.entity.auth.SignUpRequest import com.terning.domain.repository.AuthRepository import com.terning.domain.repository.TokenRepository import com.terning.feature.R @@ -93,7 +93,7 @@ class SignUpViewModel @Inject constructor( authRepository.postSignUp( state.value.authId, state.value.run { - SignUpRequestModel( + SignUpRequest( name = name, profileImage = character, authType = KAKA0 From 4d090e1c4b283581ad74d402b3fa9406291c552f Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 18:59:05 +0900 Subject: [PATCH 05/19] =?UTF-8?q?[FIX/#180]=20=ED=86=A0=ED=81=B0=20?= =?UTF-8?q?=EC=9E=AC=EB=B0=9C=EA=B8=89=20=ED=8C=8C=EC=9D=BC=20=EB=A6=AC?= =?UTF-8?q?=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/data/datasource/TokenReissueDataSource.kt | 1 - .../terning/data/dto/response/TokenReissueResponseDto.kt | 5 +---- .../com/terning/data/mapper/auth/TokenReissueMapper.kt | 7 +++++++ .../data/repositoryimpl/TokenReissueRepositoryImpl.kt | 7 ++++--- .../java/com/terning/domain/entity/auth/TokenReissue.kt | 5 +++++ .../domain/entity/response/TokenReissueResponseModel.kt | 5 ----- .../terning/domain/repository/TokenReissueRepository.kt | 4 ++-- 7 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 data/src/main/java/com/terning/data/mapper/auth/TokenReissueMapper.kt create mode 100644 domain/src/main/java/com/terning/domain/entity/auth/TokenReissue.kt delete mode 100644 domain/src/main/java/com/terning/domain/entity/response/TokenReissueResponseModel.kt diff --git a/data/src/main/java/com/terning/data/datasource/TokenReissueDataSource.kt b/data/src/main/java/com/terning/data/datasource/TokenReissueDataSource.kt index 746b11752..76a9aeded 100644 --- a/data/src/main/java/com/terning/data/datasource/TokenReissueDataSource.kt +++ b/data/src/main/java/com/terning/data/datasource/TokenReissueDataSource.kt @@ -2,7 +2,6 @@ package com.terning.data.datasource import com.terning.data.dto.BaseResponse import com.terning.data.dto.response.TokenReissueResponseDto -import com.terning.domain.entity.response.TokenReissueResponseModel interface TokenReissueDataSource { suspend fun postReissueToken( diff --git a/data/src/main/java/com/terning/data/dto/response/TokenReissueResponseDto.kt b/data/src/main/java/com/terning/data/dto/response/TokenReissueResponseDto.kt index 85d9de8f5..56647b905 100644 --- a/data/src/main/java/com/terning/data/dto/response/TokenReissueResponseDto.kt +++ b/data/src/main/java/com/terning/data/dto/response/TokenReissueResponseDto.kt @@ -1,6 +1,5 @@ package com.terning.data.dto.response -import com.terning.domain.entity.response.TokenReissueResponseModel import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -8,6 +7,4 @@ import kotlinx.serialization.Serializable data class TokenReissueResponseDto( @SerialName("refreshToken") val refreshToken: String -) { - fun toTokenReissueResponseModel() = TokenReissueResponseModel(refreshToken = refreshToken) -} \ No newline at end of file +) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/auth/TokenReissueMapper.kt b/data/src/main/java/com/terning/data/mapper/auth/TokenReissueMapper.kt new file mode 100644 index 000000000..90e2e964f --- /dev/null +++ b/data/src/main/java/com/terning/data/mapper/auth/TokenReissueMapper.kt @@ -0,0 +1,7 @@ +package com.terning.data.mapper.auth + +import com.terning.data.dto.response.TokenReissueResponseDto +import com.terning.domain.entity.auth.TokenReissue + +fun TokenReissueResponseDto.toTokenReissue(): TokenReissue = + TokenReissue(refreshToken = refreshToken) diff --git a/data/src/main/java/com/terning/data/repositoryimpl/TokenReissueRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/TokenReissueRepositoryImpl.kt index 3867ffb9e..0a944674a 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/TokenReissueRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/TokenReissueRepositoryImpl.kt @@ -1,7 +1,8 @@ package com.terning.data.repositoryimpl import com.terning.data.datasource.TokenReissueDataSource -import com.terning.domain.entity.response.TokenReissueResponseModel +import com.terning.data.mapper.auth.toTokenReissue +import com.terning.domain.entity.auth.TokenReissue import com.terning.domain.repository.TokenReissueRepository import javax.inject.Inject @@ -10,10 +11,10 @@ class TokenReissueRepositoryImpl @Inject constructor( ) : TokenReissueRepository { override suspend fun postReissueToken( authorization: String - ): Result = + ): Result = runCatching { tokenReissueDataSource.postReissueToken( authorization = authorization - ).result.toTokenReissueResponseModel() + ).result.toTokenReissue() } } \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/entity/auth/TokenReissue.kt b/domain/src/main/java/com/terning/domain/entity/auth/TokenReissue.kt new file mode 100644 index 000000000..9841acf59 --- /dev/null +++ b/domain/src/main/java/com/terning/domain/entity/auth/TokenReissue.kt @@ -0,0 +1,5 @@ +package com.terning.domain.entity.auth + +data class TokenReissue ( + val refreshToken : String +) \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/entity/response/TokenReissueResponseModel.kt b/domain/src/main/java/com/terning/domain/entity/response/TokenReissueResponseModel.kt deleted file mode 100644 index b4d09c7e9..000000000 --- a/domain/src/main/java/com/terning/domain/entity/response/TokenReissueResponseModel.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.terning.domain.entity.response - -data class TokenReissueResponseModel ( - val refreshToken : String -) \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/repository/TokenReissueRepository.kt b/domain/src/main/java/com/terning/domain/repository/TokenReissueRepository.kt index ea302936c..0bc98010c 100644 --- a/domain/src/main/java/com/terning/domain/repository/TokenReissueRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/TokenReissueRepository.kt @@ -1,9 +1,9 @@ package com.terning.domain.repository -import com.terning.domain.entity.response.TokenReissueResponseModel +import com.terning.domain.entity.auth.TokenReissue interface TokenReissueRepository { suspend fun postReissueToken( authorization: String, - ): Result + ): Result } \ No newline at end of file From 4f14370dd5a1bc59721df1943df532c7f7d60bd5 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 19:49:58 +0900 Subject: [PATCH 06/19] =?UTF-8?q?[FIX/#180]=20FilteringOne=20=ED=83=91?= =?UTF-8?q?=EB=B0=94=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filtering/filtering/FilteringOneScreen.kt | 36 ++++++++++++------- ...igation.kt => FilteringThreeNavigation.kt} | 0 .../startfiltering/StartFilteringScreen.kt | 21 +++++++++-- .../feature/onboarding/signup/SignUpRoute.kt | 2 +- 4 files changed, 43 insertions(+), 16 deletions(-) rename feature/src/main/java/com/terning/feature/filtering/filtering/navigation/{ThreeNavigation.kt => FilteringThreeNavigation.kt} (100%) diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt index 6a5b4cf85..e911c07b3 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringOneScreen.kt @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -14,16 +13,20 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.navigation.NavController import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.Grey300 +import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.filtering.filtering.component.StatusOneRadioGroup import com.terning.feature.filtering.filtering.navigation.navigateFilteringTwo +import com.terning.feature.main.MainNavigator +import com.terning.feature.main.rememberMainNavigator @Composable fun FilteringOneScreen( @@ -36,18 +39,14 @@ fun FilteringOneScreen( var grade by remember { mutableIntStateOf(-1) } - Scaffold( - modifier = modifier, - topBar = { - BackButtonTopAppBar( - onBackButtonClick = { navController.navigateUp() } - ) - } - ) { paddingValues -> + Column( + modifier = modifier + ) { + BackButtonTopAppBar( + onBackButtonClick = { navController.navigateUp() } + ) Column( - modifier = Modifier - .fillMaxSize() - .padding(paddingValues) + modifier = Modifier.fillMaxSize() ) { TerningImage( painter = R.drawable.ic_filtering_status1, @@ -107,3 +106,16 @@ fun FilteringOneScreen( } } } + +@Preview(showBackground = true) +@Composable +fun FilteringOneScreenPreview() { + val navigator: MainNavigator = rememberMainNavigator() + TerningPointTheme { + FilteringOneScreen( + name = "터닝이", + navController = navigator.navController, + onButtonClick = {} + ) + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/ThreeNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringThreeNavigation.kt similarity index 100% rename from feature/src/main/java/com/terning/feature/filtering/filtering/navigation/ThreeNavigation.kt rename to feature/src/main/java/com/terning/feature/filtering/filtering/navigation/FilteringThreeNavigation.kt diff --git a/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt b/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt index 0844fe32e..85b7faeda 100644 --- a/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt @@ -6,7 +6,6 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -47,7 +46,7 @@ fun StartFilteringScreen( val screenHeight = 780f / configuration.screenHeightDp LaunchedEffect(key1 = true) { - delay(1000) + delay(DELAY) isVisible = true } @@ -68,7 +67,9 @@ fun StartFilteringScreen( Image( painter = painterResource(id = R.drawable.ic_terning_onboarding), contentDescription = stringResource(id = R.string.start_filtering_main_image), - modifier = Modifier.fillMaxWidth().padding(horizontal = 24.dp) + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 24.dp) ) Spacer(modifier = Modifier.weight(2f)) } @@ -91,3 +92,17 @@ fun StartFilteringScreen( } } } + +private const val DELAY: Long = 1000 + +@Preview(showBackground = true) +@Composable +fun StartFilteringScreenPreview() { + val navController = rememberNavController() + TerningPointTheme { + StartFilteringScreen( + name = "터닝이", + navController = navController + ) + } +} diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt index fe5fb8984..9586c4eee 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpRoute.kt @@ -153,4 +153,4 @@ fun SignUpScreen( isEnabled = signUpState.isButtonValid ) } -} +} \ No newline at end of file From 5c28aacb1ed8215f80a07dff029222876e09db24 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 20:06:55 +0900 Subject: [PATCH 07/19] =?UTF-8?q?[FIX/#180]=20FilteringTwo,=20Three=20?= =?UTF-8?q?=ED=83=91=EB=B0=94=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20=ED=94=84?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filtering/FilteringThreeScreen.kt | 34 ++++++++++++------ .../filtering/filtering/FilteringTwoScreen.kt | 36 ++++++++++++------- 2 files changed, 46 insertions(+), 24 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt index 116d67782..75806f7a5 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringThreeScreen.kt @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -15,6 +14,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.LocalLifecycleOwner @@ -25,10 +25,13 @@ import com.terning.core.designsystem.component.datepicker.DatePickerUI import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.Grey300 +import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.toast import com.terning.feature.R import com.terning.feature.filtering.starthome.navigation.navigateStartHome +import com.terning.feature.main.MainNavigator +import com.terning.feature.main.rememberMainNavigator import java.util.Calendar @Composable @@ -69,18 +72,14 @@ fun FilteringThreeScreen( } } - Scaffold( + Column( modifier = modifier, - topBar = { - BackButtonTopAppBar( - onBackButtonClick = { navController.navigateUp() } - ) - } - ) { paddingValues -> + ) { + BackButtonTopAppBar( + onBackButtonClick = { navController.navigateUp() } + ) Column( - modifier = Modifier - .fillMaxSize() - .padding(paddingValues) + modifier = Modifier.fillMaxSize() ) { TerningImage( painter = R.drawable.ic_filtering_status3, @@ -125,3 +124,16 @@ fun FilteringThreeScreen( } } } + +@Preview(showBackground = true) +@Composable +fun FilteringThreeScreenPreview() { + val navigator: MainNavigator = rememberMainNavigator() + TerningPointTheme { + FilteringThreeScreen( + grade = 1, + workingPeriod = 1, + navController = navigator.navController + ) + } +} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt index 92d865285..ad56eef53 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringTwoScreen.kt @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -14,16 +13,20 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.navigation.NavController import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.component.image.TerningImage import com.terning.core.designsystem.component.topappbar.BackButtonTopAppBar import com.terning.core.designsystem.theme.Grey300 +import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.filtering.filtering.component.StatusTwoRadioGroup import com.terning.feature.filtering.filtering.navigation.navigateFilteringThree +import com.terning.feature.main.MainNavigator +import com.terning.feature.main.rememberMainNavigator @Composable fun FilteringTwoScreen( @@ -32,23 +35,18 @@ fun FilteringTwoScreen( modifier: Modifier = Modifier, onButtonClick: (Int) -> Unit = {}, ) { - val isButtonValid = remember { mutableStateOf(false) } var workingPeriod by remember { mutableIntStateOf(-1) } - Scaffold( - modifier = modifier, - topBar = { - BackButtonTopAppBar( - onBackButtonClick = { navController.navigateUp() } - ) - } - ) { paddingValues -> + Column( + modifier = modifier + ) { + BackButtonTopAppBar( + onBackButtonClick = { navController.navigateUp() } + ) Column( - modifier = Modifier - .fillMaxSize() - .padding(paddingValues) + modifier = Modifier.fillMaxSize() ) { TerningImage( painter = R.drawable.ic_filtering_status2, @@ -94,3 +92,15 @@ fun FilteringTwoScreen( } } } + +@Preview(showBackground = true) +@Composable +fun FilteringTwoScreenPreview() { + val navigator: MainNavigator = rememberMainNavigator() + TerningPointTheme { + FilteringTwoScreen( + grade = 1, + navController = navigator.navController + ) + } +} \ No newline at end of file From e1e9690a015410ae1ddc2aca73775acd99aef4d6 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 20:18:03 +0900 Subject: [PATCH 08/19] =?UTF-8?q?[FIX/#180]=20Filtering=20=ED=8C=A8?= =?UTF-8?q?=ED=82=A4=EC=A7=95=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../terning/data/dto/request/FilteringRequestDto.kt | 11 +---------- .../terning/data/mapper/filtering/FilteringMapper.kt | 12 ++++++++++++ .../data/repositoryimpl/FilteringRepositoryImpl.kt | 6 +++--- .../Filtering.kt} | 4 ++-- .../terning/domain/repository/FilteringRepository.kt | 4 ++-- .../filtering/filtering/FilteringViewModel.kt | 4 ++-- 6 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 data/src/main/java/com/terning/data/mapper/filtering/FilteringMapper.kt rename domain/src/main/java/com/terning/domain/entity/{request/FilteringRequestModel.kt => filtering/Filtering.kt} (56%) diff --git a/data/src/main/java/com/terning/data/dto/request/FilteringRequestDto.kt b/data/src/main/java/com/terning/data/dto/request/FilteringRequestDto.kt index 61606ef98..df9012860 100644 --- a/data/src/main/java/com/terning/data/dto/request/FilteringRequestDto.kt +++ b/data/src/main/java/com/terning/data/dto/request/FilteringRequestDto.kt @@ -1,6 +1,5 @@ package com.terning.data.dto.request -import com.terning.domain.entity.request.FilteringRequestModel import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -14,12 +13,4 @@ data class FilteringRequestDto( val startYear: Int, @SerialName("startMonth") val startMonth: Int -) - -fun FilteringRequestModel.toFilteringRequestDto(): FilteringRequestDto = - FilteringRequestDto( - grade = grade, - workingPeriod = workingPeriod, - startYear = startYear, - startMonth = startMonth - ) \ No newline at end of file +) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/filtering/FilteringMapper.kt b/data/src/main/java/com/terning/data/mapper/filtering/FilteringMapper.kt new file mode 100644 index 000000000..ec1d829a7 --- /dev/null +++ b/data/src/main/java/com/terning/data/mapper/filtering/FilteringMapper.kt @@ -0,0 +1,12 @@ +package com.terning.data.mapper.filtering + +import com.terning.data.dto.request.FilteringRequestDto +import com.terning.domain.entity.filtering.Filtering + +fun Filtering.toFilteringRequestDto(): FilteringRequestDto = + FilteringRequestDto( + grade = grade, + workingPeriod = workingPeriod, + startYear = startYear, + startMonth = startMonth + ) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/repositoryimpl/FilteringRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/FilteringRepositoryImpl.kt index e98de70e3..cbcfea14b 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/FilteringRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/FilteringRepositoryImpl.kt @@ -1,8 +1,8 @@ package com.terning.data.repositoryimpl import com.terning.data.datasource.FilteringDataSource -import com.terning.data.dto.request.toFilteringRequestDto -import com.terning.domain.entity.request.FilteringRequestModel +import com.terning.data.mapper.filtering.toFilteringRequestDto +import com.terning.domain.entity.filtering.Filtering import com.terning.domain.repository.FilteringRepository import javax.inject.Inject @@ -11,7 +11,7 @@ class FilteringRepositoryImpl @Inject constructor( ) : FilteringRepository { override suspend fun postFiltering( userId: Long, - request: FilteringRequestModel + request: Filtering ): Result = runCatching { filteringDataSource.postFiltering( diff --git a/domain/src/main/java/com/terning/domain/entity/request/FilteringRequestModel.kt b/domain/src/main/java/com/terning/domain/entity/filtering/Filtering.kt similarity index 56% rename from domain/src/main/java/com/terning/domain/entity/request/FilteringRequestModel.kt rename to domain/src/main/java/com/terning/domain/entity/filtering/Filtering.kt index fd6205dbc..c1db28c06 100644 --- a/domain/src/main/java/com/terning/domain/entity/request/FilteringRequestModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/filtering/Filtering.kt @@ -1,6 +1,6 @@ -package com.terning.domain.entity.request +package com.terning.domain.entity.filtering -data class FilteringRequestModel( +data class Filtering( val grade: Int, val workingPeriod: Int, val startYear: Int, diff --git a/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt b/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt index 5828acf3c..ba2031fab 100644 --- a/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/FilteringRepository.kt @@ -1,10 +1,10 @@ package com.terning.domain.repository -import com.terning.domain.entity.request.FilteringRequestModel +import com.terning.domain.entity.filtering.Filtering interface FilteringRepository { suspend fun postFiltering( userId: Long, - request: FilteringRequestModel + request: Filtering ): Result } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt index ebea0abe6..692117fab 100644 --- a/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt +++ b/feature/src/main/java/com/terning/feature/filtering/filtering/FilteringViewModel.kt @@ -2,7 +2,7 @@ package com.terning.feature.filtering.filtering import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.terning.domain.entity.request.FilteringRequestModel +import com.terning.domain.entity.filtering.Filtering import com.terning.domain.repository.FilteringRepository import com.terning.domain.repository.TokenRepository import com.terning.feature.R @@ -49,7 +49,7 @@ class FilteringViewModel @Inject constructor( filteringRepository.postFiltering( tokenRepository.getUserId(), state.value.run { - FilteringRequestModel( + Filtering( grade = grade, workingPeriod = workingPeriod, startYear = startYear, From 2417df1568e8c82431aa4fce5afd8e95f4d56e3c Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 20:20:39 +0900 Subject: [PATCH 09/19] =?UTF-8?q?[FIX/#180]=20auth=20->=20onboarding=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=9D=B4=EB=A6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{auth => onboarding}/SignInRequestMapper.kt | 4 ++-- .../{auth => onboarding}/SignInResponseMapper.kt | 4 ++-- .../{auth => onboarding}/SignUpRequestMapper.kt | 4 ++-- .../{auth => onboarding}/SignUpResponseMapper.kt | 4 ++-- .../data/repositoryimpl/AuthRepositoryImpl.kt | 16 ++++++++-------- .../entity/{auth => onboarding}/SignInRequest.kt | 2 +- .../{auth => onboarding}/SignInResponse.kt | 2 +- .../entity/{auth => onboarding}/SignUpRequest.kt | 2 +- .../{auth => onboarding}/SignUpResponse.kt | 2 +- .../terning/domain/repository/AuthRepository.kt | 8 ++++---- .../feature/onboarding/signin/SignInViewModel.kt | 2 +- .../feature/onboarding/signup/SignUpViewModel.kt | 2 +- 12 files changed, 26 insertions(+), 26 deletions(-) rename data/src/main/java/com/terning/data/mapper/{auth => onboarding}/SignInRequestMapper.kt (60%) rename data/src/main/java/com/terning/data/mapper/{auth => onboarding}/SignInResponseMapper.kt (74%) rename data/src/main/java/com/terning/data/mapper/{auth => onboarding}/SignUpRequestMapper.kt (69%) rename data/src/main/java/com/terning/data/mapper/{auth => onboarding}/SignUpResponseMapper.kt (72%) rename domain/src/main/java/com/terning/domain/entity/{auth => onboarding}/SignInRequest.kt (54%) rename domain/src/main/java/com/terning/domain/entity/{auth => onboarding}/SignInResponse.kt (78%) rename domain/src/main/java/com/terning/domain/entity/{auth => onboarding}/SignUpRequest.kt (70%) rename domain/src/main/java/com/terning/domain/entity/{auth => onboarding}/SignUpResponse.kt (75%) diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt b/data/src/main/java/com/terning/data/mapper/onboarding/SignInRequestMapper.kt similarity index 60% rename from data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt rename to data/src/main/java/com/terning/data/mapper/onboarding/SignInRequestMapper.kt index 35e56142e..670baae76 100644 --- a/data/src/main/java/com/terning/data/mapper/auth/SignInRequestMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/onboarding/SignInRequestMapper.kt @@ -1,7 +1,7 @@ -package com.terning.data.mapper.auth +package com.terning.data.mapper.onboarding import com.terning.data.dto.request.SignInRequestDto -import com.terning.domain.entity.auth.SignInRequest +import com.terning.domain.entity.onboarding.SignInRequest fun SignInRequest.toSignInRequestDto(): SignInRequestDto = SignInRequestDto(authType = authType) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt b/data/src/main/java/com/terning/data/mapper/onboarding/SignInResponseMapper.kt similarity index 74% rename from data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt rename to data/src/main/java/com/terning/data/mapper/onboarding/SignInResponseMapper.kt index f3f50d0df..e5f2cd258 100644 --- a/data/src/main/java/com/terning/data/mapper/auth/SignInResponseMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/onboarding/SignInResponseMapper.kt @@ -1,7 +1,7 @@ -package com.terning.data.mapper.auth +package com.terning.data.mapper.onboarding import com.terning.data.dto.response.SignInResponseDto -import com.terning.domain.entity.auth.SignInResponse +import com.terning.domain.entity.onboarding.SignInResponse fun SignInResponseDto.toSignInResponse(): SignInResponse = SignInResponse( diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt b/data/src/main/java/com/terning/data/mapper/onboarding/SignUpRequestMapper.kt similarity index 69% rename from data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt rename to data/src/main/java/com/terning/data/mapper/onboarding/SignUpRequestMapper.kt index b8387b828..68ed36d8d 100644 --- a/data/src/main/java/com/terning/data/mapper/auth/SignUpRequestMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/onboarding/SignUpRequestMapper.kt @@ -1,7 +1,7 @@ -package com.terning.data.mapper.auth +package com.terning.data.mapper.onboarding import com.terning.data.dto.request.SignUpRequestDto -import com.terning.domain.entity.auth.SignUpRequest +import com.terning.domain.entity.onboarding.SignUpRequest fun SignUpRequest.toSignUpRequestDto(): SignUpRequestDto = SignUpRequestDto( diff --git a/data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt b/data/src/main/java/com/terning/data/mapper/onboarding/SignUpResponseMapper.kt similarity index 72% rename from data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt rename to data/src/main/java/com/terning/data/mapper/onboarding/SignUpResponseMapper.kt index f2613b55d..adf8a7186 100644 --- a/data/src/main/java/com/terning/data/mapper/auth/SignUpResponseMapper.kt +++ b/data/src/main/java/com/terning/data/mapper/onboarding/SignUpResponseMapper.kt @@ -1,7 +1,7 @@ -package com.terning.data.mapper.auth +package com.terning.data.mapper.onboarding import com.terning.data.dto.response.SignUpResponseDto -import com.terning.domain.entity.auth.SignUpResponse +import com.terning.domain.entity.onboarding.SignUpResponse fun SignUpResponseDto.toSignUpResponse(): SignUpResponse = SignUpResponse( diff --git a/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt index ad6991354..4cb0ef47a 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/AuthRepositoryImpl.kt @@ -1,14 +1,14 @@ package com.terning.data.repositoryimpl import com.terning.data.datasource.AuthDataSource -import com.terning.data.mapper.auth.toSignInRequestDto -import com.terning.data.mapper.auth.toSignInResponse -import com.terning.data.mapper.auth.toSignUpRequestDto -import com.terning.data.mapper.auth.toSignUpResponse -import com.terning.domain.entity.auth.SignInRequest -import com.terning.domain.entity.auth.SignInResponse -import com.terning.domain.entity.auth.SignUpRequest -import com.terning.domain.entity.auth.SignUpResponse +import com.terning.data.mapper.onboarding.toSignInRequestDto +import com.terning.data.mapper.onboarding.toSignInResponse +import com.terning.data.mapper.onboarding.toSignUpRequestDto +import com.terning.data.mapper.onboarding.toSignUpResponse +import com.terning.domain.entity.onboarding.SignInRequest +import com.terning.domain.entity.onboarding.SignInResponse +import com.terning.domain.entity.onboarding.SignUpRequest +import com.terning.domain.entity.onboarding.SignUpResponse import com.terning.domain.repository.AuthRepository import javax.inject.Inject diff --git a/domain/src/main/java/com/terning/domain/entity/auth/SignInRequest.kt b/domain/src/main/java/com/terning/domain/entity/onboarding/SignInRequest.kt similarity index 54% rename from domain/src/main/java/com/terning/domain/entity/auth/SignInRequest.kt rename to domain/src/main/java/com/terning/domain/entity/onboarding/SignInRequest.kt index 6ca451043..63bd3e13f 100644 --- a/domain/src/main/java/com/terning/domain/entity/auth/SignInRequest.kt +++ b/domain/src/main/java/com/terning/domain/entity/onboarding/SignInRequest.kt @@ -1,4 +1,4 @@ -package com.terning.domain.entity.auth +package com.terning.domain.entity.onboarding data class SignInRequest( val authType: String diff --git a/domain/src/main/java/com/terning/domain/entity/auth/SignInResponse.kt b/domain/src/main/java/com/terning/domain/entity/onboarding/SignInResponse.kt similarity index 78% rename from domain/src/main/java/com/terning/domain/entity/auth/SignInResponse.kt rename to domain/src/main/java/com/terning/domain/entity/onboarding/SignInResponse.kt index e53afffe2..247bbf3e9 100644 --- a/domain/src/main/java/com/terning/domain/entity/auth/SignInResponse.kt +++ b/domain/src/main/java/com/terning/domain/entity/onboarding/SignInResponse.kt @@ -1,4 +1,4 @@ -package com.terning.domain.entity.auth +package com.terning.domain.entity.onboarding data class SignInResponse( val accessToken: String?, diff --git a/domain/src/main/java/com/terning/domain/entity/auth/SignUpRequest.kt b/domain/src/main/java/com/terning/domain/entity/onboarding/SignUpRequest.kt similarity index 70% rename from domain/src/main/java/com/terning/domain/entity/auth/SignUpRequest.kt rename to domain/src/main/java/com/terning/domain/entity/onboarding/SignUpRequest.kt index f8d91e62a..7b24e160e 100644 --- a/domain/src/main/java/com/terning/domain/entity/auth/SignUpRequest.kt +++ b/domain/src/main/java/com/terning/domain/entity/onboarding/SignUpRequest.kt @@ -1,4 +1,4 @@ -package com.terning.domain.entity.auth +package com.terning.domain.entity.onboarding data class SignUpRequest ( val name : String, diff --git a/domain/src/main/java/com/terning/domain/entity/auth/SignUpResponse.kt b/domain/src/main/java/com/terning/domain/entity/onboarding/SignUpResponse.kt similarity index 75% rename from domain/src/main/java/com/terning/domain/entity/auth/SignUpResponse.kt rename to domain/src/main/java/com/terning/domain/entity/onboarding/SignUpResponse.kt index 84cac1f2a..d349a00b8 100644 --- a/domain/src/main/java/com/terning/domain/entity/auth/SignUpResponse.kt +++ b/domain/src/main/java/com/terning/domain/entity/onboarding/SignUpResponse.kt @@ -1,4 +1,4 @@ -package com.terning.domain.entity.auth +package com.terning.domain.entity.onboarding data class SignUpResponse( val accessToken: String, diff --git a/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt b/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt index 8ba8f5b41..0193f7698 100644 --- a/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/AuthRepository.kt @@ -1,9 +1,9 @@ package com.terning.domain.repository -import com.terning.domain.entity.auth.SignInRequest -import com.terning.domain.entity.auth.SignUpRequest -import com.terning.domain.entity.auth.SignInResponse -import com.terning.domain.entity.auth.SignUpResponse +import com.terning.domain.entity.onboarding.SignInRequest +import com.terning.domain.entity.onboarding.SignUpRequest +import com.terning.domain.entity.onboarding.SignInResponse +import com.terning.domain.entity.onboarding.SignUpResponse interface AuthRepository { diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt index 4ef6cd91d..822a0f5f7 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInViewModel.kt @@ -7,7 +7,7 @@ import com.kakao.sdk.auth.model.OAuthToken import com.kakao.sdk.common.model.ClientError import com.kakao.sdk.common.model.ClientErrorCause import com.kakao.sdk.user.UserApiClient -import com.terning.domain.entity.auth.SignInRequest +import com.terning.domain.entity.onboarding.SignInRequest import com.terning.domain.repository.AuthRepository import com.terning.domain.repository.TokenRepository import com.terning.feature.R diff --git a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt index 923f498ad..52f46f86f 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signup/SignUpViewModel.kt @@ -6,7 +6,7 @@ import com.terning.core.designsystem.theme.Grey400 import com.terning.core.designsystem.theme.Grey500 import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.WarningRed -import com.terning.domain.entity.auth.SignUpRequest +import com.terning.domain.entity.onboarding.SignUpRequest import com.terning.domain.repository.AuthRepository import com.terning.domain.repository.TokenRepository import com.terning.feature.R From 3a0dfbb26823cec0bc007710d098a17bcdc31b28 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 20:23:48 +0900 Subject: [PATCH 10/19] =?UTF-8?q?[FIX/#180]=20startHome=20=ED=94=84?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filtering/starthome/StartHomeScreen.kt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt b/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt index 8b7a9560b..8debcd235 100644 --- a/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/starthome/StartHomeScreen.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.navigation.NavController import androidx.navigation.NavOptions @@ -31,9 +32,12 @@ import com.airbnb.lottie.compose.LottieCompositionSpec import com.airbnb.lottie.compose.LottieConstants import com.airbnb.lottie.compose.rememberLottieComposition import com.terning.core.designsystem.component.button.RectangleButton +import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R import com.terning.feature.home.home.navigation.navigateHome +import com.terning.feature.main.MainNavigator +import com.terning.feature.main.rememberMainNavigator import com.terning.feature.onboarding.signin.navigation.SignIn import kotlinx.coroutines.delay @@ -48,7 +52,7 @@ fun StartHomeScreen( val screenHeight = 780f / configuration.screenHeightDp LaunchedEffect(key1 = true) { - delay(1000) + delay(DELAY) isVisible = true } @@ -96,6 +100,8 @@ fun StartHomeScreen( } } +private const val DELAY : Long = 1000 + @Composable fun StartHomeLottieAnimation( modifier: Modifier = Modifier @@ -115,3 +121,11 @@ fun StartHomeLottieAnimation( iterations = LottieConstants.IterateForever ) } + +@Preview(showBackground = true) +@Composable +fun StartHomeScreenPreview() { + TerningPointTheme { + StartHomeScreen() + } +} \ No newline at end of file From 8d81cd214478153b1f7fbd05de4dcf3412771648 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 20:31:04 +0900 Subject: [PATCH 11/19] =?UTF-8?q?[FIX/#180]=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20UI=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/mypage/MyPageRoute.kt | 124 +++++++++--------- 1 file changed, 59 insertions(+), 65 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt index 96b8e5e75..834b30198 100644 --- a/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt @@ -120,79 +120,74 @@ fun MyPageRoute( fun MyPageScreen( onLogoutClick: () -> Unit, onQuitClick: () -> Unit, + modifier : Modifier = Modifier, name: String = "", authType: String = "", onNoticeClick: () -> Unit, onOpinionClick: () -> Unit ) { - Scaffold( - modifier = Modifier - ) { paddingValues -> - Box( - modifier = Modifier - .fillMaxSize() - .padding(top = paddingValues.calculateTopPadding()), - contentAlignment = Alignment.BottomCenter + Box( + modifier = modifier.fillMaxSize(), + contentAlignment = Alignment.BottomCenter + ) { + Image( + modifier = Modifier.fillMaxSize(), + painter = painterResource(id = R.drawable.ic_terning_mypage), + contentDescription = "" + ) + + Column( + modifier = Modifier.fillMaxSize() ) { - Image( - modifier = Modifier.fillMaxSize(), - painter = painterResource(id = R.drawable.ic_terning_mypage), - contentDescription = "" + Text( + text = stringResource(id = R.string.my_page_name, name), + modifier = Modifier.padding( + top = 21.dp, + start = 24.dp, + ), + style = TerningTheme.typography.heading1, ) - - Column( - modifier = Modifier.fillMaxSize() + Spacer(modifier = Modifier.weight(2f)) + MyPageInfo( + modifier = Modifier + .customShadow( + color = Grey200, + shadowRadius = 30.dp, + shadowWidth = 2.dp + ) + .background( + color = Back, + shape = RoundedCornerShape(topEnd = 30.dp, topStart = 30.dp) + ), + onNoticeClick = { onNoticeClick() }, + onOpinionClick = { onOpinionClick() } + ) + Row( + modifier = Modifier + .fillMaxWidth() + .background(Back) + .padding(bottom = 17.dp), + horizontalArrangement = Arrangement.Center, ) { Text( - text = stringResource(id = R.string.my_page_name, name), - modifier = Modifier.padding( - top = 21.dp, - start = 24.dp, - ), - style = TerningTheme.typography.heading1, + text = stringResource(id = R.string.my_page_logout), + style = TerningTheme.typography.button4, + color = Grey350, + modifier = Modifier.noRippleClickable { + onLogoutClick() + } ) - Spacer(modifier = Modifier.weight(2f)) - MyPageInfo( - modifier = Modifier - .customShadow( - color = Grey200, - shadowRadius = 30.dp, - shadowWidth = 2.dp - ) - .background( - color = Back, - shape = RoundedCornerShape(topEnd = 30.dp, topStart = 30.dp) - ), - onNoticeClick = { onNoticeClick() }, - onOpinionClick = { onOpinionClick() } + Spacer(modifier = Modifier.padding(end = 10.dp)) + TerningImage(painter = R.drawable.ic_my_page_divider) + Spacer(modifier = Modifier.padding(end = 10.dp)) + Text( + text = stringResource(id = R.string.my_page_quit), + style = TerningTheme.typography.button4, + color = Grey350, + modifier = Modifier.noRippleClickable { + onQuitClick() + } ) - Row( - modifier = Modifier - .fillMaxWidth() - .background(Back) - .padding(bottom = 17.dp), - horizontalArrangement = Arrangement.Center, - ) { - Text( - text = stringResource(id = R.string.my_page_logout), - style = TerningTheme.typography.button4, - color = Grey350, - modifier = Modifier.noRippleClickable { - onLogoutClick() - } - ) - Spacer(modifier = Modifier.padding(end = 10.dp)) - TerningImage(painter = R.drawable.ic_my_page_divider) - Spacer(modifier = Modifier.padding(end = 10.dp)) - Text( - text = stringResource(id = R.string.my_page_quit), - style = TerningTheme.typography.button4, - color = Grey350, - modifier = Modifier.noRippleClickable { - onQuitClick() - } - ) - } } } } @@ -250,15 +245,14 @@ fun MyPageInfo( private const val VERSION = "1.0.0" - @Preview(showBackground = true) @Composable -fun MyPageScreenPreview(){ +fun MyPageScreenPreview() { TerningPointTheme { MyPageScreen( onLogoutClick = {}, onQuitClick = {}, - name = "이석준", + name = "터닝이", onNoticeClick = {}, onOpinionClick = {} ) From a7f8d09206e8eda2a70a6b1dd61a6fd581a2c389 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 20:32:59 +0900 Subject: [PATCH 12/19] =?UTF-8?q?[FIX/#180]=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20UI=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/terning/feature/mypage/MyPageRoute.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt index 834b30198..7ead6f20b 100644 --- a/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt @@ -243,8 +243,6 @@ fun MyPageInfo( } } -private const val VERSION = "1.0.0" - @Preview(showBackground = true) @Composable fun MyPageScreenPreview() { @@ -257,4 +255,6 @@ fun MyPageScreenPreview() { onOpinionClick = {} ) } -} \ No newline at end of file +} + +private const val VERSION = "1.0.0" From baa00a871671e4c679608e01dbb2213e870ad69b Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 20:35:33 +0900 Subject: [PATCH 13/19] =?UTF-8?q?[FIX/#180]=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20TerningImage=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/mypage/MyPageRoute.kt | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt b/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt index 7ead6f20b..7bb803ea0 100644 --- a/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MyPageRoute.kt @@ -1,18 +1,15 @@ package com.terning.feature.mypage -import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -22,7 +19,6 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -32,7 +28,6 @@ import androidx.navigation.NavHostController import com.terning.core.designsystem.component.bottomsheet.MyPageLogoutBottomSheet import com.terning.core.designsystem.component.bottomsheet.MyPageQuitBottomSheet import com.terning.core.designsystem.component.image.TerningImage -import com.terning.core.designsystem.component.topappbar.MyPageTopAppBar import com.terning.core.designsystem.theme.Back import com.terning.core.designsystem.theme.Grey200 import com.terning.core.designsystem.theme.Grey350 @@ -120,7 +115,7 @@ fun MyPageRoute( fun MyPageScreen( onLogoutClick: () -> Unit, onQuitClick: () -> Unit, - modifier : Modifier = Modifier, + modifier: Modifier = Modifier, name: String = "", authType: String = "", onNoticeClick: () -> Unit, @@ -130,12 +125,10 @@ fun MyPageScreen( modifier = modifier.fillMaxSize(), contentAlignment = Alignment.BottomCenter ) { - Image( + TerningImage( modifier = Modifier.fillMaxSize(), - painter = painterResource(id = R.drawable.ic_terning_mypage), - contentDescription = "" + painter = R.drawable.ic_terning_mypage, ) - Column( modifier = Modifier.fillMaxSize() ) { @@ -243,18 +236,18 @@ fun MyPageInfo( } } +private const val VERSION = "1.0.0" + @Preview(showBackground = true) @Composable fun MyPageScreenPreview() { TerningPointTheme { MyPageScreen( - onLogoutClick = {}, - onQuitClick = {}, name = "터닝이", onNoticeClick = {}, - onOpinionClick = {} + onOpinionClick = {}, + onLogoutClick = {}, + onQuitClick = {} ) } -} - -private const val VERSION = "1.0.0" +} \ No newline at end of file From b560c33785997fd9c0b3ebcba60f15224c89ba2d Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 20:41:48 +0900 Subject: [PATCH 14/19] =?UTF-8?q?[FIX/#180]=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=ED=8C=A8=ED=82=A4=EC=A7=95=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/terning/data/dto/response/MyPageResponseDto.kt | 5 +---- .../java/com/terning/data/mapper/mypage/MyPageMapper.kt | 6 ++++++ .../com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt | 6 +++--- .../entity/{response => mypage}/MyPageProfileModel.kt | 2 +- .../java/com/terning/domain/repository/MyPageRepository.kt | 2 +- .../main/java/com/terning/feature/mypage/MyPageViewModel.kt | 3 ++- 6 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt rename domain/src/main/java/com/terning/domain/entity/{response => mypage}/MyPageProfileModel.kt (65%) diff --git a/data/src/main/java/com/terning/data/dto/response/MyPageResponseDto.kt b/data/src/main/java/com/terning/data/dto/response/MyPageResponseDto.kt index a43b1d72c..035919f84 100644 --- a/data/src/main/java/com/terning/data/dto/response/MyPageResponseDto.kt +++ b/data/src/main/java/com/terning/data/dto/response/MyPageResponseDto.kt @@ -1,6 +1,5 @@ package com.terning.data.dto.response -import com.terning.domain.entity.response.MyPageProfileModel import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -10,6 +9,4 @@ data class MyPageResponseDto( val name: String, @SerialName("authType") val authType: String -) - -fun MyPageResponseDto.toMyPageProfileModel() = MyPageProfileModel(name = name, authType = authType) +) \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt b/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt new file mode 100644 index 000000000..2ae84fa1b --- /dev/null +++ b/data/src/main/java/com/terning/data/mapper/mypage/MyPageMapper.kt @@ -0,0 +1,6 @@ +package com.terning.data.mapper.mypage + +import com.terning.data.dto.response.MyPageResponseDto +import com.terning.domain.entity.mypage.MyPageProfileModel + +fun MyPageResponseDto.toMyPageProfile() = MyPageProfileModel(name = name, authType = authType) diff --git a/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt index d58702e35..45cafad9b 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/MyPageRepositoryImpl.kt @@ -1,8 +1,8 @@ package com.terning.data.repositoryimpl import com.terning.data.datasource.MyPageDataSource -import com.terning.data.dto.response.toMyPageProfileModel -import com.terning.domain.entity.response.MyPageProfileModel +import com.terning.data.mapper.mypage.toMyPageProfile +import com.terning.domain.entity.mypage.MyPageProfileModel import com.terning.domain.repository.MyPageRepository import javax.inject.Inject @@ -21,6 +21,6 @@ class MyPageRepositoryImpl @Inject constructor( override suspend fun getProfile(): Result = runCatching { - myPageDataSource.getProfile().result.toMyPageProfileModel() + myPageDataSource.getProfile().result.toMyPageProfile() } } \ No newline at end of file diff --git a/domain/src/main/java/com/terning/domain/entity/response/MyPageProfileModel.kt b/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt similarity index 65% rename from domain/src/main/java/com/terning/domain/entity/response/MyPageProfileModel.kt rename to domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt index 18815ba97..9576d68dc 100644 --- a/domain/src/main/java/com/terning/domain/entity/response/MyPageProfileModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/mypage/MyPageProfileModel.kt @@ -1,4 +1,4 @@ -package com.terning.domain.entity.response +package com.terning.domain.entity.mypage data class MyPageProfileModel( val name: String, diff --git a/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt b/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt index 78e1329a9..26eaed11f 100644 --- a/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/MyPageRepository.kt @@ -1,6 +1,6 @@ package com.terning.domain.repository -import com.terning.domain.entity.response.MyPageProfileModel +import com.terning.domain.entity.mypage.MyPageProfileModel interface MyPageRepository { suspend fun postLogout(): Result diff --git a/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt b/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt index 088114328..d5e87497b 100644 --- a/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt +++ b/feature/src/main/java/com/terning/feature/mypage/MyPageViewModel.kt @@ -93,7 +93,8 @@ class MyPageViewModel @Inject constructor( private fun getProfile() { viewModelScope.launch { - myPageRepository.getProfile().onSuccess { response -> + myPageRepository.getProfile() + .onSuccess { response -> _state.value = _state.value.copy( isGetSuccess = UiState.Success(true), name = response.name, From 7a92ebe44973190bc283e0cc9342f33acc6c23fe Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 20:45:34 +0900 Subject: [PATCH 15/19] =?UTF-8?q?[FIX/#180]=20=ED=83=88=ED=87=B4=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=EB=B0=94=ED=85=80=EC=8B=9C=ED=8A=B8=20=EC=B6=95?= =?UTF-8?q?=EC=86=8C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/bottomsheet/MyPageLogoutBottomSheet.kt | 2 +- .../component/bottomsheet/MyPageQuitBottomSheet.kt | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt index 0cccd2206..f052b38b2 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt @@ -81,4 +81,4 @@ fun MyPageLogoutBottomSheet( onDismissRequest = { onDismiss() }, sheetState = sheetState ) -} +} \ No newline at end of file diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt index 1f3d4414e..a90fb5bd0 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt @@ -16,6 +16,7 @@ import com.terning.core.R import com.terning.core.designsystem.component.button.DeleteRoundButton import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.theme.TerningTheme +import kotlinx.coroutines.launch @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -63,7 +64,12 @@ fun MyPageQuitBottomSheet( cornerRadius = 10.dp, text = R.string.my_page_back_button, onButtonClick = { - onDismiss() + scope.launch { sheetState.hide() } + .invokeOnCompletion { + if (!sheetState.isVisible) { + onDismiss() + } + } }, modifier = modifier.padding( start = 24.dp, From 2d44dfc96d2a7ce1f21e64a5c644d1644f21ec29 Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 21:07:00 +0900 Subject: [PATCH 16/19] =?UTF-8?q?[FIX/#180]=20=EB=B0=94=ED=85=80=EC=8B=9C?= =?UTF-8?q?=ED=8A=B8=20=EC=A3=BC=EC=84=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bottomsheet/MyPageLogoutBottomSheet.kt | 9 +++++++++ .../bottomsheet/MyPageQuitBottomSheet.kt | 9 +++++++++ .../component/bottomsheet/SignUpBottomSheet.kt | 15 +++++++++++++++ .../bottomsheet/TerningBasicBottomSheet.kt | 8 +++++++- 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt index f052b38b2..654f804f7 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt @@ -17,6 +17,15 @@ import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.theme.TerningTheme import kotlinx.coroutines.launch +/** + * 로그아웃을 할 수 있는 바텀시트입니다. + * + * 로그아웃 버튼과, 취소 버튼으로 이루어져있습니다. + * + * @param modifier 바텀시트에 적용할 Modifier입니다. + * @param onDismiss 취소 버튼 클릭 시, 바텀시트가 닫히면서 호출되는 함수입니다. + * @param onLogoutClick 로그아웃 버튼 클릭 시, 호출되는 콜백 함수입니다. + */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun MyPageLogoutBottomSheet( diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt index a90fb5bd0..d3db63721 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt @@ -18,6 +18,15 @@ import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.theme.TerningTheme import kotlinx.coroutines.launch +/** + * 회원탈퇴를 할 수 있는 바텀시트입니다. + * + * 회원탈퇴 버튼과, 취소 버튼으로 이루어져있습니다. + * + * @param modifier 바텀시트에 적용할 Modifier입니다. + * @param onDismiss 취소 버튼 클릭 시, 바텀시트가 닫히면서 호출되는 함수입니다. + * @param onQuitClick 회원탈퇴 버튼 클릭 시, 호출되는 콜백 함수입니다. + */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun MyPageQuitBottomSheet( diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt index 8b4b6e27b..db86a1aba 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt @@ -33,6 +33,14 @@ import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.noRippleClickable import kotlinx.coroutines.launch +/** + * 회원가입을 할 때 프로필 이미지를 선택할 수 있는 바텀시트입니다. + * + * @param modifier 바텀시트에 적용할 Modifier입니다. + * @param onDismiss 바텀시트가 닫힐 때 호출되는 콜백 함수입니다. + * @param onSaveClick 저장하기 버튼 클릭 시, 호출되는 콜백 함수입니다. + * @param initialSelectedOption 초기에 선택된 이미지를 나타내는 인덱스 값입니다. + */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun SignUpBottomSheet( @@ -88,6 +96,13 @@ fun SignUpBottomSheet( ) } +/** + * 6개의 프로필 이미지 중, 하나의 이미지만 선택할 수 있는 라디오 버튼입니다. + * + * @param modifier 라디오 버튼에 적용할 Modifier입니다. + * @param onOptionSelected 선택된 이미지의 인덱스 값을 나타내는 콜백 함수입니다. + * @param initialSelectedOption 초기에 선택된 이미지를 나타내는 인덱스 값입니다. + */ @Composable fun RadioButtonGroup( modifier: Modifier = Modifier, diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/TerningBasicBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/TerningBasicBottomSheet.kt index 87e82c6aa..f6c11915f 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/TerningBasicBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/TerningBasicBottomSheet.kt @@ -5,9 +5,15 @@ import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.SheetState import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier import com.terning.core.designsystem.theme.White +/** + * 기본 바텀시트 함수입니다. + * + * @param content 바텀시트에 표시할 내용을 담은 Composable 함수입니다. + * @param onDismissRequest 바텀시트가 닫히는 요청 시 호출되는 콜백 함수입니다. + * @param sheetState 바텀시트의 상태를 관리하는 SheetState 객체입니다. + */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun TerningBasicBottomSheet( From 8cc7979bb1770974731fa5af66dda0409cd3156d Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Sun, 18 Aug 2024 21:08:45 +0900 Subject: [PATCH 17/19] =?UTF-8?q?[FIX/#180]=20=EB=B0=94=ED=85=80=EC=8B=9C?= =?UTF-8?q?=ED=8A=B8=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/bottomsheet/MyPageLogoutBottomSheet.kt | 9 --------- .../component/bottomsheet/MyPageQuitBottomSheet.kt | 9 --------- .../component/bottomsheet/SignUpBottomSheet.kt | 8 -------- .../component/bottomsheet/TerningBasicBottomSheet.kt | 7 ------- 4 files changed, 33 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt index 654f804f7..f052b38b2 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageLogoutBottomSheet.kt @@ -17,15 +17,6 @@ import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.theme.TerningTheme import kotlinx.coroutines.launch -/** - * 로그아웃을 할 수 있는 바텀시트입니다. - * - * 로그아웃 버튼과, 취소 버튼으로 이루어져있습니다. - * - * @param modifier 바텀시트에 적용할 Modifier입니다. - * @param onDismiss 취소 버튼 클릭 시, 바텀시트가 닫히면서 호출되는 함수입니다. - * @param onLogoutClick 로그아웃 버튼 클릭 시, 호출되는 콜백 함수입니다. - */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun MyPageLogoutBottomSheet( diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt index d3db63721..a90fb5bd0 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/MyPageQuitBottomSheet.kt @@ -18,15 +18,6 @@ import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.theme.TerningTheme import kotlinx.coroutines.launch -/** - * 회원탈퇴를 할 수 있는 바텀시트입니다. - * - * 회원탈퇴 버튼과, 취소 버튼으로 이루어져있습니다. - * - * @param modifier 바텀시트에 적용할 Modifier입니다. - * @param onDismiss 취소 버튼 클릭 시, 바텀시트가 닫히면서 호출되는 함수입니다. - * @param onQuitClick 회원탈퇴 버튼 클릭 시, 호출되는 콜백 함수입니다. - */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun MyPageQuitBottomSheet( diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt index db86a1aba..649890818 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/SignUpBottomSheet.kt @@ -33,14 +33,6 @@ import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.noRippleClickable import kotlinx.coroutines.launch -/** - * 회원가입을 할 때 프로필 이미지를 선택할 수 있는 바텀시트입니다. - * - * @param modifier 바텀시트에 적용할 Modifier입니다. - * @param onDismiss 바텀시트가 닫힐 때 호출되는 콜백 함수입니다. - * @param onSaveClick 저장하기 버튼 클릭 시, 호출되는 콜백 함수입니다. - * @param initialSelectedOption 초기에 선택된 이미지를 나타내는 인덱스 값입니다. - */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun SignUpBottomSheet( diff --git a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/TerningBasicBottomSheet.kt b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/TerningBasicBottomSheet.kt index f6c11915f..bdf72842c 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/TerningBasicBottomSheet.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/bottomsheet/TerningBasicBottomSheet.kt @@ -7,13 +7,6 @@ import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import com.terning.core.designsystem.theme.White -/** - * 기본 바텀시트 함수입니다. - * - * @param content 바텀시트에 표시할 내용을 담은 Composable 함수입니다. - * @param onDismissRequest 바텀시트가 닫히는 요청 시 호출되는 콜백 함수입니다. - * @param sheetState 바텀시트의 상태를 관리하는 SheetState 객체입니다. - */ @OptIn(ExperimentalMaterial3Api::class) @Composable fun TerningBasicBottomSheet( From ae37133e2ca2f296460723982ed3884f4aaac5ca Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Mon, 19 Aug 2024 22:40:45 +0900 Subject: [PATCH 18/19] =?UTF-8?q?[FIX/#180]=20StartFiltering=20=ED=94=84?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filtering/startfiltering/StartFilteringScreen.kt | 12 +++--------- .../navigation/StartFilteringNavigation.kt | 8 ++++---- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt b/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt index 85b7faeda..ed323d030 100644 --- a/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt @@ -25,20 +25,16 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import androidx.navigation.NavController -import androidx.navigation.compose.rememberNavController import com.terning.core.designsystem.component.button.RectangleButton import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.designsystem.theme.TerningTheme import com.terning.feature.R -import com.terning.feature.filtering.filtering.navigation.navigateFilteringOne import kotlinx.coroutines.delay @Composable fun StartFilteringScreen( - name: String, modifier: Modifier = Modifier, - navController: NavController + onNextButtonClick: () -> Unit ) { var isVisible by remember { mutableStateOf(false) } @@ -86,7 +82,7 @@ fun StartFilteringScreen( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.start_filtering_button, - onButtonClick = { navController.navigateFilteringOne(name) }, + onButtonClick = { onNextButtonClick() }, ) } } @@ -98,11 +94,9 @@ private const val DELAY: Long = 1000 @Preview(showBackground = true) @Composable fun StartFilteringScreenPreview() { - val navController = rememberNavController() TerningPointTheme { StartFilteringScreen( - name = "터닝이", - navController = navController + onNextButtonClick = {} ) } } diff --git a/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt index 4926c20d8..127e51bb6 100644 --- a/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt +++ b/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt @@ -1,7 +1,5 @@ package com.terning.feature.filtering.startfiltering.navigation -import androidx.compose.animation.EnterTransition -import androidx.compose.animation.ExitTransition import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavHostController @@ -9,6 +7,7 @@ import androidx.navigation.NavOptions import androidx.navigation.compose.composable import androidx.navigation.toRoute import com.terning.core.navigation.Route +import com.terning.feature.filtering.filtering.navigation.navigateFilteringOne import com.terning.feature.filtering.startfiltering.StartFilteringScreen import kotlinx.serialization.Serializable @@ -28,8 +27,9 @@ fun NavGraphBuilder.startFilteringNavGraph( composable { val args = it.toRoute() StartFilteringScreen( - name = args.name, - navController = navHostController, + onNextButtonClick = { + navHostController.navigateFilteringOne(args.name) + } ) } } From 963382cf3c406bb3e8f4b7a43915dc8df361b47d Mon Sep 17 00:00:00 2001 From: LEE YOU BIN Date: Mon, 19 Aug 2024 23:02:58 +0900 Subject: [PATCH 19/19] =?UTF-8?q?[CHORE/#180]=20onNextClick()=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filtering/startfiltering/StartFilteringScreen.kt | 6 +++--- .../startfiltering/navigation/StartFilteringNavigation.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt b/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt index ed323d030..588c639ae 100644 --- a/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt +++ b/feature/src/main/java/com/terning/feature/filtering/startfiltering/StartFilteringScreen.kt @@ -34,7 +34,7 @@ import kotlinx.coroutines.delay @Composable fun StartFilteringScreen( modifier: Modifier = Modifier, - onNextButtonClick: () -> Unit + onNextClick: () -> Unit ) { var isVisible by remember { mutableStateOf(false) } @@ -82,7 +82,7 @@ fun StartFilteringScreen( style = TerningTheme.typography.button0, paddingVertical = 20.dp, text = R.string.start_filtering_button, - onButtonClick = { onNextButtonClick() }, + onButtonClick = { onNextClick() }, ) } } @@ -96,7 +96,7 @@ private const val DELAY: Long = 1000 fun StartFilteringScreenPreview() { TerningPointTheme { StartFilteringScreen( - onNextButtonClick = {} + onNextClick = {} ) } } diff --git a/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt b/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt index 127e51bb6..e70d98afa 100644 --- a/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt +++ b/feature/src/main/java/com/terning/feature/filtering/startfiltering/navigation/StartFilteringNavigation.kt @@ -27,7 +27,7 @@ fun NavGraphBuilder.startFilteringNavGraph( composable { val args = it.toRoute() StartFilteringScreen( - onNextButtonClick = { + onNextClick = { navHostController.navigateFilteringOne(args.name) } )