Skip to content
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

๐Ÿ”€ :: (#236) - ํ”„๋กœ๊ทธ๋žจ ๊ด€๋ฆฌ ํŽ˜์ด์ง€์˜ UI๊ฐ€ ๋””์ž์ธ ์š”๊ตฌ์‚ฌํ•ญ๊ณผ ๋งž์ง€์•Š์€ ๋ถ€๋ถ„์ด ์กด์žฌํ•˜์—ฌ ํ•ด๋‹น ๋ถ€๋ถ„์„ ์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค. #237

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ internal fun HomeDetailProgramParticipantScreen(
.padding(vertical = 16.dp)
) {
Row(
horizontalArrangement = Arrangement.spacedBy(20.dp),
modifier = Modifier
.fillMaxWidth()
.padding(start = 16.dp)
.horizontalScroll(rememberScrollState()),
horizontalArrangement = Arrangement.spacedBy(20.dp)
.horizontalScroll(rememberScrollState())
) {
Spacer(modifier = Modifier.width(20.dp))

Expand Down Expand Up @@ -256,5 +256,13 @@ internal fun HomeDetailProgramParticipantScreen(
@Preview
@Composable
private fun HomeDetailProgramParticipantScreenPreview() {

HomeDetailProgramParticipantScreen(
id = 0,
onBackClick = {},
teacherTrainingProgramListUiState = TeacherTrainingProgramListUiState.Loading,
swipeRefreshState = rememberSwipeRefreshState(isRefreshing = false),
getTeacherTrainingProgramList = {},
navigateToQrScanner = { _, _ -> },
traineeId = -1L
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.school_of_company.home.view

import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -10,10 +13,13 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.PagerState
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.TabRow
import androidx.compose.material3.TabRowDefaults
import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset
Expand All @@ -25,7 +31,6 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
Expand All @@ -36,7 +41,9 @@ import com.google.accompanist.swiperefresh.SwipeRefreshState
import com.google.accompanist.swiperefresh.rememberSwipeRefreshState
import com.school_of_company.design_system.component.modifier.clickable.expoClickable
import com.school_of_company.design_system.component.topbar.ExpoTopBar
import com.school_of_company.design_system.icon.ExpoIcon
import com.school_of_company.design_system.icon.LeftArrowIcon
import com.school_of_company.design_system.icon.WarnIcon
import com.school_of_company.design_system.theme.ExpoAndroidTheme
import com.school_of_company.home.view.component.ProgramList
import com.school_of_company.home.view.component.ProgramTabRowItem
Expand Down Expand Up @@ -64,7 +71,6 @@ internal fun HomeDetailProgramRoute(


HomeDetailProgramScreen(
id = id,
onBackClick = onBackClick,
navigateToProgramDetail = navigateToProgramDetail,
trainingProgramUiState = trainingProgramListUiState,
Expand All @@ -82,7 +88,6 @@ internal fun HomeDetailProgramRoute(

@Composable
internal fun HomeDetailProgramScreen(
id: String,
modifier: Modifier = Modifier,
swipeRefreshState: SwipeRefreshState,
trainingProgramUiState: TrainingProgramListUiState,
Expand All @@ -92,7 +97,8 @@ internal fun HomeDetailProgramScreen(
onBackClick: () -> Unit,
navigateToProgramDetail: (Long) -> Unit,
getTrainingProgramList: () -> Unit,
getStandardProgramList: () -> Unit
getStandardProgramList: () -> Unit,
scrollState: ScrollState = rememberScrollState()
audgns10 marked this conversation as resolved.
Show resolved Hide resolved
) {
ExpoAndroidTheme { colors, typography ->
Column(
Expand Down Expand Up @@ -156,33 +162,54 @@ internal fun HomeDetailProgramScreen(
horizontal = 16.dp,
vertical = 16.dp
)
.horizontalScroll(scrollState)
audgns10 marked this conversation as resolved.
Show resolved Hide resolved
) {

Row(verticalAlignment = Alignment.CenterVertically) {

Spacer(modifier = Modifier.weight(0.5f))
Spacer(modifier = Modifier.width(62.dp))

Text(
text = "ํ”„๋กœ๊ทธ๋žจ",
style = typography.captionBold1,
color = colors.gray600,
modifier = Modifier.weight(2f)
modifier = Modifier.width(100.dp)
)

Text(
text = "์„ ํƒ",
style = typography.captionBold1,
color = colors.gray600,
textAlign = TextAlign.Center,
modifier = Modifier.weight(1f)
)
Spacer(modifier = Modifier.width(64.dp))

Text(
text = "ํ•„์ˆ˜",
style = typography.captionBold1,
color = colors.gray600,
textAlign = TextAlign.Center,
modifier = Modifier.weight(1f)
)
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(64.dp, Alignment.End)
) {
Text(
text = "์‹œ์ž‘์‹œ๊ฐ„",
style = typography.captionBold1,
color = colors.gray600,
modifier = Modifier.width(150.dp)
)

Text(
text = "์ข…๋ฃŒ์‹œ๊ฐ„",
style = typography.captionBold1,
color = colors.gray600,
modifier = Modifier.width(150.dp)
)

Text(
text = "์„ ํƒ",
style = typography.captionBold1,
color = colors.gray600,
modifier = Modifier.width(25.dp)
)

Text(
text = "ํ•„์ˆ˜",
style = typography.captionBold1,
color = colors.gray600,
modifier = Modifier.width(25.dp)
)
}
}
}

Expand Down Expand Up @@ -211,8 +238,50 @@ internal fun HomeDetailProgramScreen(
navigateToProgramDetail = navigateToProgramDetail
)
}
is StandardProgramListUiState.Empty -> Unit
is StandardProgramListUiState.Error -> Unit

is StandardProgramListUiState.Empty -> {
Column(
verticalArrangement = Arrangement.spacedBy(28.dp, Alignment.CenterVertically),
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.fillMaxSize()
.verticalScroll(scrollState)
.background(color = colors.white)
) {
ExpoIcon(
tint = colors.black,
modifier = Modifier.size(100.dp)
)
Text(
text = "์•„์ง ์ผ๋ฐ˜ ํ”„๋กœ๊ทธ๋žจ์ด ๋“ฑ์žฅํ•˜์ง€ ์•Š์•˜์•„์š”..",
style = typography.bodyRegular2,
color = colors.gray400
)
}
}
is StandardProgramListUiState.Error -> {
Column(
verticalArrangement = Arrangement.spacedBy(
28.dp,
Alignment.CenterVertically
),
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.fillMaxSize()
.background(color = colors.white)
.verticalScroll(scrollState)
) {
WarnIcon(
tint = colors.black,
modifier = Modifier.size(100.dp)
)
Text(
text = "๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ฌ ์ˆ˜ ์—†์–ด์š”!",
style = typography.bodyRegular2,
color = colors.gray400
)
}
}
}
}

Expand All @@ -226,8 +295,49 @@ internal fun HomeDetailProgramScreen(
)
}

is TrainingProgramListUiState.Empty -> Unit
is TrainingProgramListUiState.Error -> Unit
is TrainingProgramListUiState.Empty -> {
Column(
verticalArrangement = Arrangement.spacedBy(28.dp, Alignment.CenterVertically),
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.fillMaxSize()
.verticalScroll(scrollState)
.background(color = colors.white)
) {
ExpoIcon(
tint = colors.black,
modifier = Modifier.size(100.dp)
)
Text(
text = "์•„์ง ์—ฐ์ˆ˜ ํ”„๋กœ๊ทธ๋žจ์ด ๋“ฑ์žฅํ•˜์ง€ ์•Š์•˜์•„์š”..",
style = typography.bodyRegular2,
color = colors.gray400
)
}
}
is TrainingProgramListUiState.Error -> {
Column(
verticalArrangement = Arrangement.spacedBy(
28.dp,
Alignment.CenterVertically
),
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.fillMaxSize()
.background(color = colors.white)
.verticalScroll(scrollState)
) {
WarnIcon(
tint = colors.black,
modifier = Modifier.size(100.dp)
)
Text(
text = "๋ฐ์ดํ„ฐ๋ฅผ ๋ถˆ๋Ÿฌ์˜ฌ ์ˆ˜ ์—†์–ด์š”!",
style = typography.bodyRegular2,
color = colors.gray400
)
}
}
}
}
}
Expand All @@ -243,7 +353,6 @@ private fun HomeDetailProgramScreenPreview() {
HomeDetailProgramScreen(
onBackClick = {},
navigateToProgramDetail = {},
id = "",
trainingProgramUiState = TrainingProgramListUiState.Loading,
standardProgramListUiState = StandardProgramListUiState.Loading,
swipeRefreshState = rememberSwipeRefreshState(isRefreshing = false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ fun HomeDetailProgramParticipantListItem(

Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(20.dp),
modifier = modifier
.fillMaxWidth()
.padding(vertical = 8.dp)
.horizontalScroll(horizontalScrollState),
horizontalArrangement = Arrangement.spacedBy(20.dp)
.horizontalScroll(horizontalScrollState)
) {
Text(
text = index.toString(),
Expand Down Expand Up @@ -81,4 +81,17 @@ fun HomeDetailProgramParticipantListItem(
@Preview
@Composable
private fun HomeDetailProgramParticipantListItemPreview() {
HomeDetailProgramParticipantListItem(
index = 1,
data = TeacherTrainingProgramResponseEntity(
id = 0,
name = "ํ™๊ธธ๋™",
organization = "ํ•œ๊ตญ๋Œ€ํ•™๊ต",
position = "๊ต์‚ฌ",
programName = "ํ”„๋กœ๊ทธ๋žจ",
status = true,
entryTime = "2024-09-12 T 08:30",
leaveTime = "2024-09-12 T 08:30"
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,16 @@ fun StandardProgramList(
@Preview
@Composable
private fun ProgramListPreview() {
ProgramList(
trainingItem = persistentListOf(
TrainingProgramListResponseEntity(
id = 0,
title = "title",
startedAt = "startedAt",
endedAt = "endedAt",
category = "ESSENTIAL"
)
),
navigateToProgramDetail = {}
)
}
Loading
Loading