Skip to content

Commit

Permalink
[UI] MissionProcess 변경된 TimeStap 형식 적용 (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
KxxHyoRim authored and 915dbfl committed Mar 8, 2024
1 parent c05c30a commit d995509
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import android.text.SpannableString
import java.io.Serializable

data class MissionProcessInfoUI(
val waitingForPaymentDate: String?,
val waitingForPaymentDate: SpannableString?,
val waitingForPaymentDetail: SpannableString? = null,
val paymentConfirmationDate: String?,
val paymentConfirmationDate: SpannableString?,
val paymentConfirmationDetail: SpannableString? = null,
val missionProceedingDate: String?,
val missionProceedingDate: SpannableString?,
val missionProceedingDetail: SpannableString? = null,
val codeReviewDate: String?,
val codeReviewDate: SpannableString?,
val codeReviewDetail: SpannableString? = null,
val missionFinishedDate: String?,
val feedbackReviewedDate: String?,
val missionFinishedDate: SpannableString?,
val feedbackReviewedDate: SpannableString?,
val depositorName: String? = null,
) : Serializable
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,25 @@ fun createRedSpannableText(text: String, redTextStart: Int, redTextEnd: Int): Sp
return spannableText
}

fun createLgtmDateTimeSpannable(localDateTime: LocalDateTime?): SpannableString {
return when (localDateTime) {
null -> SpannableString("-")

else -> {
val time = localDateTime.format(korean12HourTimeFormatter)
val date = localDateTime.format(dotStyleDateFormatter)
val spannableText = SpannableString("$date | $time")
spannableText.setSpan(
ForegroundColorSpan(Color.parseColor(LGTM_GRAY_3)),
date.length + 1,
date.length + 2,
Spannable.SPAN_EXCLUSIVE_INCLUSIVE
)
spannableText
}
}
}

fun MissionProcessInfoVO.toUiModel(
role: Role,
processStatus: ProcessState,
Expand Down Expand Up @@ -198,12 +217,12 @@ fun MissionProcessInfoVO.toUiModel(
else null

return MissionProcessInfoUI(
waitingForPaymentDate = waitingForPaymentDate,
paymentConfirmationDate = paymentConfirmationDate,
missionProceedingDate = missionProceedingDate,
codeReviewDate = codeReviewDate,
feedbackReviewedDate = feedbackReviewedDate,
missionFinishedDate = missionFinishedDate,
waitingForPaymentDate = createLgtmDateTimeSpannable(waitingForPaymentDate),
paymentConfirmationDate = createLgtmDateTimeSpannable(paymentConfirmationDate),
missionProceedingDate = createLgtmDateTimeSpannable(missionProceedingDate),
codeReviewDate = createLgtmDateTimeSpannable(codeReviewDate),
feedbackReviewedDate = createLgtmDateTimeSpannable(feedbackReviewedDate),
missionFinishedDate = createLgtmDateTimeSpannable(missionFinishedDate),
waitingForPaymentDetail = waitingForPaymentDetail,
paymentConfirmationDetail = paymentConfirmationDetail,
missionProceedingDetail = missionProceedingDetail,
Expand Down
12 changes: 6 additions & 6 deletions domain/src/main/java/com/lgtm/domain/usecase/MissionUseCase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ class MissionUseCase @Inject constructor(

private fun formattingTimestamps(missionProcessInfo: MissionProcessInfoVO): MissionProcessInfoVO {
return missionProcessInfo.copy(
waitingForPaymentDate = convertTimestampToCustomFormat(missionProcessInfo.waitingForPaymentDate),
paymentConfirmationDate = convertTimestampToCustomFormat(missionProcessInfo.paymentConfirmationDate),
missionProceedingDate = convertTimestampToCustomFormat(missionProcessInfo.missionProceedingDate),
codeReviewDate = convertTimestampToCustomFormat(missionProcessInfo.codeReviewDate),
missionFinishedDate = convertTimestampToCustomFormat(missionProcessInfo.missionFinishedDate),
feedbackReviewedDate = convertTimestampToCustomFormat(missionProcessInfo.feedbackReviewedDate)
waitingForPaymentDate = missionProcessInfo.waitingForPaymentDate,
paymentConfirmationDate = missionProcessInfo.paymentConfirmationDate,
missionProceedingDate = missionProcessInfo.missionProceedingDate,
codeReviewDate = missionProcessInfo.codeReviewDate,
missionFinishedDate = missionProcessInfo.missionFinishedDate,
feedbackReviewedDate = missionProcessInfo.feedbackReviewedDate
)
}

Expand Down

0 comments on commit d995509

Please sign in to comment.