-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/tgyuu/#63 #71
Conversation
@Composable | ||
private fun WappAttendanceBadge(isAttendance: Boolean = true) { | ||
val drawableId = if (isAttendance) R.drawable.ic_attendance else R.drawable.ic_absent | ||
Image(painter = painterResource(id = drawableId), contentDescription = "") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ง๊ธ ์ถ์, ๊ฒฐ์ ์ด ๊ทธ๋ฅ ๋ฒกํฐ๋ก ๋ค์ด๊ฐ์ ๊ทธ๋ฐ์ง ๊ธ์๊ฐ ์ ์๋ณด์ฌ์,
์ถํ์ ๊ทธ๋ฅ String + Box๋ก ๋ฐ๊พธ๊ฒ ์ต๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ๊ท์ ๋ง์ ๊ธฐ๋ฅ ๊ตฌํํ๋ค๊ณ ๊ณ ์ ๋ง์ผ์ จ์ด์ ~.
์ค๋ ํ๋ฃจ๋ ํ์ดํ ์ ๋๋ท!
@@ -4,5 +4,6 @@ import java.time.LocalDateTime | |||
import java.time.format.DateTimeFormatter | |||
|
|||
internal fun String.toISOLocalDateTime(): LocalDateTime = LocalDateTime.parse( | |||
this, DateTimeFormatter.ISO_LOCAL_DATE_TIME | |||
this, | |||
DateTimeFormatter.ISO_LOCAL_DATE_TIME, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐คฉ๐๐คฉ๐
@@ -74,23 +69,15 @@ internal fun ManagementScreen( | |||
navigateToSurveyCheck: (String) -> Unit, | |||
) { | |||
val snackBarHostState = remember { SnackbarHostState() } | |||
val surveyList = viewModel.surveyList.collectAsState().value | |||
val eventList = viewModel.eventList.collectAsState().value | |||
val surveysState by viewModel.surveyList.collectAsState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐คฉ๐๐คฉ๐
fun previewManagementScreen() { | ||
WappTheme { | ||
// ManageScreen() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐คฉ๐๐คฉ๐
sealed class SurveysState { | ||
data object Loading : SurveysState() | ||
data class Success(val surveys: List<Survey>) : SurveysState() | ||
data class Failure(val throwable: Throwable) : SurveysState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ Events๋ SurveysState ๋ชจ๋ Failure๋ฅผ ๋นผ๋๊ฒ ๋ซ์ง์์๊น์ ?
errorflow์์ Failure๋ฅผ ๋ค ์ฒ๋ฆฌํ๊ณ ์๊ณ ,
์ฌ์ฉํ์ when ์ ์์๋ Failure๋ฅผ ๋ฐ๋ก ์ฒ๋ฆฌ ์ํ๊ณ ๊ณ์๋ ๋ฐ๋ก ํ์ ์๋ ๊ฒ ๊ฐ์์.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ๋ ์ด ๋ถ๋ถ์ด ์กฐ๊ธ ๋ง์์ ๊ฑธ๋ ธ๋๋ฐ,
when (eventsState) {
is ManagementViewModel.EventsState.Loading -> CircleLoader(
modifier = Modifier
.fillMaxWidth()
.height(200.dp),
)
is ManagementViewModel.EventsState.Success -> {
LazyColumn(
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
itemsIndexed(
items = eventsState.events.takeLast(2),
key = { index, event -> event.eventId },
) { currentIndex, event ->
ManagementEventItem(
item = event,
cardColor = ManagementCardColor(currentIndex = currentIndex),
onCardClicked = { eventId -> onCardClicked(eventId) },
)
}
}
WappButton(
textRes = R.string.event_registration,
onClick = { onAddEventButtonClicked() },
)
}
is ManagementViewModel.EventsState.Failure -> {}
}
์ด๋ ๊ฒ UiState๋ฅผ ๋ถ๊ธฐ๋ก Lottie๋ฐ์์ฃผ๋ ๋ถ๋ถ์์ Failure
๋ก ๋ค์ด์ค๋ฉด ErrorFlow
๋ก SnackBar๋ Toast๋ง ๋์์ฃผ๊ณ ํ๋ฉด์์๋ ์๋ฌด๊ฒ๋ ์ ๋์์ค์
.
๊ทธ๋์ ๋ง์ฝ ๋ฐ์ดํฐ๊ฐ ์ ๋ค์ด์์ ๊ฒฝ์ฐ ํน๋ณํ ๋ถ๊ธฐ ์ฒ๋ฆฌ๋ฅผ ํด์ฃผ๋ ค๊ณ ์ฌ์ง๋ฅผ ๋จ๊ฒจ๋ ๊ฑฐ์์ด์.
์ง๊ธ์ ์ ํฌ๋ผ๋ฆฌ ํ
์คํธํ๋ ๊ฑฐ๋ผ์ Failure
๋ก ๋ค์ด์ค๋ ๊ฒฝ์ฐ๊ฐ ์ ์๊ฒ ์ง๋ง์.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ ๋ก์ง์์ Failure๋ก ๋ฐฉ์ถํ๋ ๊ฐ์ ์กฐ๊ฑด์ ์์ธ๊ฐ ๋ฐ์ํ ๊ฒฝ์ฐ๋ก ์๊ณ ์์ด์ !
์กฐํ๋ฅผ ํ๋๋ฐ ๋น ๊ฐ์ธ ๊ฒฝ์ฐ๋ Success -> data -> isEmpty๋ก ๊ฒ์ฆํด์ผ ํ ๊ฒ ๊ฐ์์
ํ๊ท๋์ด ๋ง์ํ์ ๊ฒ ๋คํธ์ํฌ ๋ถ์์ ์ด๋, ์๋ฒ ๋ถ์์ ๋ฑ์ผ๋ก ๋ฐ์ํ ์คํจ์ ๋ํด
์ฝ๊ฐ ๋ฐฐ๋ฌ์ ๋ฏผ์กฑ์ฒ๋ผ ์ ์ฒด ํ๋ฉด์ "ํ๋ฉด์ ๋ถ๋ฌ์ค์ง ๋ชปํ์ต๋๋ค. "๋ก ์ฑ์ธ๊บผ๋ผ๋ฉด ์์ ๊ฒฝ์ฐ์ฒ๋ผ ์ฒ๋ฆฌํ๋๊ฒ ๋ง์ ๊ฒ ๊ฐ๋ค์.
๊ทธ๋๋ ์ง๊ธ์ ๋ฐ๋ก ์ฒ๋ฆฌ๋ฅผ ์ํ๊ณ ์์ผ๋, ๋นผ๋๊ฒ ์ด๋ป๊ฒ ๋๋๊ฒ ์ฝ๋ฉํธ ๋ด์ฉ์ด์์ต๋๋ค. ํํ
๋ฐ๋ก ์ฌ์ง๋ฅผ ๋จ๊ฒจ๋๋ ๊ฒ๊ณผ ๊ฐ์ ์๋๋๋ฌธ์ด๋ผ๋ฉด ๋๋์
๋ ๋ฌด๋ฐฉํ ๊ฒ ๊ฐ์ต๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋คํธ์ํฌ ๋ถ์์ ์ด๋ ์๋ฒ ๋ถ์์ ์ ๋ํ ์คํจ์ ๊ฒฝ์ฐ ๋ง์ต๋๋ค!
์ถํ์ ๋ฐ๋์ ํด๋น ๋ถ๊ธฐ๋ฅผ ์ฑ์๋๊ฒ ์๋๋ค!
item = survey, | ||
cardColor = ManagementCardColor(currentIndex = currentIndex), | ||
onCardClicked = { surveyId -> onCardClicked(surveyId) }, | ||
when (surveysState) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด๋ค ํญ๋ชฉ์ด ๋ถ๋ฌ์ค๊ณ ์๋์ง ํ์ธํ๊ธฐ ์ํด์
์ผ๋ถ๋ก ์ปฌ๋ผ ์, Title(์ค๋ฌธ, ํ์ฌ) ๋ฐ์ when์ ์ฒ๋ฆฌํ์ ๊ฑฐ์ฃ ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค ์ง๊ธ ์ค๋ฌธ, ํ์ฌ ๊ฐ๊ฐ ๋ก๋ ๊ฐ ๋์๊ฐ๋๋ฐ,
๊ทธ๋ฅ ๋๊ฐ๋ฅผ ํ๋์ ๋ก๋ ๋ก ํฉ์น ์ ์๋๋ฐ ์ด๋ด ๊ฒฝ์ฐ ๋ ์ค์ ํ๋๋ง ์๋ชป ๋ค์ด์๋ ๋ก๋ ๊ฐ ๊ณ์ ๋์๊ฐ์ ์ด๋ ๊ฒ ํ์๋๋ค.....!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ทผ๋ฐ ํน์ ๊ด๋ฆฌ ํ๋ฉด์์ ์คํฌ๋กค ์๋๋ ์ด์ ํด๊ฒฐ ํ๋์ ,,, ??
๊ฐ ์ค๋ฌธ, ์ด๋ฒคํธ ์์ดํ ์ด 2๊ฐ ์ด์์ด๋ฉด ํ๋ฉด์ ์ด๊ณผํ๊ฒ ๋๋๋ฐ, ๋ฐ๋ก ์คํฌ๋กค์ด ์๋๋๋ผ๊ณ ์ ใ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์คํธ ๊ทธ๊ฑฐ ์๋ง๋ LazyColumn
์ด Scrollable์ด๋ผ, ๊ฐ์ฅ ๋ฐ๊นฅ Composable์ Scrollable๋ก ํ๊ฒ ๋๋ฉด
Scrollable ์์ LazyColumn
์ด๋ผ๋ Scrollable์ด ๋ ์๊ธฐ ๋๋ฌธ์ ํฌ๋์๊ฐ ๋ ๊บผ์์.
xml์์ Scrollview์์ RecyclerView๊ฐ ์์ ๊ฒฝ์ฐ, NestedScrollView๋ฅผ ์ฌ์ฉํ๋ ๊ฒ ์ฒ๋ผ์.
์ด๊ฑฐ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ์ด ์์๋๋ฐ ์ข ๊น๋ค๋ก์ ๋ ๊ฑธ๋ก ๊ธฐ์ตํด์. (์ ๋ ์ฐพ์๋ณด๋ค๊ฐ ๊ท์ฐฎ๊ณ ์ด๋ ค์์ ์ ์ ํฌ๊ธฐํ์)
์ง๊ธ์ ์๋๊ณ ๋์ค์ ์ด์ ํ๋ ํ์ ํด๊ฒฐํด๋ณด๊ฒ ์๋๋ค!
sealed class EventsState { | ||
data object Loading : EventsState() | ||
data class Success(val events: List<Event>) : EventsState() | ||
data class Failure(val throwable: Throwable) : EventsState() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํด๋น EventsState์์๋ Failure๋ฅผ ๋ฐ๋ก ์ฒ๋ฆฌ ์ํ์๊ณ ๊ณ์
์
๊ตณ์ด Failure๋ฅผ ๋ง๋์ค ํ์๋ ์๋ ๊ฒ ๊ฐ์์ !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DB์์ ๋ฐ์ดํฐ๋ฅผ ์ ๋๋ก ๊ฐ์ ธ์ค์ง ๋ชปํ๋ ๊ฒฝ์ฐ๋ ์์๊น์ ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์์ ๋ฆฌ๋ทฐ์ ๋ต์ด ๊ฐ์ต๋๋ค !
} | ||
|
||
@Composable | ||
private fun SpannableGuestText() = buildAnnotatedString { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐๐
} | ||
|
||
@Composable | ||
private fun WapAttendance( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํด๋น WapAttendance ๋ณด๋ค๋ AttendanceItem์ ๊ฐ์
์ด๋ค ์ปดํฌ๋ํธ์ธ์ง ํ ์๋ฟ๋ ๋ค๋ฅธ ๋ค์ด๋ฐ ์์๊น์ ,, ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ๋ ProfileAttendanceCard ํํ ๋๋ฆฝ๋๋ค โบโบ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ๋ ๋ง๋ ํ ์์ด๋์ด๋ ์์ผ๋ ๊ทธ๊ฑธ๋ก ๋ฐ๋ก ๊ฐ๊ฒ ์ต๋๋ค!
} | ||
|
||
@Composable | ||
private fun MyAttendanceStatus(modifier: Modifier = Modifier) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My ๋ณด๋ค๋ Profile์ ์ด๋ค ๊ฒ ๊ฐ์์ ??
ProfileAttendanceCard ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ ์ข์ ๊ฒ ๊ฐ์์! ์์ ํด๋จ์ต๋๋ค!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ ์ง๋ค๋ณด๋ ์์๋ ๊ฒน์น๋ค์
๊ทผ๋ฐ ์์๊ฐ ๋ ์ด์ธ๋ฆฌ๋ ๊ฒ ๊ฐ์์,,,,,,,,
MyAttendanceStatus AttendanceStatusColumn ํํ ๋๋ฆฌ๊ฒ ์ต๋๋ค ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MyAttendanceStatus
๋ก ๊ฐ๊ฒ ์ต๋๋ค!
context.getString(R.string.alreay_submitted_description), | ||
) | ||
} | ||
LaunchedEffect(true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ๊ท์ ์ ๋์ ๋ฌธ์ ํ์ ํด์ฃผ์๊ณ , ํด๊ฒฐ๊น์ง ํด์ฃผ์ ์ ๋๋ฌด๋๋ฌด๋๋ฌด (์๊พธ์๊พธ์๊พธ ~~) ๊ฐ์ฌํฉ๋๋ค !!
ํด๋น ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด์ ๋ฐ๋ก Column์ ์๋ฃ์ด์ฃผ์ ๋ ๋๊ตฌ, ์ฌ์ค Scaffold๋ง ์ฌ๋ฆฌ๋๊น ๋๋ค์ฉ !!
๋ฐ๋ก ๊ตฌํํ ์ฝ๋ ๋ถ์ฌ ๋ฃ์ด์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค !
package com.wap.wapp.feature.survey
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.wap.designsystem.WappTheme
import com.wap.designsystem.component.WappTitle
import com.wap.wapp.core.commmon.extensions.toSupportingText
import com.wap.wapp.core.commmon.util.DateUtil.yyyyMMddFormatter
import com.wap.wapp.core.model.survey.SurveyForm
import kotlinx.coroutines.flow.collectLatest
import java.time.Duration
import java.time.LocalDateTime
@Composable
internal fun SurveyScreen(
viewModel: SurveyViewModel,
navigateToSurveyAnswer: (Int) -> Unit,
) {
val context = LocalContext.current
val surveyFormListUiState = viewModel.surveyFormListUiState.collectAsState().value
val snackBarHostState = remember { SnackbarHostState() }
LaunchedEffect(true) {
viewModel.surveyEvent.collectLatest {
when (it) {
is SurveyViewModel.SurveyUiEvent.Failure -> {
snackBarHostState.showSnackbar(it.throwable.toSupportingText())
}
is SurveyViewModel.SurveyUiEvent.AlreadySubmitted -> {
snackBarHostState.showSnackbar(
context.getString(R.string.alreay_submitted_description),
)
}
is SurveyViewModel.SurveyUiEvent.NotSubmitted -> {
navigateToSurveyAnswer(it.eventId)
}
}
}
}
Scaffold(
modifier = Modifier.fillMaxSize(),
containerColor = WappTheme.colors.backgroundBlack,
snackbarHost = { SnackbarHost(snackBarHostState) },
) { paddingValues ->
when (surveyFormListUiState) {
is SurveyViewModel.SurveyFormListUiState.Init -> { }
is SurveyViewModel.SurveyFormListUiState.Success -> {
SurveyContent(
surveyFormList = surveyFormListUiState.surveyFormList,
paddingValues = paddingValues,
selectedSurveyForm = viewModel::isSubmittedSurvey,
)
}
}
}
}
@Composable
private fun SurveyContent(
surveyFormList: List<SurveyForm>,
paddingValues: PaddingValues,
selectedSurveyForm: (Int) -> Unit,
) {
Column(
verticalArrangement = Arrangement.spacedBy(16.dp),
modifier = Modifier
.padding(paddingValues)
.padding(vertical = 16.dp, horizontal = 8.dp),
) {
WappTitle(
title = stringResource(R.string.survey_title),
content = stringResource(R.string.survey_content),
)
LazyColumn(
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
items(surveyFormList) { surveyForm ->
SurveyFormItemCard(
surveyForm = surveyForm,
selectedSurveyForm = selectedSurveyForm,
)
}
}
}
}
@Composable
private fun SurveyFormItemCard(
surveyForm: SurveyForm,
selectedSurveyForm: (Int) -> Unit,
) {
Card(
colors = CardDefaults.cardColors(
containerColor = WappTheme.colors.black25,
),
modifier = Modifier
.fillMaxWidth()
.clickable { selectedSurveyForm(surveyForm.eventId) },
) {
Column(
verticalArrangement = Arrangement.spacedBy(16.dp),
modifier = Modifier
.padding(16.dp),
) {
Row(
modifier = Modifier.fillMaxWidth(),
) {
Text(
text = surveyForm.title,
color = WappTheme.colors.white,
style = WappTheme.typography.titleBold,
)
Text(
text = calculateDeadline(surveyForm.deadline),
color = WappTheme.colors.yellow34,
style = WappTheme.typography.captionMedium,
modifier = Modifier.fillMaxWidth(),
textAlign = TextAlign.End,
)
}
Text(
text = surveyForm.content,
color = WappTheme.colors.grayBD,
style = WappTheme.typography.contentMedium,
)
}
}
}
private fun calculateDeadline(deadline: LocalDateTime): String {
val currentDateTime = LocalDateTime.now()
val duration = Duration.between(currentDateTime, deadline)
if (duration.toMinutes() < 60) {
val leftMinutes = duration.toMinutes().toString()
return leftMinutes + "๋ถ ํ ๋ง๊ฐ"
}
if (duration.toHours() < 24) {
val leftHours = duration.toHours().toString()
return leftHours + "์๊ฐ ํ ๋ง๊ฐ"
}
if (duration.toDays() < 31) {
val leftDays = duration.toDays().toString()
return leftDays + "์ผ ํ ๋ง๊ฐ"
}
return deadline.format(yyyyMMddFormatter) + " ๋ง๊ฐ"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์์ ํด๋จ์ต๋๋ค!
Feature/tgyuu/#70
1. ๐ ๊ด๋ จ๋ ์ด์ ๋ฐ ์๊ฐ
#63
File Changed๊ฐ ๋๋ฌด ์ปค์ง๋ ๊ฒ ๊ฐ์์ ์ผ์ฐจ์ ์ผ๋ก PR๋ ๋ฆฝ๋๋ค.
2. ๐ฅ๋ณ๊ฒฝ๋ ์
- ๋ฐํ ๋ค๋น๊ฒ์ด์ ์ค๋ฌธ ํ์ด์ง ํ๋ฉด ์์์ก๋ค ์ปค์ก๋ค ํ๋ ์ด์ ์์
- ํ๋กํ ํ๋ฉด UI ๊ฐ์
- ํ๋กํ ํ๋ฉด UI ์์ฑ
- ํ๋กํ ๋ ๋ณด๊ธฐ ํ๋ฉด UI ์์ฑ
- ๊ด๋ฆฌ ํ๋ฉด ์ผ์ , ์ค๋ฌธ ๋ฐ์ดํฐ ๋ณ๋ ฌ๋ก ๊ฐ์ ธ์ค๋๋ก ๋ณ๊ฒฝ
- ๊ด๋ฆฌ ํ๋ฉด Lottie ์ ์ฉ
- WappTheme.colors ์์ ์ ๋ฆฌ
3. ๐ธ ์คํฌ๋ฆฐ์ท(์ ํ)
1. ํ๋กํ ํ๋ฉด UI ๊ฐ์
2. WappTheme.colors ์์ ์ ๋ฆฌ
3. ๊ด๋ฆฌ ํ๋ฉด ๋ฐ์ดํฐ ๋ณ๋ ฌ๋ก ๊ฐ์ ธ์ค๋๋ก ๋ณ๊ฒฝ
3-1. ๊ธฐ์กด (๋ฐ์ดํฐ ์์๋๋ก ๊ฐ์ ธ์ด)
3-2. ๋ณ๊ฒฝ (๋ฐ์ดํฐ ๋์์ ๊ฐ์ ธ์ด)
4. ์ค๋ฌธ ํ๋ฉด ์์์ก๋ค๊ฐ ๋ณด์ฌ์ง๋ ์ด์ ์์
5. ๊ด๋ฆฌ ํ์ด์ง Lottie ์ ์ฉ
6. ํ๋กํ ํ๋ฉด ๋นํ์ ํ๋ฉด
๋ก๊ทธ์ธ ํ์ ๋ ํ๋ฉด์ ์ ์์งค์์ ๋ง์ด ๋ณด์ด๋ฏ๋ก ๋ฐ๋ก ์ฌ๋ฆฌ์ง ์๊ฒ ์ต๋๋ค!
์ ํ๋ฉด์์ ๋ก๊ทธ์ธ ํ๊ธฐ ๋ฒํผ์ ๋๋ฅด๋ฉด ์ด๊ธฐ SignIn ํ๋ฉด์ผ๋ก ๋์๊ฐ๋๋ค.
๋ค๋ก๊ฐ๊ธฐ๋ฅผ ๋๋ฅด๋ฉด ๋ค์ ํด๋น ํ๋ฉด์ผ๋ก ๋์์ต๋๋ค.
์์งค์ฐ๊ธฐ ๊ท์ฐฎ์์ ์์ฌ๋ ธ์ต๋๋ค. ํํ
7. ํ๋กํ ๋ ๋ณด๊ธฐ ํ๋ฉด
์ข์ธก ์๋จ ํ์ดํ ๋๋ฅด๋ฉด ๋น์ฐํ๊ฒ ์ง๋ง ํ๋กํ ํ๋ฉด์ผ๋ก ๋์๊ฐ๋๋ค.
4. ๐ก์๊ฒ๋ ํน์ ๊ถ๊ธํ ์ฌํญ๋ค
1. compose์์ Span ์ ์ฉ
์ ๊ฐ์ด
buildAnnotatedString
์ ์ฌ์ฉํ์ฌ Span์ ์ ์ฉํ ์ ์์.์ถ์ฒ : Compose ๋ก Span ์ฃผ๋ ๋ฐฉ๋ฒ
2. ์ฝ๋ฃจํด์ผ๋ก ๋ฐ์ดํฐ๋ฅผ ์ฌ๋ฌ ๊ฐ ๊ฐ์ ธ์ฌ ๋ ๋ณ๋ ฌ์ ์ผ๋ก ๋์์ ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ
๋ฅผ
์ผ๋ก ์์ ํ๋ฉด ๋ฐ์ดํฐ๋ฅผ ๋์์ ๋ณ๋ ฌ์ ์ผ๋ก ๊ฐ์ ธ์ฌ ์ ์์.
์ถ์ฒ : ์ฝํ๋ฆฐ ์ฝ๋ฃจํด ์์
๋ธ๋ก๊ทธ์ ์ ๋ฆฌํด๋ดค์๋๋ค.
3. ์งํธ๋์ด ์์ ํ์ จ๋ ์ค๋ฌธ ํ์ด์ง ๋ค๋น๊ฒ์ด์ ์์ ์ด๋ ์ ํ๋ฉด์ด ์์์ก๋ค ์ปค์ก๋ค ํ๋ ์ด์
์๋ ์์ ์ฒ๋ผ ์์ ์ด ๋์ด์์๋๋ฐ,
SurveyFormListUiState
๋ฅผ ViewModel์์Success
๋ก ๊ฐ์ ธ์ฌ ๋ ๊น์ง ํ๋ฉด์ ์๋ฌด๊ฒ๋ ๋ฐ์์ฃผ์ง ์์์.๊ทธ๋์ Compose์์ ๋์์ค ํ๋ฉด์ด ์๋ค๊ณ ํ๋จํ๊ณ ํ๋ฉด์ ๋ณด์ฌ์ฃผ์ง ์์์.
์ดํ,
Success
๋ฅผ ๊ฐ์ ธ์ค๋ฉด ๋ค์ ํ๋ฉด์ ๋์์ฃผ๋ฏ๋ก ์์์ก๋ค ์ปค์ง๋ ๊ฒ์ฒ๋ผ ๋ณด์์ต๋๋ค.๊ทธ๋ฅ ๋จ์ํ ์์ ์ฝ๋๋ฅผ
Column(modifier.fillMaxSize())
๋ก ๋ฌถ์ด์ฃผ๋ฉด ๋์ด์์.๊ทธ๋ฌ๋ฉด ViewModel์์
Success
๋ฅผ ๊ฐ์ ธ์ค์ง ์๋๋ผ๋, ๋น ํ๋ฉด์ ๋์์ฃผ๋๊น ํ๋ฉด์ด ์์์ง๋ ์ด์๊ฐ ์ฌ๋ผ์ง๋๋ค!(๋น ํ๋ฉด์ด๋ผ๋ ๊ฝ ์ฐจ์๊ธฐ ๋๋ฌธ์ ์์์ง๋ ํ์์ด ์ฌ๋ผ์ ธ์)
๊ทธ๋ฆฌ๊ณ , ์ด ๋น ํ๋ฉด์ ์๊ฐ์ ๋ผ์์ฃผ๊ธฐ ์ํด์ CircleLoader Lottie๋ฅผ ๋ฃ์ด๋จ์ต๋๋ค.
4. LazyColumn ์ธ ๋, items ์์ key
์ด๊ฑด ๋ญ ๋ณ ๊ฑฐ ์์ต๋๋ค. xml์ธ ๋ RecyclerView๋ ListAdapter์ฐจ์ด๋ ๋๊ฐ์์.
๋ ํผ๋ฐ์ค
์์ง ํ๋กํ ํ๋ฉด์์ ์ ์ ์ ๋ณด, ์ ์ ๊ฐ ๋นํ์, ํ์, ์ด์์ง์ธ์ง ํ๋จ, ๋์ ์ถ๊ฒฐ ํํฉ, ๋์ ์ถ์ ์ ๊ตฌํํ์ง ๋ชปํ์ด์.
์ ์ ์ ๋ณด๋ฅผ ์ด๋ป๊ฒ ๊ฐ์ ธ์ค๋ ์ง ๋ชฐ๋ผ์ ๊ตฌํ๋์ด์๋ ์ง ๋ชฐ๋ผ์ ๋ณด๋ฅํ์ต๋๋ค์.