Skip to content

Commit 0c2e23a

Browse files
authored
Merge pull request #548 from Team-WSS/feat/547
feat: Notice 뷰 UI 수정 사항 반영
2 parents 5fb76fd + b7b07f1 commit 0c2e23a

17 files changed

Lines changed: 452 additions & 116 deletions

File tree

app/src/main/java/com/into/websoso/common/ui/component/AdaptationImage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import com.into.websoso.common.util.getS3ImageUrl
99

1010
@Composable
1111
fun AdaptationImage(
12-
modifier: Modifier = Modifier,
1312
contentDescription: String? = null,
1413
imageUrl: String,
1514
contentScale: ContentScale = ContentScale.Fit,
1615
alignment: Alignment = Alignment.Center,
16+
modifier: Modifier = Modifier,
1717
) {
1818
val urlRegex = Regex("^(https?://).*")
1919
val formattedUrl = when (urlRegex.matches(imageUrl)) {

app/src/main/java/com/into/websoso/common/ui/component/ExternalImage.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import coil.compose.AsyncImage
88

99
@Composable
1010
fun ExternalImage(
11-
modifier: Modifier = Modifier,
1211
contentDescription: String? = null,
1312
imageUrl: String,
1413
contentScale: ContentScale = ContentScale.Fit,
1514
alignment: Alignment = Alignment.Center,
15+
modifier: Modifier = Modifier,
1616
) {
1717
AsyncImage(
18-
modifier = modifier,
1918
contentDescription = contentDescription,
2019
model = imageUrl,
2120
contentScale = contentScale,
2221
alignment = alignment,
22+
modifier = modifier,
2323
)
2424
}

app/src/main/java/com/into/websoso/designsystem/theme/Color.kt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,19 @@ val Primary50 = Color(0xFFF1EFFF)
99
val Primary100 = Color(0xFF6A5DFD)
1010
val Primary200 = Color(0xFF240991)
1111

12-
val Secondary50 = Color(0xFFFFAA8F)
1312
val Secondary100 = Color(0xFFFF675D)
1413

1514
val White = Color(0xFFFFFFFF)
1615
val Gray20 = Color(0xFFFAFAFA)
1716
val Gray50 = Color(0xFFF4F5F8)
1817
val Gray70 = Color(0xFFDFDFE3)
19-
val Gray80 = Color(0xFFDDDDE3)
2018
val Gray100 = Color(0xFFCBCBD1)
21-
val Gray200 = Color(0xFFAEADB3)
19+
val Gray200 = Color(0xFF949399)
2220
val Gray300 = Color(0xFF52515F)
2321
val Black = Color(0xFF111118)
2422

2523
val GrayToast = Color(0xCC394258)
2624
val Black60 = Color(0x99000000)
27-
val Warning = Color(0xFFFF675D)
2825

2926
val Transparent = Color(0x00000000)
3027

@@ -36,12 +33,3 @@ val BgGradientGray = Brush.linearGradient(
3633
start = Offset(0f, 0f),
3734
end = Offset(0f, Float.POSITIVE_INFINITY),
3835
)
39-
40-
val BgSelectedGradient = Brush.linearGradient(
41-
colors = listOf(
42-
Color(0xFF6341F0),
43-
Color(0xFFAD00FF),
44-
),
45-
start = Offset(0f, 0f),
46-
end = Offset(0f, Float.POSITIVE_INFINITY),
47-
)

app/src/main/java/com/into/websoso/designsystem/theme/Theme.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@ private val DarkColorScheme = darkColorScheme(
2020
onPrimaryContainer = Gray20,
2121
secondary = Secondary100,
2222
onSecondary = White,
23-
secondaryContainer = Secondary50,
2423
onSecondaryContainer = Gray50,
2524
tertiary = Gray300,
2625
onTertiary = White,
2726
background = Black,
2827
onBackground = Gray20,
29-
surface = Gray80,
3028
onSurface = Gray200,
31-
error = Warning,
3229
onError = White,
3330
)
3431

@@ -39,15 +36,13 @@ private val LightColorScheme = lightColorScheme(
3936
onPrimaryContainer = Gray20,
4037
secondary = Secondary100,
4138
onSecondary = White,
42-
secondaryContainer = Secondary50,
4339
onSecondaryContainer = Gray50,
4440
tertiary = Gray300,
4541
onTertiary = Black,
4642
background = White,
4743
onBackground = Gray300,
4844
surface = Gray20,
4945
onSurface = Gray70,
50-
error = Warning,
5146
onError = White,
5247
)
5348

@@ -61,7 +56,10 @@ object WebsosoTheme {
6156
}
6257

6358
@Composable
64-
fun ProvideWebsosoTypography(typography: WebsosoTypography, content: @Composable () -> Unit) {
59+
fun ProvideWebsosoTypography(
60+
typography: WebsosoTypography,
61+
content: @Composable () -> Unit,
62+
) {
6563
val provideTypography = remember { typography.copy() }
6664
provideTypography.update(typography)
6765
CompositionLocalProvider(

app/src/main/java/com/into/websoso/designsystem/theme/Type.kt

Lines changed: 63 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,64 +24,89 @@ class WebsosoTypography internal constructor(
2424
headline: TextStyle,
2525
title1: TextStyle,
2626
title2: TextStyle,
27+
title3: TextStyle,
2728
body1: TextStyle,
2829
body2: TextStyle,
2930
body3: TextStyle,
30-
caption: TextStyle,
31-
button: TextStyle,
32-
label: TextStyle,
31+
body4: TextStyle,
32+
body4Secondary: TextStyle,
33+
body5: TextStyle,
34+
body5Secondary: TextStyle,
35+
label1: TextStyle,
36+
label2: TextStyle,
3337
) {
3438
var headline: TextStyle by mutableStateOf(headline)
3539
private set
3640
var title1: TextStyle by mutableStateOf(title1)
3741
private set
3842
var title2: TextStyle by mutableStateOf(title2)
3943
private set
44+
var title3: TextStyle by mutableStateOf(title3)
45+
private set
4046
var body1: TextStyle by mutableStateOf(body1)
4147
private set
4248
var body2: TextStyle by mutableStateOf(body2)
4349
private set
4450
var body3: TextStyle by mutableStateOf(body3)
4551
private set
46-
var caption: TextStyle by mutableStateOf(caption)
52+
var body4: TextStyle by mutableStateOf(body4)
53+
private set
54+
var body4Secondary: TextStyle by mutableStateOf(body4Secondary)
55+
private set
56+
var body5: TextStyle by mutableStateOf(body5)
57+
private set
58+
var body5Secondary: TextStyle by mutableStateOf(body5Secondary)
4759
private set
48-
var button: TextStyle by mutableStateOf(button)
60+
var label1: TextStyle by mutableStateOf(label1)
4961
private set
50-
var label: TextStyle by mutableStateOf(label)
62+
var label2: TextStyle by mutableStateOf(label2)
5163
private set
5264

5365
fun copy(
5466
headline: TextStyle = this.headline,
5567
title1: TextStyle = this.title1,
5668
title2: TextStyle = this.title2,
69+
title3: TextStyle = this.title3,
5770
body1: TextStyle = this.body1,
5871
body2: TextStyle = this.body2,
5972
body3: TextStyle = this.body3,
60-
caption: TextStyle = this.caption,
61-
button: TextStyle = this.button,
62-
label: TextStyle = this.label,
63-
): WebsosoTypography = WebsosoTypography(
64-
headline,
65-
title1,
66-
title2,
67-
body1,
68-
body2,
69-
body3,
70-
caption,
71-
button,
72-
label,
73-
)
73+
body4: TextStyle = this.body4,
74+
body4Secondary: TextStyle = this.body4Secondary,
75+
body5: TextStyle = this.body5,
76+
body5Secondary: TextStyle = this.body5Secondary,
77+
label1: TextStyle = this.label1,
78+
label2: TextStyle = this.label2,
79+
): WebsosoTypography =
80+
WebsosoTypography(
81+
headline,
82+
title1,
83+
title2,
84+
title3,
85+
body1,
86+
body2,
87+
body3,
88+
body4,
89+
body4Secondary,
90+
body5,
91+
body5Secondary,
92+
label1,
93+
label2,
94+
)
7495

7596
fun update(other: WebsosoTypography) {
7697
headline = other.headline
7798
title1 = other.title1
7899
title2 = other.title2
100+
title3 = other.title3
79101
body1 = other.body1
80102
body2 = other.body2
81103
body3 = other.body3
82-
caption = other.caption
83-
button = other.button
84-
label = other.label
104+
body4 = other.body4
105+
body4Secondary = other.body4Secondary
106+
body5 = other.body5
107+
body5Secondary = other.body5Secondary
108+
label1 = other.label1
109+
label2 = other.label2
85110
}
86111
}
87112

@@ -94,24 +119,27 @@ fun websosoTypography(): WebsosoTypography {
94119
fontWeight: FontWeight,
95120
fontSizeDp: Dp,
96121
lineHeightDp: Dp,
97-
): TextStyle {
98-
return TextStyle(
122+
): TextStyle =
123+
TextStyle(
99124
fontFamily = fontFamily,
100125
fontWeight = fontWeight,
101126
fontSize = with(density) { fontSizeDp.toSp() },
102127
lineHeight = with(density) { lineHeightDp.toSp() },
103128
)
104-
}
105129

106130
return WebsosoTypography(
107-
headline = textStyle(PretendardBold, FontWeight.Bold, 24.dp, 32.dp),
108-
title1 = textStyle(PretendardSemiBold, FontWeight.SemiBold, 20.dp, 28.dp),
109-
title2 = textStyle(PretendardMedium, FontWeight.Medium, 18.dp, 25.dp),
110-
body1 = textStyle(PretendardRegular, FontWeight.Normal, 16.dp, 24.dp),
111-
body2 = textStyle(PretendardRegular, FontWeight.Normal, 14.dp, 21.dp),
112-
body3 = textStyle(PretendardRegular, FontWeight.Normal, 12.dp, 18.dp),
113-
caption = textStyle(PretendardRegular, FontWeight.Normal, 10.dp, 15.dp),
114-
button = textStyle(PretendardBold, FontWeight.Bold, 14.dp, 20.dp),
115-
label = textStyle(PretendardSemiBold, FontWeight.SemiBold, 13.dp, 19.dp),
131+
headline = textStyle(PretendardBold, FontWeight.Bold, 20.dp, 28.dp),
132+
title1 = textStyle(PretendardBold, FontWeight.Bold, 18.dp, 25.dp),
133+
title2 = textStyle(PretendardSemiBold, FontWeight.SemiBold, 16.dp, 22.dp),
134+
title3 = textStyle(PretendardMedium, FontWeight.Medium, 14.dp, 14.dp),
135+
body1 = textStyle(PretendardRegular, FontWeight.Normal, 17.dp, 24.dp),
136+
body2 = textStyle(PretendardRegular, FontWeight.Normal, 15.dp, 23.dp),
137+
body3 = textStyle(PretendardRegular, FontWeight.Normal, 14.dp, 21.dp),
138+
body4 = textStyle(PretendardMedium, FontWeight.Medium, 13.dp, 19.dp),
139+
body4Secondary = textStyle(PretendardRegular, FontWeight.Normal, 13.dp, 19.dp),
140+
body5 = textStyle(PretendardRegular, FontWeight.Normal, 12.dp, 17.dp),
141+
body5Secondary = textStyle(PretendardMedium, FontWeight.Medium, 12.dp, 17.dp),
142+
label1 = textStyle(PretendardMedium, FontWeight.Medium, 13.dp, 19.dp),
143+
label2 = textStyle(PretendardRegular, FontWeight.Normal, 10.dp, 10.dp),
116144
)
117145
}

app/src/main/java/com/into/websoso/domain/mapper/NoticeMapper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import com.into.websoso.domain.model.NoticeInfo
88
fun NotificationsEntity.toDomain(): NoticeInfo =
99
NoticeInfo(
1010
isLoadable = isLoadable,
11-
lastNoticeId = notifications.maxOf { it.notificationId },
11+
lastNoticeId = notifications.last().notificationId,
1212
notices = notifications.map { it.toDomain() },
1313
)
1414

app/src/main/java/com/into/websoso/ui/notice/NoticeActivity.kt

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,42 @@ import android.os.Bundle
66
import androidx.activity.ComponentActivity
77
import androidx.activity.compose.setContent
88
import androidx.activity.viewModels
9+
import com.into.websoso.designsystem.theme.WebsosoTheme
10+
import com.into.websoso.domain.model.Notice
11+
import com.into.websoso.ui.feedDetail.FeedDetailActivity
12+
import com.into.websoso.ui.noticeDetail.NoticeDetailActivity
913
import dagger.hilt.android.AndroidEntryPoint
1014

1115
@AndroidEntryPoint
1216
class NoticeActivity : ComponentActivity() {
13-
1417
private val noticeViewModel: NoticeViewModel by viewModels()
1518

1619
override fun onCreate(savedInstanceState: Bundle?) {
1720
super.onCreate(savedInstanceState)
1821

1922
setContent {
20-
NoticeScreen(viewModel = noticeViewModel)
23+
WebsosoTheme {
24+
NoticeScreen(
25+
viewModel = noticeViewModel,
26+
onNoticeDetailClick = ::navigateToNoticeDetail,
27+
onFeedDetailClick = ::navigateToFeedDetail,
28+
onBackButtonClick = { finish() },
29+
)
30+
}
2131
}
2232
}
2333

34+
private fun navigateToNoticeDetail(notice: Notice) {
35+
noticeViewModel.updateReadNotice(notice.id)
36+
startActivity(NoticeDetailActivity.getIntent(this, notice.intrinsicId))
37+
}
38+
39+
private fun navigateToFeedDetail(notice: Notice) {
40+
noticeViewModel.updateReadNotice(notice.id)
41+
startActivity(FeedDetailActivity.getIntent(this, notice.intrinsicId))
42+
}
43+
2444
companion object {
25-
fun getIntent(context: Context): Intent {
26-
return Intent(context, NoticeActivity::class.java)
27-
}
45+
fun getIntent(context: Context): Intent = Intent(context, NoticeActivity::class.java)
2846
}
2947
}
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
package com.into.websoso.ui.notice
22

3+
import androidx.compose.foundation.layout.Column
4+
import androidx.compose.foundation.layout.fillMaxSize
35
import androidx.compose.runtime.Composable
46
import androidx.compose.runtime.getValue
7+
import androidx.compose.ui.Modifier
58
import androidx.lifecycle.compose.collectAsStateWithLifecycle
9+
import com.into.websoso.domain.model.Notice
10+
import com.into.websoso.ui.notice.component.NoticeAppBar
11+
import com.into.websoso.ui.notice.component.NoticesContainer
612

713
@Composable
8-
fun NoticeScreen(viewModel: NoticeViewModel) {
14+
fun NoticeScreen(
15+
viewModel: NoticeViewModel,
16+
onNoticeDetailClick: (Notice) -> Unit,
17+
onFeedDetailClick: (Notice) -> Unit,
18+
onBackButtonClick: () -> Unit,
19+
) {
920
val uiState by viewModel.noticeUiState.collectAsStateWithLifecycle()
21+
22+
Column(modifier = Modifier.fillMaxSize()) {
23+
NoticeAppBar(onBackButtonClick)
24+
NoticesContainer(
25+
notices = uiState.notices,
26+
isLoadable = uiState.isLoadable,
27+
updateNotices = viewModel::updateNotices,
28+
onNoticeDetailClick = onNoticeDetailClick,
29+
onFeedDetailClick = onFeedDetailClick,
30+
)
31+
}
1032
}

0 commit comments

Comments
 (0)