Skip to content

Commit

Permalink
#197 뉴스 기능 화면 전환 및 데이터 표시 처리 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
pknujsp committed Aug 10, 2023
1 parent 0602c5b commit 8ab478b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.android.mediproject.feature.news

import java.time.format.DateTimeFormatter

internal val listDateTimeFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd E")
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.android.mediproject.core.ui.compose.CenterProgressIndicator
import com.android.mediproject.feature.news.R
import com.android.mediproject.feature.news.customui.CardBox
import com.android.mediproject.feature.news.customui.Header
import com.android.mediproject.feature.news.listDateTimeFormat

@Composable
fun DetailAdminActionScreen(
Expand Down Expand Up @@ -97,7 +98,7 @@ fun Item(adminAction: AdminAction) {
Header(text = stringResource(id = R.string.adminActionDate))
Spacer(modifier = Modifier.height(6.dp))
Text(
text = adminAction.adminActionDate.value.toString(),
text = adminAction.adminActionDate.value.format(listDateTimeFormat),
style = TextStyle(
fontSize = 16.sp,
lineHeight = 16.sp,
Expand Down Expand Up @@ -231,7 +232,7 @@ fun Item(adminAction: AdminAction) {
Header(text = stringResource(id = R.string.disclosureEndDate))
Spacer(modifier = Modifier.height(6.dp))
Text(
text = adminAction.disclosureEndDate.value.toString(),
text = adminAction.disclosureEndDate.value.format(listDateTimeFormat),
style = TextStyle(
fontSize = 16.sp,
lineHeight = 16.sp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.android.mediproject.core.ui.compose.CenterProgressIndicator
import com.android.mediproject.feature.news.R
import com.android.mediproject.feature.news.customui.CardBox
import com.android.mediproject.feature.news.customui.Header
import com.android.mediproject.feature.news.listDateTimeFormat
import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
import com.bumptech.glide.integration.compose.GlideImage

Expand Down Expand Up @@ -85,9 +86,11 @@ fun Item(detailRecallSuspension: DetailRecallSuspension) {
modifier = Modifier.fillMaxWidth(),
shape = RectangleShape,
) {
Column(modifier = Modifier
.padding(horizontal = 24.dp)
.verticalScroll(state = rememberScrollState())) {
Column(
modifier = Modifier
.padding(horizontal = 24.dp)
.verticalScroll(state = rememberScrollState()),
) {
ConstraintLayout(modifier = Modifier.fillMaxWidth()) {
val (header, product, image) = createRefs()

Expand Down Expand Up @@ -155,7 +158,7 @@ fun Item(detailRecallSuspension: DetailRecallSuspension) {
Header(text = stringResource(id = R.string.recallCommandDate))
Spacer(modifier = Modifier.height(6.dp))
Text(
text = detailRecallSuspension.recallCommandDate.value.toString(),
text = detailRecallSuspension.recallCommandDate.value.format(listDateTimeFormat),
style = TextStyle(
fontSize = 16.sp,
lineHeight = 16.sp,
Expand Down Expand Up @@ -218,7 +221,7 @@ fun Item(detailRecallSuspension: DetailRecallSuspension) {
Header(text = stringResource(id = R.string.disclosureEndDate))
Spacer(modifier = Modifier.height(6.dp))
Text(
text = detailRecallSuspension.openEndDate.value.toString(),
text = detailRecallSuspension.openEndDate.value.format(listDateTimeFormat),
style = TextStyle(
fontSize = 16.sp,
lineHeight = 16.sp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.android.mediproject.core.model.news.recall.RecallSaleSuspension
import com.android.mediproject.core.ui.compose.CenterProgressIndicator
import com.android.mediproject.feature.news.R
import com.android.mediproject.feature.news.customui.ListItemScreen
import com.android.mediproject.feature.news.listDateTimeFormat
import com.android.mediproject.feature.news.rememberListState
import com.android.mediproject.feature.news.restoreListState
import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
Expand Down Expand Up @@ -174,7 +175,9 @@ fun ItemOnList(recallSaleSuspension: RecallSaleSuspension) {

// 날짜
Text(
text = if (recallSaleSuspension.recallCommandDate.isEmpty) recallSaleSuspension.retrievalCommandDate.value.toString() else recallSaleSuspension.recallCommandDate.value.toString(),
text = if (recallSaleSuspension.recallCommandDate.isEmpty) recallSaleSuspension.retrievalCommandDate.value.format(listDateTimeFormat) else recallSaleSuspension.recallCommandDate.value.format(
listDateTimeFormat,
),
textAlign = TextAlign.Right,
modifier = Modifier
.constrainAs(date) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import com.android.mediproject.core.ui.compose.CenterProgressIndicator
import com.android.mediproject.feature.news.R
import com.android.mediproject.feature.news.customui.CardBox
import com.android.mediproject.feature.news.customui.Header
import com.android.mediproject.feature.news.listDateTimeFormat


@Composable
Expand Down Expand Up @@ -94,7 +95,7 @@ fun Item(safetyNotification: SafetyNotification) {
Header(text = stringResource(id = R.string.publicationDate))
Spacer(modifier = Modifier.height(6.dp))
Text(
text = safetyNotification.publicationDate.value.toString(),
text = safetyNotification.publicationDate.value.format(listDateTimeFormat),
style = TextStyle(
fontSize = 18.sp,
lineHeight = 16.sp,
Expand All @@ -117,7 +118,7 @@ fun Item(safetyNotification: SafetyNotification) {
lineHeight = 16.sp,
fontWeight = FontWeight(500),
color = Color(0xFF595959),
textAlign = TextAlign.Right,
textAlign = TextAlign.Left,
),
)

Expand All @@ -126,7 +127,7 @@ fun Item(safetyNotification: SafetyNotification) {
Spacer(modifier = Modifier.height(6.dp))

Text(
text = "❍ 식품의약품안전처는 한국휴텍스제약㈜에 대한 현장조사 결과, ‘레큐틴정’ 등 6개 품목이 허가 또는 신고된 사항과 다르게 제조되고 있는 사실이 확인됨에 따라 사전 예방적 차원에서 잠정 제조·판매 중지를 명령하고 해당 품목에 대하여 회수 조치함. ❍ 의․약전문가는 동 정보사항에 유의하여 해당 제품의 처방 및 사용을 중지하고 필요시 대체의약품을 사용하여 주실 것을 당부드리며, ❍ 아울러 해당 유통품 회수가 적절히 수행될 수 있도록 적극 협조하여 주시기 바람",
text = safetyNotification.informationDetails,
style = TextStyle(
fontSize = 16.sp,
lineHeight = 20.sp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.android.mediproject.core.model.news.safetynotification.SafetyNotifica
import com.android.mediproject.core.ui.compose.CenterProgressIndicator
import com.android.mediproject.feature.news.R
import com.android.mediproject.feature.news.customui.ListItemScreen
import com.android.mediproject.feature.news.listDateTimeFormat
import com.android.mediproject.feature.news.rememberListState
import com.android.mediproject.feature.news.restoreListState

Expand Down Expand Up @@ -130,7 +131,7 @@ fun ItemOnList(safetyNotification: SafetyNotification) {

// 날짜
Text(
text = safetyNotification.publicationDate.value.toString(),
text = safetyNotification.publicationDate.value.format(listDateTimeFormat),
textAlign = TextAlign.Right,
modifier = Modifier.constrainAs(date) {
start.linkTo(title.end, 8.dp)
Expand Down

0 comments on commit 8ab478b

Please sign in to comment.