diff --git a/presentation/src/main/java/com/msg/presentation/view/component/DotoriTopBar.kt b/presentation/src/main/java/com/msg/presentation/view/component/DotoriTopBar.kt new file mode 100644 index 00000000..cd748429 --- /dev/null +++ b/presentation/src/main/java/com/msg/presentation/view/component/DotoriTopBar.kt @@ -0,0 +1,29 @@ +package com.msg.presentation.view.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.dotori.dotori_components.components.toggle.DotoriThemeSwitchButton +import com.dotori.dotori_components.theme.DotoriText +import com.dotori.dotori_components.theme.DotoriTheme + +@Composable +fun DotoriTopBar(onSwitchClick: (Boolean) -> Unit) { + Row( + modifier = Modifier + .fillMaxWidth() + .background(DotoriTheme.colors.cardBackground) + .padding(horizontal = 20.dp, vertical = 12.dp), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + DotoriText() + DotoriThemeSwitchButton(onSwitchClick = onSwitchClick) + } +} \ No newline at end of file diff --git a/presentation/src/main/java/com/msg/presentation/view/massage_chair/MassageChairScreen.kt b/presentation/src/main/java/com/msg/presentation/view/massage_chair/MassageChairScreen.kt new file mode 100644 index 00000000..d66980e9 --- /dev/null +++ b/presentation/src/main/java/com/msg/presentation/view/massage_chair/MassageChairScreen.kt @@ -0,0 +1,78 @@ +package com.msg.presentation.view.massage_chair + +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.material.Divider +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.dotori.dotori_components.components.card.DotoriStudentCard +import com.dotori.dotori_components.components.utils.Types +import com.dotori.dotori_components.theme.DotoriTheme +import com.msg.presentation.view.component.DotoriTopBar +import com.msg.presentation.view.massage_chair.component.EmptyMassageChairScreen +import com.msg.presentation.view.massage_chair.component.MassageChairTopBar + +@Composable +fun MassageChairScreen() { + val list = listOf(1,2,3,4,5) + + if (list.isEmpty()) MassageChairIsEmptyContent() + else MassageChairStudentListContent(list) +} + +@Composable +@OptIn(ExperimentalFoundationApi::class) +fun MassageChairStudentListContent(list: List) { + LazyColumn(modifier = Modifier.fillMaxSize()) { + item { DotoriTopBar(onSwitchClick = {}) } + + item { + Divider( + modifier = Modifier.fillMaxWidth(), + thickness = 1.dp, + color = DotoriTheme.colors.background + ) + } + + stickyHeader { MassageChairTopBar() } + + items(list) { position -> + DotoriStudentCard( + name = "임가람", + gender = "MAN", + role = "ROLE_MEMBER", + studentNumber = "3412", + position = position, + mode = Types.CardType.MASSAGE_CHAIR, + isLast = list.lastIndex + 1 == position, + onCheckBoxChange = {} + ) + } + } +} + +@Composable +fun MassageChairIsEmptyContent() { + Column(modifier = Modifier.fillMaxSize()) { + DotoriTopBar(onSwitchClick = {}) + Divider( + modifier = Modifier.fillMaxWidth(), + thickness = 1.dp, + color = DotoriTheme.colors.background + ) + MassageChairTopBar() + EmptyMassageChairScreen() + } +} + +@Preview +@Composable +private fun MassageChairScreenPreview() { + MassageChairScreen() +} \ No newline at end of file diff --git a/presentation/src/main/java/com/msg/presentation/view/massage_chair/component/EmptyMassageChairScreen.kt b/presentation/src/main/java/com/msg/presentation/view/massage_chair/component/EmptyMassageChairScreen.kt new file mode 100644 index 00000000..4a7ca183 --- /dev/null +++ b/presentation/src/main/java/com/msg/presentation/view/massage_chair/component/EmptyMassageChairScreen.kt @@ -0,0 +1,51 @@ +package com.msg.presentation.view.massage_chair.component + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.dp +import com.dotori.dotori_components.theme.DotoriTheme +import com.msg.presentation.R + +@Composable +fun EmptyMassageChairScreen() { + Column( + modifier = Modifier + .fillMaxSize() + .background(DotoriTheme.colors.background), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + val image = painterResource( + id = if (DotoriTheme.isSystemIsDarkTheme()) + R.drawable.ic_empty_massage_chair_icon_dark + else R.drawable.ic_empty_massage_chair_icon_light + ) + + Image( + painter = image, + contentDescription = "empty massage chair student" + ) + + Text( + modifier = Modifier.padding(horizontal = 8.dp), + text = "안마의자를 신청한 인원이 없습니다..", + style = DotoriTheme.typography.subTitle2, + color = DotoriTheme.colors.neutral10 + ) + + Text( + text = "홈에서 안마의자 신청을 해보세요!", + style = DotoriTheme.typography.caption, + color = DotoriTheme.colors.neutral20 + ) + } +} \ No newline at end of file diff --git a/presentation/src/main/java/com/msg/presentation/view/massage_chair/component/MassageChairTopBar.kt b/presentation/src/main/java/com/msg/presentation/view/massage_chair/component/MassageChairTopBar.kt new file mode 100644 index 00000000..69b1c5b7 --- /dev/null +++ b/presentation/src/main/java/com/msg/presentation/view/massage_chair/component/MassageChairTopBar.kt @@ -0,0 +1,31 @@ +package com.msg.presentation.view.massage_chair.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.dotori.dotori_components.theme.DotoriTheme + +@Composable +fun MassageChairTopBar() { + Row( + modifier = Modifier + .fillMaxWidth() + .background(DotoriTheme.colors.cardBackground) + .padding(horizontal = 20.dp, vertical = 12.dp), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = "안마의자", + style = DotoriTheme.typography.subTitle1, + color = DotoriTheme.colors.neutral10 + ) + } +} \ No newline at end of file diff --git a/presentation/src/main/java/com/msg/presentation/view/self_study/SelfStudyScreen.kt b/presentation/src/main/java/com/msg/presentation/view/self_study/SelfStudyScreen.kt index 6959745d..875ff2c1 100644 --- a/presentation/src/main/java/com/msg/presentation/view/self_study/SelfStudyScreen.kt +++ b/presentation/src/main/java/com/msg/presentation/view/self_study/SelfStudyScreen.kt @@ -3,8 +3,10 @@ package com.msg.presentation.view.self_study import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items +import androidx.compose.material.Divider import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -15,11 +17,13 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp import com.dotori.dotori_components.components.bottomsheet.DotoriBottomSheetDialog import com.dotori.dotori_components.components.card.DotoriStudentCard import com.dotori.dotori_components.components.utils.Types +import com.dotori.dotori_components.theme.DotoriTheme +import com.msg.presentation.view.component.DotoriTopBar import com.msg.presentation.view.self_study.component.BottomSheetContent -import com.msg.presentation.view.self_study.component.DotoriTopBar import com.msg.presentation.view.self_study.component.EmptySelfStudyScreen import com.msg.presentation.view.self_study.component.SelfStudyTopBar import kotlinx.coroutines.launch @@ -63,6 +67,12 @@ fun SelfStudyIsEmptyContent(onFilterIconClick: () -> Unit, ) { Column(modifier = Modifier.fillMaxSize()) { DotoriTopBar(onSwitchClick = { /*TODO*/ }) + Divider( + modifier = Modifier.fillMaxWidth(), + thickness = 1.dp, + color = DotoriTheme.colors.background + ) + SelfStudyTopBar { onFilterIconClick() } EmptySelfStudyScreen() @@ -82,6 +92,14 @@ fun SelfStudyStudentListContent( ) { item { DotoriTopBar(onSwitchClick = { /*TODO*/ }) } + item { + Divider( + modifier = Modifier.fillMaxWidth(), + thickness = 1.dp, + color = DotoriTheme.colors.background + ) + } + stickyHeader { SelfStudyTopBar { onFilterIconClick() } } items(list) { position -> diff --git a/presentation/src/main/java/com/msg/presentation/view/self_study/component/TopBar.kt b/presentation/src/main/java/com/msg/presentation/view/self_study/component/SelfStudyTopBar.kt similarity index 69% rename from presentation/src/main/java/com/msg/presentation/view/self_study/component/TopBar.kt rename to presentation/src/main/java/com/msg/presentation/view/self_study/component/SelfStudyTopBar.kt index c408e901..3d4f0d2b 100644 --- a/presentation/src/main/java/com/msg/presentation/view/self_study/component/TopBar.kt +++ b/presentation/src/main/java/com/msg/presentation/view/self_study/component/SelfStudyTopBar.kt @@ -11,26 +11,9 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import com.dotori.dotori_components.components.toggle.DotoriThemeSwitchButton -import com.dotori.dotori_components.theme.DotoriText import com.dotori.dotori_components.theme.DotoriTheme import com.dotori.dotori_components.theme.FilterIcon -@Composable -fun DotoriTopBar(onSwitchClick: (Boolean) -> Unit) { - Row( - modifier = Modifier - .fillMaxWidth() - .background(DotoriTheme.colors.cardBackground) - .padding(horizontal = 20.dp, vertical = 12.dp), - horizontalArrangement = Arrangement.SpaceBetween, - verticalAlignment = Alignment.CenterVertically - ) { - DotoriText() - DotoriThemeSwitchButton(onSwitchClick = onSwitchClick) - } -} - @Composable fun SelfStudyTopBar(onFilterIconClick: () -> Unit) { Row( diff --git a/presentation/src/main/res/drawable/ic_empty_massage_chair_icon_dark.xml b/presentation/src/main/res/drawable/ic_empty_massage_chair_icon_dark.xml new file mode 100644 index 00000000..efb0de13 --- /dev/null +++ b/presentation/src/main/res/drawable/ic_empty_massage_chair_icon_dark.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/presentation/src/main/res/drawable/ic_empty_massage_chair_icon_light.xml b/presentation/src/main/res/drawable/ic_empty_massage_chair_icon_light.xml new file mode 100644 index 00000000..76676f62 --- /dev/null +++ b/presentation/src/main/res/drawable/ic_empty_massage_chair_icon_light.xml @@ -0,0 +1,22 @@ + + + + +