Skip to content

Commit dfcf58a

Browse files
committed
[feat/#76] 버튼 케이스 UI
1 parent 0d143c0 commit dfcf58a

File tree

3 files changed

+113
-13
lines changed

3 files changed

+113
-13
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
package com.kusitms.presentation.ui.home.attend
2+
3+
import androidx.compose.foundation.layout.Arrangement
4+
import androidx.compose.foundation.layout.Column
5+
import androidx.compose.foundation.layout.height
6+
import androidx.compose.foundation.layout.wrapContentWidth
7+
import androidx.compose.foundation.shape.RoundedCornerShape
8+
import androidx.compose.material.Text
9+
import androidx.compose.material3.Button
10+
import androidx.compose.material3.ButtonDefaults
11+
import androidx.compose.runtime.Composable
12+
import androidx.compose.ui.Alignment
13+
import androidx.compose.ui.Modifier
14+
import androidx.compose.ui.res.stringResource
15+
import androidx.compose.ui.tooling.preview.Preview
16+
import androidx.compose.ui.unit.dp
17+
import com.kusitms.presentation.R
18+
import com.kusitms.presentation.common.ui.theme.KusitmsColorPalette
19+
import com.kusitms.presentation.common.ui.theme.KusitmsTypo
20+
21+
@Composable
22+
fun AttendBtnOn() {
23+
Button(
24+
modifier = Modifier
25+
.wrapContentWidth()
26+
.height(64.dp) ,
27+
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Main600) ,
28+
shape = RoundedCornerShape(size = 12.dp),
29+
onClick = { /*TODO*/ }
30+
) {
31+
Text(text = stringResource(R.string.attend_btn_attend), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.White, maxLines = 1)
32+
}
33+
}
34+
35+
@Composable
36+
fun AttendBtnOff() {
37+
Button(
38+
modifier = Modifier
39+
.wrapContentWidth()
40+
.height(64.dp) ,
41+
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Grey500) ,
42+
shape = RoundedCornerShape(size = 12.dp),
43+
onClick = { },
44+
enabled = false
45+
) {
46+
Column(
47+
horizontalAlignment = Alignment.CenterHorizontally,
48+
verticalArrangement = Arrangement.Center
49+
) {
50+
Text(text = stringResource(R.string.attend_btn_attend_wait), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Grey400)
51+
Text(text = stringResource(R.string.attend_btn_attend_wait), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Grey400)
52+
}
53+
}
54+
}
55+
56+
@Composable
57+
fun AttendBtnFailure() {
58+
Button(
59+
modifier = Modifier
60+
.wrapContentWidth()
61+
.height(64.dp) ,
62+
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Grey600) ,
63+
shape = RoundedCornerShape(size = 12.dp),
64+
onClick = {},
65+
enabled = false
66+
) {
67+
Text(text = stringResource(R.string.attend_btn_attend_failure), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Sub2, maxLines = 1)
68+
}
69+
}
70+
71+
@Composable
72+
fun AttendBtnSuccess() {
73+
Button(
74+
modifier = Modifier
75+
.wrapContentWidth()
76+
.height(64.dp) ,
77+
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Grey600) ,
78+
shape = RoundedCornerShape(size = 12.dp),
79+
onClick = {},
80+
enabled = false
81+
) {
82+
Text(text = stringResource(R.string.attend_btn_attend_success), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Sub1, maxLines = 1)
83+
}
84+
}

presentation/src/main/java/com/kusitms/presentation/ui/home/attend/AttendScreen.kt

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ import com.kusitms.presentation.common.ui.KusitmsMarginVerticalSpacer
2828
import com.kusitms.presentation.common.ui.theme.KusitmsColorPalette
2929
import com.kusitms.presentation.R
3030
import com.kusitms.presentation.common.ui.KusitmsMarginHorizontalSpacer
31+
import com.kusitms.presentation.common.ui.KusitsmTopBarTextWithIcon
3132
import com.kusitms.presentation.common.ui.theme.KusitmsTypo
33+
import com.kusitms.presentation.model.home.attend.AttendViewModel
3234
import kotlinx.coroutines.CoroutineScope
3335
import kotlinx.coroutines.Dispatchers
3436
import kotlinx.coroutines.launch
3537

3638
@Preview
3739
@Composable
38-
fun AttendScreen() {
39-
40+
fun AttendScreen(
41+
) {
4042
val scrollState = rememberScrollState()
4143
Column(
4244
modifier = Modifier
@@ -47,6 +49,7 @@ fun AttendScreen() {
4749
horizontalAlignment = Alignment.Start,
4850
verticalArrangement = Arrangement.Top
4951
) {
52+
AttendTopBar()
5053
KusitmsMarginVerticalSpacer(size = 8)
5154
AttendPreColumn()
5255
KusitmsMarginVerticalSpacer(size = 24)
@@ -57,6 +60,23 @@ fun AttendScreen() {
5760
ScrollBtn(scrollState = scrollState)
5861
}
5962

63+
@Composable
64+
fun AttendTopBar() {
65+
Column(
66+
modifier = Modifier
67+
.fillMaxWidth()
68+
.height(48.dp),
69+
verticalArrangement = Arrangement.Center,
70+
horizontalAlignment = Alignment.Start
71+
) {
72+
Text(
73+
text = "출석",
74+
style = KusitmsTypo.current.SubTitle1_Semibold,
75+
color = KusitmsColorPalette.current.Grey100
76+
)
77+
}
78+
}
79+
6080
@Composable
6181
fun AttendPreColumn() {
6282
Box(modifier = Modifier
@@ -79,16 +99,7 @@ fun AttendPreColumn() {
7999
Text(text = stringResource(R.string.attend_box1_title), style = KusitmsTypo.current.Caption1, color = KusitmsColorPalette.current.Main500)
80100
Text(text = stringResource(R.string.attend_box1_subTitle), style = KusitmsTypo.current.SubTitle1_Semibold, color = KusitmsColorPalette.current.White)
81101
}
82-
Button(
83-
modifier = Modifier
84-
.wrapContentWidth()
85-
.height(64.dp) ,
86-
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Main600) ,
87-
shape = RoundedCornerShape(size = 12.dp),
88-
onClick = { /*TODO*/ }
89-
) {
90-
Text(text = stringResource(R.string.attend_btn_attend), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.White, maxLines = 1)
91-
}
102+
AttendBtnOff()
92103
}
93104
}
94105
}
@@ -212,7 +223,7 @@ fun AttendBoxItem(
212223
.padding(vertical = 10.dp),
213224
horizontalAlignment = Alignment.CenterHorizontally,
214225
verticalArrangement = Arrangement.SpaceBetween) {
215-
Text(text = stringResource(id = title), // title을 파라미터로 전달
226+
Text(text = stringResource(id = title),
216227
style = KusitmsTypo.current.Caption1,
217228
color = KusitmsColorPalette.current.Grey300,
218229
)

presentation/src/main/res/values/strings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@
168168
<string name="attend_box1_subTitle">%s</string>
169169
<string name="attend_btn_attend">출석하기</string>
170170

171+
<string name="attend_btn_attend_success">출석완료</string>
172+
<string name="attend_btn_attend_failure">출석실패</string>
173+
<string name="attend_btn_attend_wait">출석대기</string>
174+
171175
<string name="attend_box2_title">출석현황</string>
172176
<string name="attend_btn2_attend">출석변경 요청하기</string>
173177

@@ -182,6 +186,7 @@
182186
<string name="attend_box4_non_late">지각</string>
183187

184188

189+
185190
<string name="notice_report_content_commercial">타 서비스, 앱, 사이트 등 게시판 외부로 회원을\n유도하거나 공동구매, 할인 쿠폰, 홍보성 이벤트 등\n허가되지 않은 광고/홍보 게시물</string>
186191
<string name="notice_report_content_abuse">비아냥, 비속어 등 예의범절에 벗어나거나,\n특정인이나 단체, 지역을 비방하는 등 논란 및 분란을\n일으킬 수 있는 게시물</string>
187192
<string name="notice_report_content_fraud">게시물 무단 유출, 타인의 개인정보 유출, 관리자 사칭 등 타인의 권리를 침해하거나 관련법에 위배되는 게시물</string>

0 commit comments

Comments
 (0)