From c5a0a3121ca30c964b6103b8db43645a758f6462 Mon Sep 17 00:00:00 2001 From: blueme0 Date: Tue, 13 Feb 2024 23:49:09 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[fix/#145]=20Message=20-=20meetingId=20type?= =?UTF-8?q?=20Long=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/teumteum/teumteum/config/TeumMessagingService.kt | 2 +- .../src/main/java/com/teumteum/domain/entity/Message.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/teumteum/teumteum/config/TeumMessagingService.kt b/app/src/main/java/com/teumteum/teumteum/config/TeumMessagingService.kt index 06e28073..d22a921d 100644 --- a/app/src/main/java/com/teumteum/teumteum/config/TeumMessagingService.kt +++ b/app/src/main/java/com/teumteum/teumteum/config/TeumMessagingService.kt @@ -62,7 +62,7 @@ class TeumMessagingService : FirebaseMessagingService() { alertMessage.type = message.data["type"].toString() } if (alertMessage.type == END_MEETING) { - alertMessage.meetingId = message.data["meetingId"]?.toInt() + alertMessage.meetingId = message.data["meetingId"]?.toLong() alertMessage.participants = message.data["participants"]?.toList()?.map { it.digitToInt() } } if (alertMessage.title.isNotEmpty()) sendNotificationAlarm(alertMessage) diff --git a/core/domain/src/main/java/com/teumteum/domain/entity/Message.kt b/core/domain/src/main/java/com/teumteum/domain/entity/Message.kt index a11f403d..abd46964 100644 --- a/core/domain/src/main/java/com/teumteum/domain/entity/Message.kt +++ b/core/domain/src/main/java/com/teumteum/domain/entity/Message.kt @@ -4,6 +4,6 @@ data class Message( var title: String, var body: String, var type: String, - var meetingId: Int? = -1, - var participants: List? = listOf() + var meetingId: Long? = null, + var participants: List? = null ): java.io.Serializable \ No newline at end of file From 94c538ee6e316dfdc33bd68d645db210bea1c244 Mon Sep 17 00:00:00 2001 From: blueme0 Date: Tue, 13 Feb 2024 23:49:28 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[feat/#145]=20=EC=9C=A0=EC=A0=80=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EC=95=8C=EB=A6=BC=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../teumteum/teumteum/presentation/MainActivity.kt | 14 +++----------- .../teumteum/presentation/splash/SplashActivity.kt | 9 +++++++-- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/teumteum/teumteum/presentation/MainActivity.kt b/app/src/main/java/com/teumteum/teumteum/presentation/MainActivity.kt index 7b316ca4..053def0f 100644 --- a/app/src/main/java/com/teumteum/teumteum/presentation/MainActivity.kt +++ b/app/src/main/java/com/teumteum/teumteum/presentation/MainActivity.kt @@ -54,18 +54,10 @@ class MainActivity : BindingActivity(R.layout.activity_main if (isFromAlarm) { val message = intent.getSerializableExtra(MESSAGE) as Message var action = HomeFragmentDirections.actionHomeFragmentToFragmentFamiliar() - when (message.type) { - BEFORE_MEETING -> { - } - END_MEETING -> { -// val meetingId = message.meetingId -// val participants = message.participants -// action = HomeFragmentDirections.{홈 -> 유저리뷰로 이동하는 navi} - } - RECOMMEND_USER -> { - action = HomeFragmentDirections.actionHomeFragmentToFragmentMyPage() - } + if (message.type == RECOMMEND_USER) { + action = HomeFragmentDirections.actionHomeFragmentToFragmentMyPage() } + // END_MEETING은 따로 처리 val navHostFragment = supportFragmentManager.findFragmentById(R.id.fl_main) as NavHostFragment navHostFragment.navController.navigate(action) } diff --git a/app/src/main/java/com/teumteum/teumteum/presentation/splash/SplashActivity.kt b/app/src/main/java/com/teumteum/teumteum/presentation/splash/SplashActivity.kt index 7685b0c2..a21263b4 100644 --- a/app/src/main/java/com/teumteum/teumteum/presentation/splash/SplashActivity.kt +++ b/app/src/main/java/com/teumteum/teumteum/presentation/splash/SplashActivity.kt @@ -108,8 +108,12 @@ class SplashActivity } private fun startHomeScreen() { - val intent = MainActivity.getIntent(this, -1, isFromAlarm = isFromAlarm) - if (isFromAlarm) intent.putExtra(MESSAGE, message) + var intent = MainActivity.getIntent(this, -1, isFromAlarm = isFromAlarm) + if (isFromAlarm) { + if (message.type == END_MEETING) + intent = MainActivity.getIntent(this, message.meetingId!!, message.title) + else intent.putExtra(MESSAGE, message) + } startActivity(intent) finish() } @@ -121,5 +125,6 @@ class SplashActivity const val IS_FROM_ALARM = "isFromAlarm" const val MESSAGE = "message" + private const val END_MEETING = "END_MEETING" } } \ No newline at end of file From 0def1e2e33eb989a00f7ae46db95151ac81fc13f Mon Sep 17 00:00:00 2001 From: blueme0 Date: Wed, 14 Feb 2024 00:33:55 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[fix/#145]=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85=20=EC=A4=91=20=EC=B9=B4=EB=93=9C=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20=EC=8B=9C=20interest=20=EC=82=AD=EC=A0=9C=EB=90=98=EB=8A=94?= =?UTF-8?q?=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../teumteum/presentation/signup/SignUpViewModel.kt | 3 +++ .../presentation/signup/fix/CardFixFragment.kt | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/teumteum/teumteum/presentation/signup/SignUpViewModel.kt b/app/src/main/java/com/teumteum/teumteum/presentation/signup/SignUpViewModel.kt index 43625b0c..b6890ef2 100644 --- a/app/src/main/java/com/teumteum/teumteum/presentation/signup/SignUpViewModel.kt +++ b/app/src/main/java/com/teumteum/teumteum/presentation/signup/SignUpViewModel.kt @@ -19,6 +19,7 @@ import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch +import timber.log.Timber import javax.inject.Inject @HiltViewModel @@ -205,12 +206,14 @@ class SignUpViewModel @Inject constructor( } fun setAllInterests(interests: List, selfResource: Array, fieldResource: Array) { + Timber.tag("teum-fix").d("setAllInterests called") interestSelf.value.clear() interestField.value.clear() for (i in interests) { if (i in selfResource) addInterestSelf(i) else if (i in fieldResource) addInterestField(i) } + updateInterestCount() } private var _goalText = MutableStateFlow("") diff --git a/app/src/main/java/com/teumteum/teumteum/presentation/signup/fix/CardFixFragment.kt b/app/src/main/java/com/teumteum/teumteum/presentation/signup/fix/CardFixFragment.kt index aded80ff..404b615a 100644 --- a/app/src/main/java/com/teumteum/teumteum/presentation/signup/fix/CardFixFragment.kt +++ b/app/src/main/java/com/teumteum/teumteum/presentation/signup/fix/CardFixFragment.kt @@ -28,6 +28,7 @@ import com.teumteum.teumteum.util.custom.view.model.BackCard import com.teumteum.teumteum.util.custom.view.model.FrontCard import com.teumteum.teumteum.util.custom.view.model.Interest import dagger.hilt.android.AndroidEntryPoint +import timber.log.Timber import java.util.Locale @AndroidEntryPoint @@ -39,6 +40,7 @@ class CardFixFragment private lateinit var frontAnimation: AnimatorSet private lateinit var backAnimation: AnimatorSet private var isFront = true + private var isFirstLoaded = true override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) @@ -50,6 +52,7 @@ class CardFixFragment private fun initCard() { with(viewModel) { + Timber.tag("teum-fix").d("initCard called") val fc = CHARACTER_CARD_LIST[characterId.value]?.let { when (community.value) { STATUS_WORKER -> FrontCard(userName.value, "@${companyName.value}", jobDetailClass.value, @@ -190,9 +193,12 @@ class CardFixFragment } } currentList.observe(viewLifecycleOwner) { interests -> - val selfArray = resources.getStringArray(R.array.interest_1) - val fieldArray = resources.getStringArray(R.array.interest_2) - viewModel.setAllInterests(interests.map { it.toString() }, selfArray, fieldArray) + if (!isFirstLoaded) { + val selfArray = resources.getStringArray(R.array.interest_1) + val fieldArray = resources.getStringArray(R.array.interest_2) + viewModel.setAllInterests(interests.map { it.toString() }, selfArray, fieldArray) + } + isFirstLoaded = false } } } From 3d57b28d61de640ccb8dbb40e12b0d3fadbb4642 Mon Sep 17 00:00:00 2001 From: blueme0 Date: Wed, 14 Feb 2024 00:35:12 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[del/#145]=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EB=A1=9C=EA=B7=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../teumteum/teumteum/presentation/signin/SignInViewModel.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/com/teumteum/teumteum/presentation/signin/SignInViewModel.kt b/app/src/main/java/com/teumteum/teumteum/presentation/signin/SignInViewModel.kt index ca029067..362ad873 100644 --- a/app/src/main/java/com/teumteum/teumteum/presentation/signin/SignInViewModel.kt +++ b/app/src/main/java/com/teumteum/teumteum/presentation/signin/SignInViewModel.kt @@ -6,7 +6,6 @@ import com.teumteum.domain.repository.AuthRepository import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow -import timber.log.Timber import javax.inject.Inject @HiltViewModel @@ -20,7 +19,6 @@ class SignInViewModel @Inject constructor( var oauthId = "" fun updateMemberState(socialLoginResult: SocialLoginResult) { - Timber.tag("teum-login").d("${socialLoginResult}") if (socialLoginResult.message == null) { if (!socialLoginResult.accessToken.isNullOrEmpty() && !socialLoginResult.refreshToken.isNullOrEmpty()) { // 기존 회원일 때