From c8791ddca3c8728cee8908d5cdb5f39a938fdeb3 Mon Sep 17 00:00:00 2001 From: p-chanmin Date: Mon, 11 Dec 2023 21:52:17 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20@StringRes=20=EC=96=B4=EB=85=B8?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meetmeet/presentation/addevent/AddEventUiEvent.kt | 6 +++++- .../meetmeet/presentation/follow/FollowUiEvent.kt | 6 +++++- .../meetmeet/presentation/follow/FollowViewModel.kt | 3 ++- .../presentation/login/selflogin/SelfLoginUiEvent.kt | 5 ++++- .../presentation/login/selflogin/SelfLoginViewModel.kt | 3 ++- .../meetmeet/presentation/login/signup/SignUpUiEvent.kt | 5 ++++- .../meetmeet/presentation/login/signup/SignUpViewModel.kt | 3 ++- .../presentation/notification/EventNotificationViewModel.kt | 3 ++- .../notification/FollowNotificationViewModel.kt | 3 ++- .../notification/event/EventNotificationUiEvent.kt | 3 ++- .../notification/follow/FollowNotificationUiEvent.kt | 4 +++- .../presentation/setting/account/SettingAccountUiEvent.kt | 4 +++- .../presentation/setting/account/SettingAccountViewModel.kt | 3 ++- .../presentation/setting/home/SettingHomeUiEvent.kt | 4 +++- .../presentation/setting/home/SettingHomeViewModel.kt | 3 ++- .../setting/passwordchange/SettingPasswordChangeUiEvent.kt | 4 +++- .../passwordchange/SettingPasswordChangeViewModel.kt | 3 ++- .../presentation/setting/profile/SettingProfileUiEvent.kt | 4 +++- .../presentation/setting/profile/SettingProfileViewModel.kt | 3 ++- 19 files changed, 53 insertions(+), 19 deletions(-) diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/addevent/AddEventUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/addevent/AddEventUiEvent.kt index eccc639..350c0df 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/addevent/AddEventUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/addevent/AddEventUiEvent.kt @@ -1,7 +1,11 @@ package com.teameetmeet.meetmeet.presentation.addevent +import androidx.annotation.StringRes + sealed class AddEventUiEvent { - data class ShowMessage(val messageId: Int, val extraMessage: String = "") : AddEventUiEvent() + data class ShowMessage(@StringRes val messageId: Int, val extraMessage: String = "") : + AddEventUiEvent() + data object FinishAddEventActivity : AddEventUiEvent() data object NavigateToLoginActivity : AddEventUiEvent() } \ No newline at end of file diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/follow/FollowUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/follow/FollowUiEvent.kt index 7337c1c..27de8a4 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/follow/FollowUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/follow/FollowUiEvent.kt @@ -1,7 +1,11 @@ package com.teameetmeet.meetmeet.presentation.follow +import androidx.annotation.StringRes + sealed class FollowUiEvent { - data class ShowMessage(val message: Int, val extraMessage: String = "") : FollowUiEvent() + data class ShowMessage(@StringRes val message: Int, val extraMessage: String = "") : + FollowUiEvent() + data class VisitProfile(val userId: Int, val userNickname: String) : FollowUiEvent() data object NavigateToLoginActivity : FollowUiEvent() } \ No newline at end of file diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/follow/FollowViewModel.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/follow/FollowViewModel.kt index 74a32f9..46d5455 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/follow/FollowViewModel.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/follow/FollowViewModel.kt @@ -1,5 +1,6 @@ package com.teameetmeet.meetmeet.presentation.follow +import androidx.annotation.StringRes import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.teameetmeet.meetmeet.R @@ -221,7 +222,7 @@ class FollowViewModel @Inject constructor( println("${user.nickname}님을 그룹 $id 에 초대") } - private suspend fun emitExceptionEvent(e: Throwable, message: Int) { + private suspend fun emitExceptionEvent(e: Throwable, @StringRes message: Int) { when (e) { is ExpiredRefreshTokenException -> { _event.emit(FollowUiEvent.ShowMessage(R.string.common_message_expired_login)) diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/selflogin/SelfLoginUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/selflogin/SelfLoginUiEvent.kt index f232505..ed7ec31 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/selflogin/SelfLoginUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/selflogin/SelfLoginUiEvent.kt @@ -1,6 +1,9 @@ package com.teameetmeet.meetmeet.presentation.login.selflogin +import androidx.annotation.StringRes + sealed class SelfLoginUiEvent { data object NavigateToHomeActivity : SelfLoginUiEvent() - data class ShowMessage(val message: Int, val extraMessage: String = "") : SelfLoginUiEvent() + data class ShowMessage(@StringRes val message: Int, val extraMessage: String = "") : + SelfLoginUiEvent() } diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/selflogin/SelfLoginViewModel.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/selflogin/SelfLoginViewModel.kt index 20f271f..d63462d 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/selflogin/SelfLoginViewModel.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/selflogin/SelfLoginViewModel.kt @@ -1,5 +1,6 @@ package com.teameetmeet.meetmeet.presentation.login.selflogin +import androidx.annotation.StringRes import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.teameetmeet.meetmeet.R @@ -62,7 +63,7 @@ class SelfLoginViewModel @Inject constructor( } } - private suspend fun emitExceptionEvent(e: Throwable, message: Int) { + private suspend fun emitExceptionEvent(e: Throwable, @StringRes message: Int) { when (e) { is UnknownHostException -> { _event.emit(SelfLoginUiEvent.ShowMessage(R.string.common_message_no_internet)) diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/signup/SignUpUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/signup/SignUpUiEvent.kt index 7b9db96..6e35161 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/signup/SignUpUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/signup/SignUpUiEvent.kt @@ -1,6 +1,9 @@ package com.teameetmeet.meetmeet.presentation.login.signup +import androidx.annotation.StringRes + sealed class SignUpUiEvent { data object NavigateToProfileSettingFragment : SignUpUiEvent() - data class ShowMessage(val message: Int, val extraMessage: String = "") : SignUpUiEvent() + data class ShowMessage(@StringRes val message: Int, val extraMessage: String = "") : + SignUpUiEvent() } \ No newline at end of file diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/signup/SignUpViewModel.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/signup/SignUpViewModel.kt index 3569588..3d4098e 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/signup/SignUpViewModel.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/login/signup/SignUpViewModel.kt @@ -1,5 +1,6 @@ package com.teameetmeet.meetmeet.presentation.login.signup +import androidx.annotation.StringRes import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.teameetmeet.meetmeet.R @@ -123,7 +124,7 @@ class SignUpViewModel @Inject constructor( } } - private suspend fun emitExceptionEvent(e: Throwable, message: Int) { + private suspend fun emitExceptionEvent(e: Throwable, @StringRes message: Int) { when (e) { is UnknownHostException -> { _event.emit(SignUpUiEvent.ShowMessage(R.string.common_message_no_internet)) diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/EventNotificationViewModel.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/EventNotificationViewModel.kt index cc792a3..2451172 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/EventNotificationViewModel.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/EventNotificationViewModel.kt @@ -1,5 +1,6 @@ package com.teameetmeet.meetmeet.presentation.notification +import androidx.annotation.StringRes import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.teameetmeet.meetmeet.R @@ -102,7 +103,7 @@ class EventNotificationViewModel @Inject constructor( } } - private suspend fun emitExceptionEvent(e: Throwable, message: Int) { + private suspend fun emitExceptionEvent(e: Throwable, @StringRes message: Int) { when (e) { is ExpiredRefreshTokenException -> { _event.emit(EventNotificationUiEvent.ShowMessage(R.string.common_message_expired_login)) diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/FollowNotificationViewModel.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/FollowNotificationViewModel.kt index bb7cb07..b540a4d 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/FollowNotificationViewModel.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/FollowNotificationViewModel.kt @@ -1,5 +1,6 @@ package com.teameetmeet.meetmeet.presentation.notification +import androidx.annotation.StringRes import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.teameetmeet.meetmeet.R @@ -63,7 +64,7 @@ class FollowNotificationViewModel @Inject constructor( } } - private suspend fun emitExceptionEvent(e: Throwable, message: Int) { + private suspend fun emitExceptionEvent(e: Throwable, @StringRes message: Int) { when (e) { is ExpiredRefreshTokenException -> { _event.emit(FollowNotificationUiEvent.ShowMessage(R.string.common_message_expired_login)) diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/event/EventNotificationUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/event/EventNotificationUiEvent.kt index 0d8c480..7514b4b 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/event/EventNotificationUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/event/EventNotificationUiEvent.kt @@ -1,10 +1,11 @@ package com.teameetmeet.meetmeet.presentation.notification.event +import androidx.annotation.StringRes import com.teameetmeet.meetmeet.data.network.entity.EventInvitationNotification sealed class EventNotificationUiEvent { data class ShowAcceptDialog(val event: EventInvitationNotification) : EventNotificationUiEvent() - data class ShowMessage(val message: Int, val extraMessage: String = "") : + data class ShowMessage(@StringRes val message: Int, val extraMessage: String = "") : EventNotificationUiEvent() data object NavigateToLoginActivity : EventNotificationUiEvent() diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/follow/FollowNotificationUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/follow/FollowNotificationUiEvent.kt index 5dbcc8f..33736b5 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/follow/FollowNotificationUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/notification/follow/FollowNotificationUiEvent.kt @@ -1,7 +1,9 @@ package com.teameetmeet.meetmeet.presentation.notification.follow +import androidx.annotation.StringRes + sealed class FollowNotificationUiEvent { - data class ShowMessage(val message: Int, val extraMessage: String = "") : + data class ShowMessage(@StringRes val message: Int, val extraMessage: String = "") : FollowNotificationUiEvent() data object NavigateToLoginActivity : FollowNotificationUiEvent() diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/account/SettingAccountUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/account/SettingAccountUiEvent.kt index e4ebdab..c000ea3 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/account/SettingAccountUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/account/SettingAccountUiEvent.kt @@ -1,7 +1,9 @@ package com.teameetmeet.meetmeet.presentation.setting.account +import androidx.annotation.StringRes + sealed class SettingAccountUiEvent { - data class ShowMessage(val message: Int, val extraMessage: String = "") : + data class ShowMessage(@StringRes val message: Int, val extraMessage: String = "") : SettingAccountUiEvent() data object NavigateToLoginActivity : SettingAccountUiEvent() diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/account/SettingAccountViewModel.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/account/SettingAccountViewModel.kt index 882f699..f23f1f6 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/account/SettingAccountViewModel.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/account/SettingAccountViewModel.kt @@ -1,5 +1,6 @@ package com.teameetmeet.meetmeet.presentation.setting.account +import androidx.annotation.StringRes import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.teameetmeet.meetmeet.R @@ -38,7 +39,7 @@ class SettingAccountViewModel @Inject constructor( } } - private suspend fun emitExceptionEvent(e: Throwable, message: Int) { + private suspend fun emitExceptionEvent(e: Throwable, @StringRes message: Int) { when (e) { is ExpiredRefreshTokenException -> { _event.emit(SettingAccountUiEvent.ShowMessage(R.string.common_message_expired_login)) diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/home/SettingHomeUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/home/SettingHomeUiEvent.kt index 1da9790..429b505 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/home/SettingHomeUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/home/SettingHomeUiEvent.kt @@ -1,6 +1,8 @@ package com.teameetmeet.meetmeet.presentation.setting.home +import androidx.annotation.StringRes + sealed class SettingHomeUiEvent { - data class ShowMessage(val messageId: Int, val extraMessage: String = "") : SettingHomeUiEvent() + data class ShowMessage(@StringRes val messageId: Int, val extraMessage: String = "") : SettingHomeUiEvent() data object NavigateToLoginActivity : SettingHomeUiEvent() } \ No newline at end of file diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/home/SettingHomeViewModel.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/home/SettingHomeViewModel.kt index 3e2da3a..f4306e7 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/home/SettingHomeViewModel.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/home/SettingHomeViewModel.kt @@ -1,5 +1,6 @@ package com.teameetmeet.meetmeet.presentation.setting.home +import androidx.annotation.StringRes import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.kakao.sdk.user.UserApiClient @@ -52,7 +53,7 @@ class SettingHomeViewModel @Inject constructor( } } - private suspend fun emitExceptionEvent(e: Throwable, message: Int) { + private suspend fun emitExceptionEvent(e: Throwable, @StringRes message: Int) { when (e) { is ExpiredRefreshTokenException -> { _event.emit(SettingHomeUiEvent.ShowMessage(R.string.common_message_expired_login)) diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/passwordchange/SettingPasswordChangeUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/passwordchange/SettingPasswordChangeUiEvent.kt index 6922778..f18a921 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/passwordchange/SettingPasswordChangeUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/passwordchange/SettingPasswordChangeUiEvent.kt @@ -1,8 +1,10 @@ package com.teameetmeet.meetmeet.presentation.setting.passwordchange +import androidx.annotation.StringRes + sealed class SettingPasswordChangeUiEvent { data object NavigateToSettingHomeFragment : SettingPasswordChangeUiEvent() - data class ShowMessage(val message: Int, val extraMessage: String = "") : + data class ShowMessage(@StringRes val message: Int, val extraMessage: String = "") : SettingPasswordChangeUiEvent() data object NavigateToLoginActivity : SettingPasswordChangeUiEvent() diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/passwordchange/SettingPasswordChangeViewModel.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/passwordchange/SettingPasswordChangeViewModel.kt index f45cb3c..d9575e1 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/passwordchange/SettingPasswordChangeViewModel.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/passwordchange/SettingPasswordChangeViewModel.kt @@ -1,5 +1,6 @@ package com.teameetmeet.meetmeet.presentation.setting.passwordchange +import androidx.annotation.StringRes import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.teameetmeet.meetmeet.R @@ -94,7 +95,7 @@ class SettingPasswordChangeViewModel @Inject constructor( } } - private suspend fun emitExceptionEvent(e: Throwable, message: Int) { + private suspend fun emitExceptionEvent(e: Throwable, @StringRes message: Int) { when (e) { is ExpiredRefreshTokenException -> { _event.emit(SettingPasswordChangeUiEvent.ShowMessage(R.string.common_message_expired_login)) diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/profile/SettingProfileUiEvent.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/profile/SettingProfileUiEvent.kt index 4eee86b..05d7fca 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/profile/SettingProfileUiEvent.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/profile/SettingProfileUiEvent.kt @@ -1,8 +1,10 @@ package com.teameetmeet.meetmeet.presentation.setting.profile +import androidx.annotation.StringRes + sealed class SettingProfileUiEvent { data object NavigateToSettingHomeFragment : SettingProfileUiEvent() - data class ShowMessage(val message: Int, val extraMessage: String = "") : + data class ShowMessage(@StringRes val message: Int, val extraMessage: String = "") : SettingProfileUiEvent() data object NavigateToLoginActivity : SettingProfileUiEvent() diff --git a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/profile/SettingProfileViewModel.kt b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/profile/SettingProfileViewModel.kt index 258e276..fcf069c 100644 --- a/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/profile/SettingProfileViewModel.kt +++ b/android/app/src/main/java/com/teameetmeet/meetmeet/presentation/setting/profile/SettingProfileViewModel.kt @@ -1,6 +1,7 @@ package com.teameetmeet.meetmeet.presentation.setting.profile import android.net.Uri +import androidx.annotation.StringRes import androidx.core.net.toUri import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope @@ -143,7 +144,7 @@ class SettingProfileViewModel @Inject constructor( } } - private suspend fun emitExceptionEvent(e: Throwable, message: Int) { + private suspend fun emitExceptionEvent(e: Throwable, @StringRes message: Int) { when (e) { is ExpiredRefreshTokenException -> { _event.emit(SettingProfileUiEvent.ShowMessage(R.string.common_message_expired_login))