diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml new file mode 100644 index 00000000..02b915b8 --- /dev/null +++ b/.idea/git_toolbox_prj.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 345b9741..c2ef3504 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,7 +28,6 @@ - diff --git a/presentation/src/main/java/com/going/presentation/onboarding/signin/SignInActivity.kt b/presentation/src/main/java/com/going/presentation/onboarding/signin/SignInActivity.kt index 01573c97..2cab77e4 100644 --- a/presentation/src/main/java/com/going/presentation/onboarding/signin/SignInActivity.kt +++ b/presentation/src/main/java/com/going/presentation/onboarding/signin/SignInActivity.kt @@ -21,6 +21,7 @@ import kotlinx.coroutines.flow.onEach @AndroidEntryPoint class SignInActivity : BaseActivity(R.layout.activity_signin) { + private val viewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { @@ -95,6 +96,6 @@ class SignInActivity : BaseActivity(R.layout.activity_sig } companion object { - const val TERMS_URL = "http://www.naver.com" + const val TERMS_URL = "https://goinggoing.notion.site/75f5d981a5b842a6be74a9dc17ca67de?pvs=74" } } 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 3a0ca7f9..6d1d68f6 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 @@ -23,6 +23,7 @@ class SignInViewModel @Inject constructor( private val authRepository: AuthRepository, private val tokenRepository: TokenRepository, ) : ViewModel() { + private val _postChangeTokenState = MutableStateFlow(AuthState.EMPTY) val postChangeTokenState: StateFlow = _postChangeTokenState 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 6794c983..8041e46a 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 @@ -8,10 +8,10 @@ import androidx.activity.viewModels import androidx.core.content.res.ResourcesCompat import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope +import com.going.domain.entity.AuthState import com.going.domain.entity.NameState import com.going.presentation.R import com.going.presentation.databinding.ActivityOnboardingProfileSettingBinding -import com.going.domain.entity.AuthState import com.going.presentation.onboarding.splash.SplashActivity import com.going.presentation.tendency.ttest.TendencyTestActivity import com.going.ui.base.BaseActivity @@ -24,6 +24,7 @@ import kotlinx.coroutines.flow.onEach @AndroidEntryPoint class OnboardingProfileSettingActivity : BaseActivity(R.layout.activity_onboarding_profile_setting) { + private val viewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { 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 5adbd13e..dcc4e9d0 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 @@ -3,10 +3,10 @@ package com.going.presentation.onboarding.signup import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope +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.entity.AuthState import com.kakao.sdk.auth.AuthApiClient import com.kakao.sdk.auth.TokenManagerProvider import com.kakao.sdk.user.UserApiClient @@ -21,6 +21,7 @@ import javax.inject.Inject class OnboardingProfileSettingViewModel @Inject constructor( private val authRepository: AuthRepository, ) : ViewModel() { + val name = MutableStateFlow("") val nowNameLength = MutableLiveData(0) val info = MutableStateFlow("") diff --git a/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashActivity.kt b/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashActivity.kt index 1575d0c1..4a801fd5 100644 --- a/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashActivity.kt +++ b/presentation/src/main/java/com/going/presentation/onboarding/splash/SplashActivity.kt @@ -21,6 +21,7 @@ import kotlinx.coroutines.flow.onEach @AndroidEntryPoint class SplashActivity : BaseActivity(R.layout.activity_splash) { + private val viewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -39,7 +40,11 @@ class SplashActivity : BaseActivity(R.layout.activity_spl private fun initSplash() { Handler(Looper.getMainLooper()).postDelayed({ - viewModel.getUserState() + if (viewModel.getHasAccessToken()) { + viewModel.getUserState() + } else { + navigateToSignInScreen() + } }, 3000) } 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 87737209..b97d0ea7 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 @@ -5,7 +5,6 @@ import androidx.lifecycle.viewModelScope import com.going.domain.entity.AuthState import com.going.domain.repository.AuthRepository import com.going.domain.repository.TokenRepository -import com.going.presentation.onboarding.signin.SignInViewModel import com.going.presentation.util.toErrorCode import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow @@ -18,6 +17,7 @@ class SplashViewModel @Inject constructor( private val authRepository: AuthRepository, private val tokenRepository: TokenRepository, ) : ViewModel() { + private val _userState = MutableStateFlow(AuthState.LOADING) val userState: StateFlow = _userState fun getHasAccessToken(): Boolean = tokenRepository.getAccessToken().isNotBlank() 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 dd44fa03..20dd8844 100644 --- a/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt +++ b/presentation/src/main/java/com/going/presentation/setting/SettingActivity.kt @@ -1,5 +1,7 @@ package com.going.presentation.setting +import android.content.Intent +import android.net.Uri import android.os.Bundle import com.going.presentation.R import com.going.presentation.databinding.ActivitySettingBinding @@ -18,11 +20,12 @@ class SettingActivity : BaseActivity(R.layout.activity_s initProfileClickListener() initInquireClickListener() + setVersionCode() initPolicyClickListener() + initTermsClickListener() initAboutDooripClickListener() initLogoutClickListener() initQuitClickListener() - setVersionCode() } private fun initProfileClickListener() { @@ -32,16 +35,37 @@ class SettingActivity : BaseActivity(R.layout.activity_s private fun initInquireClickListener() { binding.btnSettingInquire.setOnSingleClickListener { + Intent(Intent.ACTION_VIEW, Uri.parse(FAQ)).apply { + startActivity(this) + } } } + private fun setVersionCode() { + binding.tvSettingShowServiceVersion.text = VERSION_CODE + } + private fun initPolicyClickListener() { binding.btnSettingPolicy.setOnSingleClickListener { + Intent(Intent.ACTION_VIEW, Uri.parse(PRIVACY_POLICY_URL)).apply { + startActivity(this) + } + } + } + + private fun initTermsClickListener() { + binding.btnSettingTerms.setOnSingleClickListener { + Intent(Intent.ACTION_VIEW, Uri.parse(TERMS_URL)).apply { + startActivity(this) + } } } private fun initAboutDooripClickListener() { binding.btnSettingAboutDoorip.setOnSingleClickListener { + Intent(Intent.ACTION_VIEW, Uri.parse(ABOUT_DOORIP_URL)).apply { + startActivity(this) + } } } @@ -67,10 +91,6 @@ class SettingActivity : BaseActivity(R.layout.activity_s quitDialog?.show(supportFragmentManager, quitDialog?.tag) } - private fun setVersionCode() { - binding.tvSettingShowServiceVersion.text = VERSION_CODE - } - override fun onDestroy() { super.onDestroy() if (logoutDialog?.isAdded == true) logoutDialog?.dismiss() @@ -79,5 +99,13 @@ class SettingActivity : BaseActivity(R.layout.activity_s companion object { private const val VERSION_CODE = "v1.0" + private const val FAQ = + "https://goinggoing.notion.site/FAQ-920f6ad93fea46a983061f412e15cad1?pvs=74" + private const val PRIVACY_POLICY_URL = + "https://goinggoing.notion.site/c4d5513bba2c4c20aaf9e21522289304?pvs=74" + private const val TERMS_URL = + "https://goinggoing.notion.site/75f5d981a5b842a6be74a9dc17ca67de?pvs=74" + private const val ABOUT_DOORIP_URL = + "https://goinggoing.notion.site/758273e2bebb477aac0adb0195359f21" } } 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 e4f9a313..a04c41d7 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 @@ -35,6 +35,7 @@ import java.io.FileOutputStream @AndroidEntryPoint class TendencyResultActivity : BaseActivity(R.layout.activity_tendency_result) { + private val viewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -54,16 +55,16 @@ class TendencyResultActivity : viewModel.userInfoState.flowWithLifecycle(lifecycle).onEach { state -> when (state) { is UiState.Loading -> return@onEach - is UiState.Success -> bindTendencyInfo(state.data.result) + is UiState.Success -> bindTendencyInfo(state.data.name, state.data.result) is UiState.Failure -> toast(state.msg) is UiState.Empty -> return@onEach } }.launchIn(lifecycleScope) } - private fun bindTendencyInfo(number: Int) { + private fun bindTendencyInfo(name: String, number: Int) { with(binding) { - tvTendencyTestResultTitle.text = getString(R.string.tendency_test_result_title, "찐두릅") + tvTendencyTestResultTitle.text = getString(R.string.tendency_test_result_title, name) viewModel.mockTendencyResult[number].apply { imgTendencyTestResult.setImageResource(resultImage) @@ -154,11 +155,11 @@ class TendencyResultActivity : PERMISSION_REQUEST_CODE, ) } else { - saveImageToGallery(resources) + saveImageToGallery() } } - private fun saveImageToGallery(resources: Resources) { + private fun saveImageToGallery() { val imageBitmap: Bitmap = BitmapFactory.decodeResource( resources, R.drawable.img_tendency_result_ari, diff --git a/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultViewModel.kt b/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultViewModel.kt index 3f46d49a..b7b2734e 100644 --- a/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultViewModel.kt +++ b/presentation/src/main/java/com/going/presentation/tendency/result/TendencyResultViewModel.kt @@ -18,6 +18,7 @@ import javax.inject.Inject class TendencyResultViewModel @Inject constructor( private val profileRepository: ProfileRepository, ) : ViewModel() { + private val _userInfoState = MutableStateFlow>(UiState.Empty) val userInfoState: StateFlow> = _userInfoState @@ -277,4 +278,5 @@ class TendencyResultViewModel @Inject constructor( ), ), ) + } diff --git a/presentation/src/main/java/com/going/presentation/tendency/ttest/TendencyTestActivity.kt b/presentation/src/main/java/com/going/presentation/tendency/ttest/TendencyTestActivity.kt index 51854426..88c03907 100644 --- a/presentation/src/main/java/com/going/presentation/tendency/ttest/TendencyTestActivity.kt +++ b/presentation/src/main/java/com/going/presentation/tendency/ttest/TendencyTestActivity.kt @@ -84,6 +84,7 @@ class TendencyTestActivity : override fun onAnimationStart(animation: Animator) { viewModel.clearAllChecked() setProgressAnimate(binding.pbTendencyTest, viewModel.step.value) + for (i in 1 until fadeOutList.size) { fadeOutList[i].start() } diff --git a/presentation/src/main/res/drawable/img_sign_in_kakao_button.png b/presentation/src/main/res/drawable/img_sign_in_kakao_button.png index c882acc7..46846ce8 100644 Binary files a/presentation/src/main/res/drawable/img_sign_in_kakao_button.png and b/presentation/src/main/res/drawable/img_sign_in_kakao_button.png differ diff --git a/presentation/src/main/res/layout/activity_setting.xml b/presentation/src/main/res/layout/activity_setting.xml index 92edda12..ce23284b 100644 --- a/presentation/src/main/res/layout/activity_setting.xml +++ b/presentation/src/main/res/layout/activity_setting.xml @@ -190,6 +190,41 @@ + + + + + + + + + app:layout_constraintTop_toBottomOf="@id/btn_setting_terms"> diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 4b492635..47861ecd 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -135,7 +135,8 @@ 프로필 문의하기 서비스 버전 - 약관 및 정책 + 서비스 이용 약관 + 개인정보 처리 방침 About doorip 로그아웃 정말 탈퇴하시겠어요?