Skip to content

Commit

Permalink
[feat/#76] 버튼 케이스 UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnseo committed Feb 3, 2024
1 parent 0d143c0 commit dfcf58a
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package com.kusitms.presentation.ui.home.attend

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Text
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.kusitms.presentation.R
import com.kusitms.presentation.common.ui.theme.KusitmsColorPalette
import com.kusitms.presentation.common.ui.theme.KusitmsTypo

@Composable
fun AttendBtnOn() {
Button(
modifier = Modifier
.wrapContentWidth()
.height(64.dp) ,
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Main600) ,
shape = RoundedCornerShape(size = 12.dp),
onClick = { /*TODO*/ }
) {
Text(text = stringResource(R.string.attend_btn_attend), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.White, maxLines = 1)
}
}

@Composable
fun AttendBtnOff() {
Button(
modifier = Modifier
.wrapContentWidth()
.height(64.dp) ,
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Grey500) ,
shape = RoundedCornerShape(size = 12.dp),
onClick = { },
enabled = false
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Text(text = stringResource(R.string.attend_btn_attend_wait), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Grey400)
Text(text = stringResource(R.string.attend_btn_attend_wait), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Grey400)
}
}
}

@Composable
fun AttendBtnFailure() {
Button(
modifier = Modifier
.wrapContentWidth()
.height(64.dp) ,
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Grey600) ,
shape = RoundedCornerShape(size = 12.dp),
onClick = {},
enabled = false
) {
Text(text = stringResource(R.string.attend_btn_attend_failure), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Sub2, maxLines = 1)
}
}

@Composable
fun AttendBtnSuccess() {
Button(
modifier = Modifier
.wrapContentWidth()
.height(64.dp) ,
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Grey600) ,
shape = RoundedCornerShape(size = 12.dp),
onClick = {},
enabled = false
) {
Text(text = stringResource(R.string.attend_btn_attend_success), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Sub1, maxLines = 1)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ import com.kusitms.presentation.common.ui.KusitmsMarginVerticalSpacer
import com.kusitms.presentation.common.ui.theme.KusitmsColorPalette
import com.kusitms.presentation.R
import com.kusitms.presentation.common.ui.KusitmsMarginHorizontalSpacer
import com.kusitms.presentation.common.ui.KusitsmTopBarTextWithIcon
import com.kusitms.presentation.common.ui.theme.KusitmsTypo
import com.kusitms.presentation.model.home.attend.AttendViewModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

@Preview
@Composable
fun AttendScreen() {

fun AttendScreen(
) {
val scrollState = rememberScrollState()
Column(
modifier = Modifier
Expand All @@ -47,6 +49,7 @@ fun AttendScreen() {
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.Top
) {
AttendTopBar()
KusitmsMarginVerticalSpacer(size = 8)
AttendPreColumn()
KusitmsMarginVerticalSpacer(size = 24)
Expand All @@ -57,6 +60,23 @@ fun AttendScreen() {
ScrollBtn(scrollState = scrollState)
}

@Composable
fun AttendTopBar() {
Column(
modifier = Modifier
.fillMaxWidth()
.height(48.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.Start
) {
Text(
text = "출석",
style = KusitmsTypo.current.SubTitle1_Semibold,
color = KusitmsColorPalette.current.Grey100
)
}
}

@Composable
fun AttendPreColumn() {
Box(modifier = Modifier
Expand All @@ -79,16 +99,7 @@ fun AttendPreColumn() {
Text(text = stringResource(R.string.attend_box1_title), style = KusitmsTypo.current.Caption1, color = KusitmsColorPalette.current.Main500)
Text(text = stringResource(R.string.attend_box1_subTitle), style = KusitmsTypo.current.SubTitle1_Semibold, color = KusitmsColorPalette.current.White)
}
Button(
modifier = Modifier
.wrapContentWidth()
.height(64.dp) ,
colors = ButtonDefaults.buttonColors(containerColor = KusitmsColorPalette.current.Main600) ,
shape = RoundedCornerShape(size = 12.dp),
onClick = { /*TODO*/ }
) {
Text(text = stringResource(R.string.attend_btn_attend), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.White, maxLines = 1)
}
AttendBtnOff()
}
}
}
Expand Down Expand Up @@ -212,7 +223,7 @@ fun AttendBoxItem(
.padding(vertical = 10.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.SpaceBetween) {
Text(text = stringResource(id = title), // title을 파라미터로 전달
Text(text = stringResource(id = title),
style = KusitmsTypo.current.Caption1,
color = KusitmsColorPalette.current.Grey300,
)
Expand Down
5 changes: 5 additions & 0 deletions presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@
<string name="attend_box1_subTitle">%s</string>
<string name="attend_btn_attend">출석하기</string>

<string name="attend_btn_attend_success">출석완료</string>
<string name="attend_btn_attend_failure">출석실패</string>
<string name="attend_btn_attend_wait">출석대기</string>

<string name="attend_box2_title">출석현황</string>
<string name="attend_btn2_attend">출석변경 요청하기</string>

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



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

0 comments on commit dfcf58a

Please sign in to comment.