From 5a8be0eb107ceaacdf346a38e761edf23025e8ec Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 14 Jan 2024 22:20:26 +0900 Subject: [PATCH 01/11] =?UTF-8?q?[FEAT/#105]=20SharedPreference=20userId?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/src/main/java/com/going/data/local/GoingDataStore.kt | 1 + .../src/main/java/com/going/data/local/GoingDataStoreImpl.kt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/data/src/main/java/com/going/data/local/GoingDataStore.kt b/data/src/main/java/com/going/data/local/GoingDataStore.kt index e331b14c..541dc870 100644 --- a/data/src/main/java/com/going/data/local/GoingDataStore.kt +++ b/data/src/main/java/com/going/data/local/GoingDataStore.kt @@ -3,4 +3,5 @@ package com.going.data.local interface GoingDataStore { var accessToken: String var refreshToken: String + var userId: Long } diff --git a/data/src/main/java/com/going/data/local/GoingDataStoreImpl.kt b/data/src/main/java/com/going/data/local/GoingDataStoreImpl.kt index d1de4eb1..2d344ee0 100644 --- a/data/src/main/java/com/going/data/local/GoingDataStoreImpl.kt +++ b/data/src/main/java/com/going/data/local/GoingDataStoreImpl.kt @@ -15,8 +15,13 @@ class GoingDataStoreImpl @Inject constructor( get() = dataStore.getString(REFRESH_TOKEN, "") ?: "" set(value) = dataStore.edit { putString(REFRESH_TOKEN, value) } + override var userId: Long + get() = dataStore.getLong(USER_ID, 0L) + set(value) = dataStore.edit { putLong(USER_ID, value) } + companion object { private const val ACCESS_TOKEN = "ACCESS_TOKEN" private const val REFRESH_TOKEN = "REFRESH_TOKEN" + private const val USER_ID = "USER_ID" } } From 4c5adb12b73ceb85ea26c85c8068aa0afeda4622 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 14 Jan 2024 22:33:22 +0900 Subject: [PATCH 02/11] =?UTF-8?q?[FEAT/#105]=20SignIn=20UserId=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/going/data/dto/response/SignInResponseDto.kt | 4 +++- .../java/com/going/data/repositoryImpl/TokenRepositoryImpl.kt | 4 ++++ .../kotlin/com/going/domain/entity/response/SignInModel.kt | 1 + .../kotlin/com/going/domain/repository/TokenRepository.kt | 2 ++ .../going/presentation/onboarding/signin/SignInViewModel.kt | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/data/src/main/java/com/going/data/dto/response/SignInResponseDto.kt b/data/src/main/java/com/going/data/dto/response/SignInResponseDto.kt index 5909913b..c5b2e57a 100644 --- a/data/src/main/java/com/going/data/dto/response/SignInResponseDto.kt +++ b/data/src/main/java/com/going/data/dto/response/SignInResponseDto.kt @@ -12,7 +12,9 @@ data class SignInResponseDto( val refreshToken: String, @SerialName("isResult") val isResult: Boolean, + @SerialName("userId") + val userId: Long, ) { fun toSignInModel() = - SignInModel(accessToken, refreshToken, isResult) + SignInModel(accessToken, refreshToken, isResult, userId) } diff --git a/data/src/main/java/com/going/data/repositoryImpl/TokenRepositoryImpl.kt b/data/src/main/java/com/going/data/repositoryImpl/TokenRepositoryImpl.kt index ab3efccb..865bff59 100644 --- a/data/src/main/java/com/going/data/repositoryImpl/TokenRepositoryImpl.kt +++ b/data/src/main/java/com/going/data/repositoryImpl/TokenRepositoryImpl.kt @@ -15,6 +15,10 @@ class TokenRepositoryImpl @Inject constructor( goingDataStore.refreshToken = refreshToken } + override fun setUserId(userId: Long) { + goingDataStore.userId = userId + } + override fun clearTokens() { goingDataStore.accessToken = "" goingDataStore.refreshToken = "" diff --git a/domain/src/main/kotlin/com/going/domain/entity/response/SignInModel.kt b/domain/src/main/kotlin/com/going/domain/entity/response/SignInModel.kt index 8953bf94..1b1b5a9d 100644 --- a/domain/src/main/kotlin/com/going/domain/entity/response/SignInModel.kt +++ b/domain/src/main/kotlin/com/going/domain/entity/response/SignInModel.kt @@ -4,4 +4,5 @@ data class SignInModel( val accessToken: String, val refreshToken: String, val isResult: Boolean, + val userId: Long, ) diff --git a/domain/src/main/kotlin/com/going/domain/repository/TokenRepository.kt b/domain/src/main/kotlin/com/going/domain/repository/TokenRepository.kt index 1a069869..d0f8899b 100644 --- a/domain/src/main/kotlin/com/going/domain/repository/TokenRepository.kt +++ b/domain/src/main/kotlin/com/going/domain/repository/TokenRepository.kt @@ -7,5 +7,7 @@ interface TokenRepository { fun setTokens(accessToken: String, refreshToken: String) + fun setUserId(userId: Long) + fun clearTokens() } diff --git a/presentation/src/main/java/com/going/presentation/onboarding/signin/SignInViewModel.kt b/presentation/src/main/java/com/going/presentation/onboarding/signin/SignInViewModel.kt index 6d1d68f6..424d83b5 100644 --- a/presentation/src/main/java/com/going/presentation/onboarding/signin/SignInViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/onboarding/signin/SignInViewModel.kt @@ -75,6 +75,7 @@ class SignInViewModel @Inject constructor( viewModelScope.launch { authRepository.postSignIn(accessToken, SignInRequestModel(platform)).onSuccess { tokenRepository.setTokens(it.accessToken, it.refreshToken) + tokenRepository.setUserId(it.userId) if (it.isResult) { _postChangeTokenState.value = AuthState.SUCCESS From 3cd531489a6f17a243b2238d3b4cf5630905e407 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 14 Jan 2024 22:59:19 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[FEAT/#105]=20SignUp=20UserId=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/going/data/dto/response/AuthResponseDto.kt | 4 +++- .../kotlin/com/going/domain/entity/response/AuthTokenModel.kt | 1 + .../onboarding/signup/OnboardingProfileSettingViewModel.kt | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/data/src/main/java/com/going/data/dto/response/AuthResponseDto.kt b/data/src/main/java/com/going/data/dto/response/AuthResponseDto.kt index 25cc1041..4f535e64 100644 --- a/data/src/main/java/com/going/data/dto/response/AuthResponseDto.kt +++ b/data/src/main/java/com/going/data/dto/response/AuthResponseDto.kt @@ -10,7 +10,9 @@ data class AuthResponseDto( val accessToken: String, @SerialName("refreshToken") val refreshToken: String, + @SerialName("userId") + val userId: Long, ) { fun toAuthTokenModel() = - AuthTokenModel(accessToken = accessToken, refreshToken = refreshToken) + AuthTokenModel(accessToken = accessToken, refreshToken = refreshToken, userId = userId) } diff --git a/domain/src/main/kotlin/com/going/domain/entity/response/AuthTokenModel.kt b/domain/src/main/kotlin/com/going/domain/entity/response/AuthTokenModel.kt index 651139d0..ccbac460 100644 --- a/domain/src/main/kotlin/com/going/domain/entity/response/AuthTokenModel.kt +++ b/domain/src/main/kotlin/com/going/domain/entity/response/AuthTokenModel.kt @@ -3,4 +3,5 @@ package com.going.domain.entity.response data class AuthTokenModel( val accessToken: String, val refreshToken: String, + val userId: Long, ) diff --git a/presentation/src/main/java/com/going/presentation/onboarding/signup/OnboardingProfileSettingViewModel.kt b/presentation/src/main/java/com/going/presentation/onboarding/signup/OnboardingProfileSettingViewModel.kt index dcc4e9d0..184c27fb 100644 --- a/presentation/src/main/java/com/going/presentation/onboarding/signup/OnboardingProfileSettingViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/onboarding/signup/OnboardingProfileSettingViewModel.kt @@ -7,6 +7,7 @@ import com.going.domain.entity.AuthState import com.going.domain.entity.NameState import com.going.domain.entity.request.SignUpRequestModel import com.going.domain.repository.AuthRepository +import com.going.domain.repository.TokenRepository import com.kakao.sdk.auth.AuthApiClient import com.kakao.sdk.auth.TokenManagerProvider import com.kakao.sdk.user.UserApiClient @@ -20,6 +21,7 @@ import javax.inject.Inject @HiltViewModel class OnboardingProfileSettingViewModel @Inject constructor( private val authRepository: AuthRepository, + private val tokenRepository: TokenRepository, ) : ViewModel() { val name = MutableStateFlow("") @@ -88,6 +90,8 @@ class OnboardingProfileSettingViewModel @Inject constructor( kakaoAccessToken, SignUpRequestModel(name.value, info.value, KAKAO), ).onSuccess { + tokenRepository.setTokens(it.accessToken, it.refreshToken) + tokenRepository.setUserId(it.userId) _isSignUpState.value = AuthState.SUCCESS }.onFailure { _isSignUpState.value = AuthState.FAILURE From 082f8d8c437e45a986f6c3cac3a41bcb34cb003d Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 14 Jan 2024 23:19:12 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[CHORE/#105]=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=ED=84=B0=EC=B9=98=EA=B5=AC=EC=97=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/activity_tendency_result.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/presentation/src/main/res/layout/activity_tendency_result.xml b/presentation/src/main/res/layout/activity_tendency_result.xml index f7dac1af..02792358 100644 --- a/presentation/src/main/res/layout/activity_tendency_result.xml +++ b/presentation/src/main/res/layout/activity_tendency_result.xml @@ -35,9 +35,9 @@ android:id="@+id/btn_tendency_result_download" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="33dp" - android:layout_marginEnd="24dp" - android:layout_marginBottom="19dp" + android:layout_marginTop="9dp" + android:padding="24dp" + android:layout_marginBottom="-5dp" android:src="@drawable/ic_download" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" From d99801f4ecccd8de9be830e92bd1994be9e577d2 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Sun, 14 Jan 2024 23:36:03 +0900 Subject: [PATCH 05/11] =?UTF-8?q?[CHORE/#105]=20DashBoard=20setting=20btn?= =?UTF-8?q?=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/DashBoardActivity.kt | 20 ++++++++++++++++--- .../res/layout/activity_trip_dash_board.xml | 6 +++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/dashboard/DashBoardActivity.kt b/presentation/src/main/java/com/going/presentation/dashboard/DashBoardActivity.kt index 6b4d73bd..ee7599dc 100644 --- a/presentation/src/main/java/com/going/presentation/dashboard/DashBoardActivity.kt +++ b/presentation/src/main/java/com/going/presentation/dashboard/DashBoardActivity.kt @@ -1,10 +1,13 @@ package com.going.presentation.dashboard +import android.content.Intent import android.os.Bundle import androidx.activity.viewModels import com.going.presentation.R import com.going.presentation.databinding.ActivityTripDashBoardBinding +import com.going.presentation.setting.SettingActivity import com.going.ui.base.BaseActivity +import com.going.ui.extension.setOnSingleClickListener import com.google.android.material.tabs.TabLayoutMediator import dagger.hilt.android.AndroidEntryPoint @@ -22,7 +25,7 @@ class DashBoardActivity : setTabLayout() setViewPager() setTravelerName() - + initSettingBtnClickListener() } private fun setTabLayout() { @@ -51,9 +54,20 @@ class DashBoardActivity : } } + private fun initSettingBtnClickListener() { + binding.btnDashboardSetting.setOnSingleClickListener { + navigateToSettingScreen() + } + } + + private fun navigateToSettingScreen() { + Intent(this, SettingActivity::class.java).apply { + startActivity(this) + } + } + companion object { const val TAB_ONGOING = "진행중인 여행" const val TAB_COMPLETED = "지나간 여행" } - -} \ No newline at end of file +} diff --git a/presentation/src/main/res/layout/activity_trip_dash_board.xml b/presentation/src/main/res/layout/activity_trip_dash_board.xml index ded3aa09..9100429b 100644 --- a/presentation/src/main/res/layout/activity_trip_dash_board.xml +++ b/presentation/src/main/res/layout/activity_trip_dash_board.xml @@ -26,7 +26,7 @@ tools:text="@string/dashboard_tv_title" /> - \ No newline at end of file + From 137868282ffadeb211e8603259d3331fa56eb584 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 15 Jan 2024 00:23:44 +0900 Subject: [PATCH 06/11] =?UTF-8?q?[CHORE/#105]=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20/=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85?= =?UTF-8?q?=20=ED=86=A0=ED=81=B0=20=EC=A0=9C=EA=B1=B0=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../going/data/interceptor/AuthInterceptor.kt | 14 ++++--------- .../com/going/data/local/GoingDataStore.kt | 1 + .../going/data/local/GoingDataStoreImpl.kt | 4 ++++ .../repositoryImpl/TokenRepositoryImpl.kt | 5 ++--- .../domain/repository/TokenRepository.kt | 2 +- .../onboarding/splash/SplashViewModel.kt | 21 +++++++++++-------- .../presentation/setting/SettingViewModel.kt | 4 ++-- 7 files changed, 26 insertions(+), 25 deletions(-) diff --git a/data/src/main/java/com/going/data/interceptor/AuthInterceptor.kt b/data/src/main/java/com/going/data/interceptor/AuthInterceptor.kt index da83d5e7..4c18c49d 100644 --- a/data/src/main/java/com/going/data/interceptor/AuthInterceptor.kt +++ b/data/src/main/java/com/going/data/interceptor/AuthInterceptor.kt @@ -64,18 +64,12 @@ class AuthInterceptor @Inject constructor( return chain.proceed(newRequest) } - dataStore.apply { - accessToken = "" - refreshToken = "" - } + dataStore.clearInfo() // refreshToken 만료 처리를 위한 리프레시 토큰 만료 코드 포함 리스폰스 리턴 return refreshTokenResponse } catch (t: Throwable) { - dataStore.apply { - accessToken = "" - refreshToken = "" - } + dataStore.clearInfo() Timber.e(t) } @@ -84,8 +78,8 @@ class AuthInterceptor @Inject constructor( return response } - private fun Request.newAuthBuilder() = - this.newBuilder().addHeader(AUTHORIZATION, "$BEARER ${dataStore.accessToken}") + private fun Request.newAuthBuilder() = + this.newBuilder().addHeader(AUTHORIZATION, "$BEARER ${dataStore.accessToken}") companion object { private const val CODE_TOKEN_EXPIRED = 401 diff --git a/data/src/main/java/com/going/data/local/GoingDataStore.kt b/data/src/main/java/com/going/data/local/GoingDataStore.kt index 541dc870..785041a5 100644 --- a/data/src/main/java/com/going/data/local/GoingDataStore.kt +++ b/data/src/main/java/com/going/data/local/GoingDataStore.kt @@ -4,4 +4,5 @@ interface GoingDataStore { var accessToken: String var refreshToken: String var userId: Long + fun clearInfo() } diff --git a/data/src/main/java/com/going/data/local/GoingDataStoreImpl.kt b/data/src/main/java/com/going/data/local/GoingDataStoreImpl.kt index 2d344ee0..471c9a93 100644 --- a/data/src/main/java/com/going/data/local/GoingDataStoreImpl.kt +++ b/data/src/main/java/com/going/data/local/GoingDataStoreImpl.kt @@ -19,6 +19,10 @@ class GoingDataStoreImpl @Inject constructor( get() = dataStore.getLong(USER_ID, 0L) set(value) = dataStore.edit { putLong(USER_ID, value) } + override fun clearInfo() { + dataStore.edit().clear().commit() + } + companion object { private const val ACCESS_TOKEN = "ACCESS_TOKEN" private const val REFRESH_TOKEN = "REFRESH_TOKEN" diff --git a/data/src/main/java/com/going/data/repositoryImpl/TokenRepositoryImpl.kt b/data/src/main/java/com/going/data/repositoryImpl/TokenRepositoryImpl.kt index 865bff59..459bb574 100644 --- a/data/src/main/java/com/going/data/repositoryImpl/TokenRepositoryImpl.kt +++ b/data/src/main/java/com/going/data/repositoryImpl/TokenRepositoryImpl.kt @@ -19,8 +19,7 @@ class TokenRepositoryImpl @Inject constructor( goingDataStore.userId = userId } - override fun clearTokens() { - goingDataStore.accessToken = "" - goingDataStore.refreshToken = "" + override fun clearInfo() { + goingDataStore.clearInfo() } } diff --git a/domain/src/main/kotlin/com/going/domain/repository/TokenRepository.kt b/domain/src/main/kotlin/com/going/domain/repository/TokenRepository.kt index d0f8899b..0d9761a0 100644 --- a/domain/src/main/kotlin/com/going/domain/repository/TokenRepository.kt +++ b/domain/src/main/kotlin/com/going/domain/repository/TokenRepository.kt @@ -9,5 +9,5 @@ interface TokenRepository { fun setUserId(userId: Long) - fun clearTokens() + fun clearInfo() } diff --git a/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashViewModel.kt b/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashViewModel.kt index b97d0ea7..92118424 100644 --- a/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashViewModel.kt @@ -21,20 +21,23 @@ class SplashViewModel @Inject constructor( private val _userState = MutableStateFlow(AuthState.LOADING) val userState: StateFlow = _userState fun getHasAccessToken(): Boolean = tokenRepository.getAccessToken().isNotBlank() - fun clear() = tokenRepository.clearTokens() fun getUserState() { - viewModelScope.launch { - authRepository.getSplash().onSuccess { - _userState.value = AuthState.SUCCESS - }.onFailure { - val errorCode = toErrorCode(it) + if (tokenRepository.getAccessToken() != "") { + viewModelScope.launch { + authRepository.getSplash().onSuccess { + _userState.value = AuthState.SUCCESS + }.onFailure { + val errorCode = toErrorCode(it) - _userState.value = when (errorCode) { - TENDENCY -> AuthState.TENDENCY - else -> AuthState.FAILURE + _userState.value = when (errorCode) { + TENDENCY -> AuthState.TENDENCY + else -> AuthState.FAILURE + } } } + } else { + _userState.value = AuthState.FAILURE } } diff --git a/presentation/src/main/java/com/going/presentation/setting/SettingViewModel.kt b/presentation/src/main/java/com/going/presentation/setting/SettingViewModel.kt index d20da8dd..13f3f2f5 100644 --- a/presentation/src/main/java/com/going/presentation/setting/SettingViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/setting/SettingViewModel.kt @@ -38,7 +38,7 @@ class SettingViewModel @Inject constructor( private fun signOutJwt() { viewModelScope.launch { settingRepository.patchSignOut().onSuccess { - tokenRepository.clearTokens() + tokenRepository.clearInfo() _userSignOutState.value = EnumUiState.SUCCESS }.onFailure { @@ -62,7 +62,7 @@ class SettingViewModel @Inject constructor( private fun startWithDrawJwt() { viewModelScope.launch { settingRepository.deleteWithDraw().onSuccess { - tokenRepository.clearTokens() + tokenRepository.clearInfo() _userWithDrawState.value = EnumUiState.SUCCESS }.onFailure { From d03b33e87fc241f5d9611af1a7788d4725526bcb Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 15 Jan 2024 00:28:39 +0900 Subject: [PATCH 07/11] =?UTF-8?q?[FEAT/#105]=20=EC=84=A4=EC=A0=95=EC=B0=BD?= =?UTF-8?q?=20=EB=92=A4=EB=A1=9C=EA=B0=80=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/going/presentation/setting/SettingActivity.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt b/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt index 20dd8844..085900d5 100644 --- a/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt +++ b/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt @@ -18,6 +18,7 @@ class SettingActivity : BaseActivity(R.layout.activity_s override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + initBackBtnClickListener() initProfileClickListener() initInquireClickListener() setVersionCode() @@ -28,6 +29,12 @@ class SettingActivity : BaseActivity(R.layout.activity_s initQuitClickListener() } + private fun initBackBtnClickListener() { + binding.btnPreferenceBack.setOnSingleClickListener { + navigateUpTo(intent) + } + } + private fun initProfileClickListener() { binding.btnSettingProfile.setOnSingleClickListener { } From a358815cffc96cf32d8df15c40ddfaaf338e40b8 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 15 Jan 2024 00:40:43 +0900 Subject: [PATCH 08/11] =?UTF-8?q?[FEAT/#105]=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../signup/OnboardingProfileSettingActivity.kt | 7 ++++--- .../tendency/result/TendencyResultActivity.kt | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/onboarding/signup/OnboardingProfileSettingActivity.kt b/presentation/src/main/java/com/going/presentation/onboarding/signup/OnboardingProfileSettingActivity.kt index 8041e46a..ab9dcfff 100644 --- a/presentation/src/main/java/com/going/presentation/onboarding/signup/OnboardingProfileSettingActivity.kt +++ b/presentation/src/main/java/com/going/presentation/onboarding/signup/OnboardingProfileSettingActivity.kt @@ -13,6 +13,7 @@ import com.going.domain.entity.NameState import com.going.presentation.R import com.going.presentation.databinding.ActivityOnboardingProfileSettingBinding import com.going.presentation.onboarding.splash.SplashActivity +import com.going.presentation.tendency.splash.TendencySplashActivity import com.going.presentation.tendency.ttest.TendencyTestActivity import com.going.ui.base.BaseActivity import com.going.ui.extension.setOnSingleClickListener @@ -152,7 +153,7 @@ class OnboardingProfileSettingActivity : viewModel.isSignUpState.flowWithLifecycle(lifecycle).onEach { state -> when (state) { AuthState.LOADING -> return@onEach - AuthState.SUCCESS -> navigateToTendencyTestScreen() + AuthState.SUCCESS -> navigateToTendencySplashScreen() AuthState.FAILURE -> toast(getString(R.string.server_error)) AuthState.SIGNUP -> return@onEach AuthState.SIGNIN -> navigateToSplashScreen() @@ -170,8 +171,8 @@ class OnboardingProfileSettingActivity : finish() } - private fun navigateToTendencyTestScreen() { - Intent(this, TendencyTestActivity::class.java).apply { + private fun navigateToTendencySplashScreen() { + Intent(this, TendencySplashActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) startActivity(this) } diff --git a/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultActivity.kt b/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultActivity.kt index a04c41d7..6f7f0d8d 100644 --- a/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultActivity.kt @@ -3,7 +3,6 @@ package com.going.presentation.tendency.result import android.Manifest import android.content.Intent import android.content.pm.PackageManager -import android.content.res.Resources import android.graphics.Bitmap import android.graphics.BitmapFactory import android.media.MediaScannerConnection @@ -21,7 +20,7 @@ import androidx.lifecycle.lifecycleScope import com.going.presentation.R import com.going.presentation.dashboard.DashBoardActivity import com.going.presentation.databinding.ActivityTendencyResultBinding -import com.going.presentation.tendency.ttest.TendencyTestActivity +import com.going.presentation.tendency.splash.TendencySplashActivity import com.going.ui.base.BaseActivity import com.going.ui.extension.UiState import com.going.ui.extension.setOnSingleClickListener @@ -112,7 +111,7 @@ class TendencyResultActivity : private fun initRestartBtnClickListener() { binding.btnTendencyTestRestart.setOnSingleClickListener { - navigateToTendencyTestScreen() + navigateToTendencySplashScreen() } } @@ -128,8 +127,8 @@ class TendencyResultActivity : } } - private fun navigateToTendencyTestScreen() { - Intent(this, TendencyTestActivity::class.java).apply { + private fun navigateToTendencySplashScreen() { + Intent(this, TendencySplashActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) startActivity(this) } From 57cf3f53c3b58656c0df9a9678b3b2da8db66811 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 15 Jan 2024 00:43:19 +0900 Subject: [PATCH 09/11] =?UTF-8?q?[FEAT/#105]=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=9C=84=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/activity_onboarding_profile_setting.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml b/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml index 59aad5ba..9466e7c6 100644 --- a/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml +++ b/presentation/src/main/res/layout/activity_onboarding_profile_setting.xml @@ -129,7 +129,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginHorizontal="24dp" - android:layout_marginBottom="60dp" + android:layout_marginBottom="24dp" android:background="@drawable/sel_rounded_corner_button" android:enabled="@{viewModel.isProfileAvailable()}" android:outlineProvider="none" From 0939840c6a379ea035865cb01a9aacdc56dfa140 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 15 Jan 2024 01:19:01 +0900 Subject: [PATCH 10/11] =?UTF-8?q?[FEAT/#105]=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=EC=9D=B4=EB=8F=99=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/going/presentation/setting/SettingActivity.kt | 2 +- .../presentation/tendency/result/TendencyResultActivity.kt | 1 + .../presentation/tendency/splash/TendencySplashActivity.kt | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt b/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt index 085900d5..6b9fe0ce 100644 --- a/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt +++ b/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt @@ -31,7 +31,7 @@ class SettingActivity : BaseActivity(R.layout.activity_s private fun initBackBtnClickListener() { binding.btnPreferenceBack.setOnSingleClickListener { - navigateUpTo(intent) + finish() } } diff --git a/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultActivity.kt b/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultActivity.kt index 6f7f0d8d..22603886 100644 --- a/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultActivity.kt @@ -140,6 +140,7 @@ class TendencyResultActivity : addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) startActivity(this) } + finish() } private fun startImageDownload() { diff --git a/presentation/src/main/java/com/going/presentation/tendency/splash/TendencySplashActivity.kt b/presentation/src/main/java/com/going/presentation/tendency/splash/TendencySplashActivity.kt index f68138c5..a9bb6e65 100644 --- a/presentation/src/main/java/com/going/presentation/tendency/splash/TendencySplashActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendency/splash/TendencySplashActivity.kt @@ -24,7 +24,9 @@ class TendencySplashActivity : private fun navigateToTendencyTestScreen() { Intent(this, TendencyTestActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) startActivity(this) } + finish() } } From 2738cacadbd0ce723007903e6108b34f4c3d2b36 Mon Sep 17 00:00:00 2001 From: Dongmin Date: Mon, 15 Jan 2024 01:34:35 +0900 Subject: [PATCH 11/11] =?UTF-8?q?[CHORE/#105]=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=9D=B4=EB=8F=99=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/DashBoardActivity.kt | 1 + .../starttrip/createtrip/EnterTripActivity.kt | 9 --------- .../invitetrip/CreateTripActivity.kt | 20 +++++-------------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/presentation/src/main/java/com/going/presentation/dashboard/DashBoardActivity.kt b/presentation/src/main/java/com/going/presentation/dashboard/DashBoardActivity.kt index 3783f493..9934cfe0 100644 --- a/presentation/src/main/java/com/going/presentation/dashboard/DashBoardActivity.kt +++ b/presentation/src/main/java/com/going/presentation/dashboard/DashBoardActivity.kt @@ -76,6 +76,7 @@ class DashBoardActivity : private fun navigateToDashboard() { Intent(this, CreateTripActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) startActivity(this) } } diff --git a/presentation/src/main/java/com/going/presentation/entertrip/starttrip/createtrip/EnterTripActivity.kt b/presentation/src/main/java/com/going/presentation/entertrip/starttrip/createtrip/EnterTripActivity.kt index 56b4e273..572ed1e5 100644 --- a/presentation/src/main/java/com/going/presentation/entertrip/starttrip/createtrip/EnterTripActivity.kt +++ b/presentation/src/main/java/com/going/presentation/entertrip/starttrip/createtrip/EnterTripActivity.kt @@ -10,7 +10,6 @@ import androidx.lifecycle.lifecycleScope import com.going.domain.entity.CodeState import com.going.presentation.R import com.going.presentation.databinding.ActivityEnterTripBinding -import com.going.presentation.entertrip.starttrip.StartTripSplashActivity import com.going.presentation.entertrip.starttrip.invitetrip.InviteFinishActivity import com.going.ui.base.BaseActivity import com.going.ui.extension.UiState @@ -32,15 +31,10 @@ class EnterTripActivity : BaseActivity(R.layout.activi observeIsCodeAvailable() initNextBtnClickListener() observeEnterTripState() - - } private fun initBackBtnClickListener() { binding.btnEnterBack.setOnSingleClickListener { - Intent(this, StartTripSplashActivity::class.java).apply { - startActivity(this) - } finish() } } @@ -85,12 +79,10 @@ class EnterTripActivity : BaseActivity(R.layout.activi counter.setTextColor(getColor(color)) } - private fun observeEnterTripState() { viewModel.tripState.flowWithLifecycle(lifecycle).onEach { state -> when (state) { is UiState.Success -> { - Intent(this, InviteFinishActivity::class.java).apply { putExtra(TRIP_ID, state.data.tripId) putExtra(TITLE, state.data.title) @@ -126,5 +118,4 @@ class EnterTripActivity : BaseActivity(R.layout.activi const val CODE = "code" const val DAY = "day" } - } diff --git a/presentation/src/main/java/com/going/presentation/entertrip/starttrip/invitetrip/CreateTripActivity.kt b/presentation/src/main/java/com/going/presentation/entertrip/starttrip/invitetrip/CreateTripActivity.kt index e213ef53..97a7e411 100644 --- a/presentation/src/main/java/com/going/presentation/entertrip/starttrip/invitetrip/CreateTripActivity.kt +++ b/presentation/src/main/java/com/going/presentation/entertrip/starttrip/invitetrip/CreateTripActivity.kt @@ -8,7 +8,6 @@ import androidx.core.content.res.ResourcesCompat import com.going.domain.entity.NameState import com.going.presentation.R import com.going.presentation.databinding.ActivityCreateTripBinding -import com.going.presentation.entertrip.starttrip.StartTripSplashActivity import com.going.presentation.entertrip.starttrip.createtrip.BottomSheetDateContentFragment import com.going.presentation.entertrip.starttrip.createtrip.EnterPreferenceActivity import com.going.ui.base.BaseActivity @@ -37,9 +36,7 @@ class CreateTripActivity : private fun initBackBtnClickListener() { binding.tbCreateTrip.setOnSingleClickListener { - Intent(this, StartTripSplashActivity::class.java).apply { - startActivity(this) - } + finish() } } @@ -76,14 +73,12 @@ class CreateTripActivity : } } - private fun observeCheckStartDateAvailable() { viewModel.isStartDateAvailable.observe(this) { isAvailable -> if (isAvailable) { setStartDateColors( - binding.tvCreateTripStartDate - ) - { background -> + binding.tvCreateTripStartDate, + ) { background -> binding.tvCreateTripStartDate.background = ResourcesCompat.getDrawable( this.resources, background, @@ -98,9 +93,8 @@ class CreateTripActivity : viewModel.isEndDateAvailable.observe(this) { isAvailable -> if (isAvailable) { setEndDateColors( - binding.tvCreateTripEndDate - ) - { background -> + binding.tvCreateTripEndDate, + ) { background -> binding.tvCreateTripEndDate.background = ResourcesCompat.getDrawable( this.resources, background, @@ -159,7 +153,6 @@ class CreateTripActivity : counter.setTextColor(getColor(color)) } - private fun initStartDateClickListener() { binding.tvCreateTripStartDate.setOnSingleClickListener { startBottomSheetDialog = BottomSheetDateContentFragment(viewModel, true) @@ -199,6 +192,3 @@ class CreateTripActivity : const val END_DAY = "endDay" } } - - -