Skip to content

Commit

Permalink
Merge pull request #538 from 014967/fix/card_navigation
Browse files Browse the repository at this point in the history
카드 네비게이션  & 알림을 읽지 못하는 이슈 수정
  • Loading branch information
Sookhee authored Sep 4, 2024
2 parents 9d13272 + 459758a commit f28b784
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MoreMenuViewModel @Inject constructor(
viewModelScope.launch {
val rnb: Flow<Response<RnbResponse>> = flow { emit(metaRepository.getRnb()) }
val notice: Flow<Response<PushHistoryResponse>> =
flow { emit(pushHistoryRepository.getPushHistory(page = 1, size = 1)) }
flow { emit(pushHistoryRepository.getPushHistory(page = 0, size = 1)) }

combine(rnb, notice) { rnbFlow, noticeFlow ->
rnbFlow to noticeFlow
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/mashup/ui/notice/NoticeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class NoticeActivity : ComponentActivity() {
modifier = Modifier.fillMaxSize(),
noticeState = noticeState,
onBackPressed = noticeViewModel::onBackPressed,
onClickNoticeItem = noticeViewModel::onClickNoticeItem
onClickNoticeItem = noticeViewModel::onClickNoticeItem,
onLoadNextNotice = noticeViewModel::onLoadNextNotice
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/mashup/ui/notice/NoticeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NoticeViewModel @Inject constructor(
private val _noticeEvent = MutableSharedFlow<NoticeSideEffect>()
val noticeEvent = _noticeEvent.asSharedFlow()

private var _currentPage = MutableStateFlow(1)
private var _currentPage = MutableStateFlow(0)

init {
viewModelScope.launch {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/mashup/ui/schedule/ScheduleRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ fun ScheduleRoute(
scheduleState = scheduleState,
dailyListState = dailyListState,
onClickScheduleInformation = { id, type -> context.moveToScheduleInformation(id, type) },
onClickAttendance = { context.moveToAttendance(it) },
onClickMashongButton = {
AnalyticsManager.addEvent(eventName = LOG_EVENT_LIST_WEEK_MASHONG)
context.moveToMashong()
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/com/mashup/ui/schedule/ScheduleScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ fun ScheduleScreen(
modifier: Modifier = Modifier,
scheduleType: ScheduleType = ScheduleType.WEEK,
onClickScheduleInformation: (Int, String) -> Unit = { _, _ -> },
onClickAttendance: (Int) -> Unit = {},
onClickMashongButton: () -> Unit = {},
makeToast: (String) -> Unit = {},
refreshState: Boolean = false
Expand All @@ -43,7 +42,6 @@ fun ScheduleScreen(
)
onClickScheduleInformation(scheduleId, type)
},
onClickAttendance = onClickAttendance,
onClickMashongButton = onClickMashongButton,
makeToast = makeToast,
refreshState = refreshState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ fun WeeklySchedule(
scheduleState: ScheduleState,
modifier: Modifier = Modifier,
onClickScheduleInformation: (Int, String) -> Unit = { _, _ -> },
onClickAttendance: (Int) -> Unit = {},
onClickMashongButton: () -> Unit = {},
makeToast: (String) -> Unit = {},
refreshState: Boolean = false
Expand Down Expand Up @@ -104,7 +103,6 @@ fun WeeklySchedule(
},
data = data,
onClickScheduleInformation = onClickScheduleInformation,
onClickAttendance = onClickAttendance,
makeToast = makeToast
)
}
Expand All @@ -121,8 +119,7 @@ fun WeeklySchedule(
scaleY = 1 - 0.1f * abs(pageOffset)
},
data = data,
onClickScheduleInformation = onClickScheduleInformation,
onClickAttendance = onClickAttendance
onClickScheduleInformation = onClickScheduleInformation
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ import java.util.Date
fun ScheduleViewPagerInProgressItem(
data: ScheduleCard.InProgressSchedule,
modifier: Modifier = Modifier,
onClickScheduleInformation: (Int, String) -> Unit = { _, _ -> },
onClickAttendance: (Int) -> Unit = {}
onClickScheduleInformation: (Int, String) -> Unit = { _, _ -> }
) {
val textColor by remember { mutableStateOf(data.scheduleResponse.scheduleType.getButtonTextColor()) }
Column(
Expand Down Expand Up @@ -169,7 +168,7 @@ fun ScheduleViewPagerInProgressItem(
)
setPadding(12, 0, 0, 0)
setOnClickListener {
onClickAttendance(data.scheduleResponse.scheduleId)
onClickScheduleInformation(data.scheduleResponse.scheduleId, data.scheduleResponse.scheduleType)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ fun ScheduleViewPagerSuccessItem(
data: ScheduleCard.EndSchedule,
modifier: Modifier = Modifier,
onClickScheduleInformation: (Int, String) -> Unit = { _, _ -> },
onClickAttendance: (Int) -> Unit = {},
makeToast: (String) -> Unit = {}
) {
val context = LocalContext.current
Expand Down Expand Up @@ -217,7 +216,10 @@ fun ScheduleViewPagerSuccessItem(
)
setPadding(12, 0, 0, 0)
setOnClickListener {
onClickAttendance(data.scheduleResponse.scheduleId)
onClickScheduleInformation(
data.scheduleResponse.scheduleId,
data.scheduleResponse.scheduleType
)
}
}
}
Expand Down Expand Up @@ -310,7 +312,10 @@ fun ScheduleViewPagerSuccessItem(
)
setPadding(12, 0, 0, 0)
setOnClickListener {
onClickAttendance(data.scheduleResponse.scheduleId)
onClickScheduleInformation(
data.scheduleResponse.scheduleId,
data.scheduleResponse.scheduleType
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.mashup.core.network.dto

import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class PushHistoryResponse(
val read: List<Notice>,
val unread: List<Notice>
) {
@JsonClass(generateAdapter = true)
data class Notice(
val pushType: String,
val title: String,
Expand Down

0 comments on commit f28b784

Please sign in to comment.