Skip to content

Commit

Permalink
[MERGE] : #145 -> main
Browse files Browse the repository at this point in the history
�[FEAT] 유저 리뷰 알림과 연결
  • Loading branch information
blueme0 authored Feb 13, 2024
2 parents da12778 + 3d57b28 commit 029bd45
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,10 @@ class MainActivity : BindingActivity<ActivityMainBinding>(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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()) {
// 기존 회원일 때
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -205,12 +206,14 @@ class SignUpViewModel @Inject constructor(
}

fun setAllInterests(interests: List<String>, selfResource: Array<String>, fieldResource: Array<String>) {
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<String>("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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,
Expand Down Expand Up @@ -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
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -121,5 +125,6 @@ class SplashActivity

const val IS_FROM_ALARM = "isFromAlarm"
const val MESSAGE = "message"
private const val END_MEETING = "END_MEETING"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ data class Message(
var title: String,
var body: String,
var type: String,
var meetingId: Int? = -1,
var participants: List<Int>? = listOf()
var meetingId: Long? = null,
var participants: List<Int>? = null
): java.io.Serializable

0 comments on commit 029bd45

Please sign in to comment.