-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
181 additions
and
8 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
presentation/src/main/java/com/kusitms/presentation/model/home/attend/AttendUiState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
) |
33 changes: 33 additions & 0 deletions
33
presentation/src/main/java/com/kusitms/presentation/model/home/attend/AttendViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
presentation/src/main/java/com/kusitms/presentation/ui/home/attend/curriItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { | ||
|
||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |