-
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.
Merge branch 'AND_develop' into and/feat-#244-create_group
# Conflicts: # android/feature/navigator/src/main/java/com/sixkids/feature/navigator/MainNavigator.kt
- Loading branch information
Showing
29 changed files
with
1,485 additions
and
28 deletions.
There are no files selected for viewing
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
110 changes: 110 additions & 0 deletions
110
...core/designsystem/src/main/java/com/sixkids/designsystem/component/item/UlbanRelayItem.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,110 @@ | ||
package com.sixkids.designsystem.component.item | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material3.Card | ||
import androidx.compose.material3.CardDefaults | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import coil.compose.AsyncImage | ||
import com.sixkids.designsystem.R | ||
import com.sixkids.designsystem.theme.Cream | ||
import com.sixkids.designsystem.theme.UlbanTypography | ||
import com.sixkids.ui.util.formatToMonthDayTime | ||
import java.time.LocalDateTime | ||
|
||
@Composable | ||
fun UlbanRelayItem( | ||
modifier: Modifier = Modifier, | ||
padding: PaddingValues = PaddingValues( | ||
horizontal = 16.dp, | ||
vertical = 16.dp | ||
), | ||
startDate: LocalDateTime, | ||
endDate: LocalDateTime, | ||
userCount: Int, | ||
color: Color = Cream, | ||
lastMemberName: String, | ||
onClick: () -> Unit = {} | ||
) { | ||
Card( | ||
modifier = modifier | ||
.fillMaxWidth() | ||
.clickable { | ||
onClick() | ||
}, | ||
colors = CardDefaults.cardColors( | ||
containerColor = color | ||
), | ||
elevation = CardDefaults.cardElevation( | ||
defaultElevation = 8.dp | ||
), | ||
shape = CardDefaults.outlinedShape, | ||
) { | ||
Column( | ||
modifier = modifier.padding( | ||
padding | ||
) | ||
) { | ||
Text( | ||
text = stringResource(R.string.relay), | ||
style = UlbanTypography.titleSmall | ||
) | ||
Spacer(modifier = modifier.padding(8.dp)) | ||
|
||
Text( | ||
text = "${startDate.formatToMonthDayTime()} ~ ${endDate.formatToMonthDayTime()}", | ||
style = UlbanTypography.bodySmall | ||
) | ||
Spacer(modifier = modifier.padding(8.dp)) | ||
|
||
Row (modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically){ | ||
AsyncImage( | ||
model = R.drawable.bomb, | ||
placeholder = painterResource(id =R.drawable.bomb), | ||
modifier = Modifier.size(42.dp), | ||
contentDescription = "bomb") | ||
|
||
Spacer(modifier = modifier.padding(4.dp)) | ||
|
||
Column(modifier = Modifier.weight(1f)) { | ||
Text( | ||
text = stringResource(R.string.relay_item_count, userCount), | ||
style = UlbanTypography.bodySmall | ||
) | ||
Spacer(modifier = modifier.padding(2.dp)) | ||
Text( | ||
text = stringResource(R.string.relay_item_last_member, lastMemberName), | ||
style = UlbanTypography.bodyMedium | ||
) | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
} | ||
|
||
@Composable | ||
@Preview(showBackground = true) | ||
fun UlbanChallengeItemPreview() { | ||
UlbanRelayItem( | ||
startDate = LocalDateTime.now(), | ||
endDate = LocalDateTime.now(), | ||
userCount = 0, | ||
lastMemberName = "홍유준" | ||
) | ||
} |
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
11 changes: 11 additions & 0 deletions
11
android/core/model/src/main/java/com/sixkids/model/Relay.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,11 @@ | ||
package com.sixkids.model | ||
|
||
import java.time.LocalDateTime | ||
|
||
data class Relay( | ||
val id: Long = 0, | ||
val startTime: LocalDateTime = LocalDateTime.now(), | ||
val endTime: LocalDateTime = LocalDateTime.now(), | ||
val lastTurn: Int = 0, | ||
val lastMemberName: String = "", | ||
) |
5 changes: 5 additions & 0 deletions
5
android/core/model/src/main/java/com/sixkids/model/RelayDetail.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,5 @@ | ||
package com.sixkids.model | ||
|
||
data class RelayDetail( | ||
val id: Long = 0, | ||
) |
14 changes: 14 additions & 0 deletions
14
android/core/model/src/main/java/com/sixkids/model/RunningRelay.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,14 @@ | ||
package com.sixkids.model | ||
|
||
import java.time.LocalDateTime | ||
|
||
data class RunningRelay( | ||
val id: Long = 0, | ||
val totalMemberCount: Int = 0, // 전체 턴 횟수 (선생님만 볼 수 있음) | ||
val doneMemberCount: Int = 0, // 현재 진행된 턴 횟수 (선생님만 볼 수 있음) | ||
val startTime: LocalDateTime = LocalDateTime.now(), | ||
val endTime: LocalDateTime = LocalDateTime.now(), | ||
val curMemberNickname: String = "", | ||
val myTurnStatus : Boolean = false, | ||
val lastTurnMemberName: String = "" | ||
) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ android { | |
} | ||
|
||
dependencies { | ||
implementation(libs.bundles.paging) | ||
} |
18 changes: 18 additions & 0 deletions
18
...ure/student/relay/src/main/java/com/sixkids/student/relay/history/RelayHistoryContract.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,18 @@ | ||
package com.sixkids.student.relay.history | ||
|
||
import com.sixkids.model.RunningRelay | ||
import com.sixkids.ui.base.SideEffect | ||
import com.sixkids.ui.base.UiState | ||
|
||
data class RelayHistoryState( | ||
val isLoading: Boolean = false, | ||
val runningRelay: RunningRelay? = null, | ||
val totalRelayCount: Int = 0, | ||
) : UiState | ||
|
||
sealed interface RelayHistoryEffect : SideEffect { | ||
data class NavigateToRelayDetail(val relayId: Long, val groupId: Long? = null) : RelayHistoryEffect | ||
data object NavigateToCreateRelay : RelayHistoryEffect | ||
data object NavigateToJoinRelay : RelayHistoryEffect | ||
data class HandleException(val throwable: Throwable, val retry: () -> Unit) : RelayHistoryEffect | ||
} |
Oops, something went wrong.