Skip to content

Commit

Permalink
[UI/#214] 빈화면 그래픽 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
boiledeggg committed Sep 7, 2024
1 parent 7738353 commit a451304
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.terning.feature.calendar.list

import androidx.activity.compose.BackHandler
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -19,6 +21,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -168,19 +171,11 @@ private fun CalendarListScreen(
}
UiState.Empty -> {
item {
Box(
Column(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
modifier = Modifier
.padding(top = 42.dp)
.fillMaxWidth(),
text = stringResource(id = R.string.calendar_empty_scrap),
textAlign = TextAlign.Center,
style = TerningTheme.typography.body5,
color = Grey400
)
CalendarListEmpty()
}
}
}
Expand Down Expand Up @@ -253,4 +248,26 @@ private fun CalendarListScreen(
}
}

@Composable
private fun CalendarListEmpty(
modifier: Modifier = Modifier
) {
Image(
painter = painterResource(
id = R.drawable.ic_terning_calendar_empty
),
contentDescription = "",
modifier = modifier.padding(top = 20.dp, bottom = 4.dp)
)

Text(
modifier = modifier
.fillMaxWidth(),
text = stringResource(id = R.string.calendar_empty_scrap),
textAlign = TextAlign.Center,
style = TerningTheme.typography.body5,
color = Grey400
)
}


Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.terning.feature.calendar.week

import androidx.activity.compose.BackHandler
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -14,10 +15,12 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -135,7 +138,8 @@ private fun CalendarWeekScreen(

Column(
modifier = modifier
.background(Back)
.background(Back),
horizontalAlignment = Alignment.CenterHorizontally
) {
Card(
modifier = Modifier
Expand All @@ -161,6 +165,7 @@ private fun CalendarWeekScreen(
style = TerningTheme.typography.title5,
color = Black,
modifier = Modifier
.fillMaxWidth()
.padding(start = 24.dp, top = 16.dp, bottom = 15.dp)
)

Expand All @@ -169,9 +174,11 @@ private fun CalendarWeekScreen(
is UiState.Empty -> {
CalendarWeekEmpty()
}

is UiState.Failure -> {
CalendarWeekEmpty()
}

is UiState.Success -> {
CalendarWeekSuccess(
scrapList = uiState.loadState.data.toImmutableList(),
Expand Down Expand Up @@ -220,9 +227,16 @@ private fun CalendarWeekScreen(
private fun CalendarWeekEmpty(
modifier: Modifier = Modifier
) {
Image(
painter = painterResource(
id = R.drawable.ic_terning_calendar_empty
),
contentDescription = "",
modifier = modifier.padding(top = 20.dp, bottom = 4.dp)
)

Text(
modifier = modifier
.padding(top = 38.dp)
.fillMaxWidth(),
text = stringResource(id = R.string.calendar_empty_scrap),
textAlign = TextAlign.Center,
Expand Down
Loading

0 comments on commit a451304

Please sign in to comment.