Skip to content

Commit

Permalink
[feat/#76] list item UI + dummy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnseo committed Feb 2, 2024
1 parent c31914d commit a50261a
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.kusitms.presentation.model.home.attend

data class AttendUiState(
val curriculum:String,
val date: String,
val time: String,
val status: String
)


val curriDummy = listOf(
AttendUiState("전체 OT", "9월 2일", "오후 1:59", "PRESENT")
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.kusitms.presentation.model.home.attend

import androidx.compose.ui.graphics.Color
import com.kusitms.presentation.R
import com.kusitms.presentation.common.ui.theme.KusitmsColorPalette
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject


@HiltViewModel
class AttendViewModel @Inject constructor(

) {
enum class Status {
PRESENT, ABSENT, LATE;

companion object {
fun fromString(status: String): Status? {
return values().find { it.name == status }
}
}

fun toDrawable(): Int {
return when (this) {
PRESENT -> R.drawable.ic_attend_check
ABSENT -> R.drawable.ic_attend_non_check
LATE -> R.drawable.ic_attend_late
}
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class SignInViewModel @Inject constructor(
inputStream?.copyTo(fileOutputStream)
}


val requestFile = tempFile.asRequestBody("image/jpeg".toMediaTypeOrNull())
return MultipartBody.Part.createFormData("image", tempFile.name, requestFile)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.kusitms.presentation.ui.home.attend

import androidx.annotation.StringRes
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
Expand Down Expand Up @@ -112,16 +113,74 @@ fun AttendRecordColumn() {
}
KusitmsMarginVerticalSpacer(size = 24)
Text(text = stringResource(R.string.attend_box3_title), style = KusitmsTypo.current.Header2, color = KusitmsColorPalette.current.Grey100)
KusitmsMarginVerticalSpacer(size = 6)
Row(modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(), horizontalArrangement = Arrangement.Start, verticalAlignment = Alignment.CenterVertically) {
Text(text = stringResource(R.string.attend_box3_subTitle_ok), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Sub1)
KusitmsMarginHorizontalSpacer(size = 6)
Icon(painter = painterResource(id = R.drawable.ic_thumb), contentDescription = null, tint = Color.Unspecified)
}
KusitmsMarginVerticalSpacer(size = 14)
AttendCanComplete()
KusitmsMarginVerticalSpacer(size = 24)
AttendBoxRow()

}
}
}

@Composable
fun AttendCanComplete() {
Row(modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(), horizontalArrangement = Arrangement.Start, verticalAlignment = Alignment.CenterVertically) {
Text(text = stringResource(R.string.attend_box3_subTitle_ok), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Sub1)
KusitmsMarginHorizontalSpacer(size = 6)
Icon(painter = painterResource(id = R.drawable.ic_thumb), contentDescription = null, tint = Color.Unspecified)
}
}

@Composable
fun AttendNotComplete() {
Text(text = stringResource(R.string.attend_box3_subTitle_fail), style = KusitmsTypo.current.Text_Semibold, color = KusitmsColorPalette.current.Sub2)
}

@Composable
fun AttendBoxRow() {
Row(modifier = Modifier
.fillMaxWidth()
.height(74.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically) {

AttendBoxItem(title = R.string.attend_box4_attend, Modifier.weight(1f))
Spacer(Modifier.width(12.dp))

AttendBoxItem(title = R.string.attend_box4_non_attend, Modifier.weight(1f))
Spacer(Modifier.width(12.dp))

AttendBoxItem(title = R.string.attend_box4_non_late, Modifier.weight(1f))
}
}

@Composable
fun AttendBoxItem(
@StringRes title: Int,
modifier: Modifier = Modifier
) {
Box(modifier = modifier
.height(74.dp)
.background(
color = KusitmsColorPalette.current.Grey600,
shape = RoundedCornerShape(12.dp)
)
){
Column(modifier = Modifier
.fillMaxSize()
.padding(vertical = 10.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.SpaceBetween) {
Text(text = stringResource(id = title), // title을 파라미터로 전달
style = KusitmsTypo.current.Caption1,
color = KusitmsColorPalette.current.Grey300,
)
Text(text ="0회",
style = KusitmsTypo.current.SubTitle1_Semibold,
color = KusitmsColorPalette.current.Grey100,
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.kusitms.presentation.ui.home.attend

import androidx.compose.foundation.layout.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.modifier.modifierLocalMapOf
import androidx.compose.ui.unit.dp
import com.kusitms.presentation.common.ui.theme.KusitmsColorPalette
import com.kusitms.presentation.model.home.attend.AttendViewModel


@Composable
fun CurriItem(
status: AttendViewModel.Status
) {
val statusColor = when(status) {
AttendViewModel.Status.PRESENT -> KusitmsColorPalette.current.Sub1
AttendViewModel.Status.ABSENT, AttendViewModel.Status.LATE -> KusitmsColorPalette.current.Sub2
else -> ""
}
Row(modifier = Modifier
.fillMaxWidth()
.height(78.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {


}
}

@Composable
fun CurriTitleRow(
title: String,
date: String,
status: AttendViewModel.Status
) {
Row(
modifier = Modifier
.wrapContentWidth()
.fillMaxHeight(),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
status.toDrawable()
Column() {

}
}

}
5 changes: 5 additions & 0 deletions presentation/src/main/res/drawable/ic_attend_check.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:alpha="0.9" android:height="28dp"
android:viewportHeight="28" android:viewportWidth="28"
android:width="28dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#65E7DE" android:fillType="evenOdd" android:pathData="M3.208,14C3.208,8.04 8.04,3.208 14,3.208C15.967,3.208 17.809,3.734 19.395,4.651C19.813,4.893 20.349,4.75 20.591,4.332C20.833,3.914 20.69,3.378 20.271,3.136C18.426,2.069 16.283,1.458 14,1.458C7.073,1.458 1.458,7.073 1.458,14C1.458,20.926 7.073,26.541 14,26.541C20.927,26.541 26.542,20.926 26.542,14C26.542,12.457 26.263,10.977 25.752,9.61C25.583,9.157 25.079,8.928 24.626,9.097C24.173,9.266 23.943,9.77 24.112,10.223C24.551,11.397 24.792,12.669 24.792,14C24.792,19.96 19.96,24.791 14,24.791C8.04,24.791 3.208,19.96 3.208,14ZM25.15,5.252C25.474,4.892 25.445,4.339 25.085,4.016C24.726,3.693 24.173,3.722 23.85,4.081L14.823,14.111C14.306,14.685 13.431,14.757 12.828,14.274L8.713,10.983C8.336,10.681 7.785,10.742 7.483,11.12C7.182,11.497 7.243,12.048 7.62,12.349L11.734,15.641C13.061,16.702 14.986,16.545 16.123,15.282L25.15,5.252Z"/>
</vector>
5 changes: 5 additions & 0 deletions presentation/src/main/res/drawable/ic_attend_late.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:alpha="0.9" android:height="28dp"
android:viewportHeight="28" android:viewportWidth="28"
android:width="28dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F4F6F8" android:fillType="evenOdd" android:pathData="M3.208,14C3.208,8.04 8.04,3.208 14,3.208C15.967,3.208 17.809,3.734 19.395,4.651C19.813,4.893 20.349,4.75 20.591,4.332C20.833,3.914 20.69,3.378 20.271,3.136C18.426,2.069 16.283,1.458 14,1.458C7.073,1.458 1.458,7.073 1.458,14C1.458,20.926 7.073,26.541 14,26.541C20.927,26.541 26.542,20.926 26.542,14C26.542,12.457 26.263,10.977 25.752,9.61C25.583,9.157 25.079,8.928 24.626,9.097C24.173,9.266 23.943,9.77 24.112,10.223C24.551,11.397 24.792,12.669 24.792,14C24.792,19.96 19.96,24.791 14,24.791C8.04,24.791 3.208,19.96 3.208,14ZM25.15,5.252C25.474,4.892 25.445,4.339 25.085,4.016C24.726,3.693 24.173,3.722 23.85,4.081L14.823,14.111C14.306,14.685 13.431,14.757 12.828,14.274L8.713,10.983C8.336,10.681 7.785,10.742 7.483,11.12C7.182,11.497 7.243,12.048 7.62,12.349L11.734,15.641C13.061,16.702 14.986,16.545 16.123,15.282L25.15,5.252Z"/>
</vector>
5 changes: 5 additions & 0 deletions presentation/src/main/res/drawable/ic_attend_non_check.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:alpha="0.9" android:height="28dp"
android:viewportHeight="28" android:viewportWidth="28"
android:width="28dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#363C48" android:fillType="evenOdd" android:pathData="M3.208,14C3.208,8.04 8.04,3.208 14,3.208C15.967,3.208 17.809,3.734 19.395,4.652C19.813,4.894 20.349,4.751 20.591,4.332C20.833,3.914 20.69,3.379 20.271,3.137C18.426,2.069 16.283,1.459 14,1.459C7.073,1.459 1.458,7.074 1.458,14C1.458,20.927 7.073,26.542 14,26.542C20.927,26.542 26.542,20.927 26.542,14C26.542,12.458 26.263,10.978 25.752,9.611C25.583,9.158 25.079,8.928 24.626,9.097C24.173,9.266 23.943,9.77 24.112,10.223C24.551,11.398 24.792,12.67 24.792,14C24.792,19.96 19.96,24.792 14,24.792C8.04,24.792 3.208,19.96 3.208,14ZM25.15,5.252C25.474,4.893 25.445,4.34 25.085,4.016C24.726,3.693 24.173,3.722 23.85,4.081L14.823,14.112C14.306,14.686 13.431,14.757 12.828,14.275L8.713,10.983C8.336,10.682 7.785,10.743 7.483,11.12C7.182,11.497 7.243,12.048 7.62,12.35L11.734,15.641C13.061,16.703 14.986,16.545 16.123,15.282L25.15,5.252Z"/>
</vector>

0 comments on commit a50261a

Please sign in to comment.