-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: ExamData에 quiz 관련 property 추가 * feat: Detail Screen 덕퀴즈인지, 일반 시험인지에 따라 분기할 수 있도록 재정비 * feat: 현재 quiz 정보인지에 대한 상태 추가 * feat: 새로운 왕관 아이콘 추가 * feat: String Resource 추가 * feat: ExamDetail에 대한 컴포저블 분리, 추후 시험 메타데이터 제공할 수 있도록 TODO 작성 * refactor: lint 검출 사항 수정 * feat: ranking empty일 때 케이스 고려
- Loading branch information
1 parent
3327a14
commit fe0b511
Showing
16 changed files
with
754 additions
and
399 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
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
24 changes: 24 additions & 0 deletions
24
data/src/main/kotlin/team/duckie/app/android/data/exam/model/QuizInfoResponse.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,24 @@ | ||
/* | ||
* Designed and developed by Duckie Team, 2022 | ||
* | ||
* Licensed under the MIT. | ||
* Please see full license: https://github.com/duckie-team/duckie-android/blob/develop/LICENSE | ||
*/ | ||
|
||
package team.duckie.app.android.data.exam.model | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty | ||
import team.duckie.app.android.data.user.model.UserResponse | ||
|
||
data class QuizInfoResponse( | ||
@JsonProperty("id") | ||
val id: Int? = null, | ||
@JsonProperty("correctProblemCount") | ||
val correctProblemCount: Int? = null, | ||
@JsonProperty("score") | ||
val score: Int? = null, | ||
@JsonProperty("time") | ||
val time: Int? = null, | ||
@JsonProperty("user") | ||
val user: UserResponse? = null, | ||
) |
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
20 changes: 20 additions & 0 deletions
20
domain/src/main/kotlin/team/duckie/app/android/domain/quiz/model/QuizInfo.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,20 @@ | ||
/* | ||
* Designed and developed by Duckie Team, 2022 | ||
* | ||
* Licensed under the MIT. | ||
* Please see full license: https://github.com/duckie-team/duckie-android/blob/develop/LICENSE | ||
*/ | ||
|
||
package team.duckie.app.android.domain.quiz.model | ||
|
||
import androidx.compose.runtime.Immutable | ||
import team.duckie.app.android.domain.user.model.User | ||
|
||
@Immutable | ||
data class QuizInfo( | ||
val id: Int, | ||
val correctProblemCount: Int, | ||
val score: Int, | ||
val user: User, | ||
val time: Int, | ||
) |
69 changes: 69 additions & 0 deletions
69
...-detail/src/main/kotlin/team/duckie/app/android/feature/ui/detail/common/BottomContent.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,69 @@ | ||
/* | ||
* Designed and developed by Duckie Team, 2022 | ||
* | ||
* Licensed under the MIT. | ||
* Please see full license: https://github.com/duckie-team/duckie-android/blob/develop/LICENSE | ||
*/ | ||
|
||
package team.duckie.app.android.feature.ui.detail.common | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.DpSize | ||
import androidx.compose.ui.unit.dp | ||
import team.duckie.app.android.feature.ui.detail.viewmodel.state.DetailState | ||
import team.duckie.app.android.shared.ui.compose.Spacer | ||
import team.duckie.quackquack.ui.R | ||
import team.duckie.quackquack.ui.component.QuackDivider | ||
import team.duckie.quackquack.ui.component.QuackImage | ||
import team.duckie.quackquack.ui.component.QuackSmallButton | ||
import team.duckie.quackquack.ui.component.QuackSmallButtonType | ||
|
||
/** 상세 화면 최하단 Layout */ | ||
@Composable | ||
internal fun DetailBottomLayout( | ||
modifier: Modifier, | ||
state: DetailState.Success, | ||
onHeartClick: () -> Unit, | ||
onChallengeClick: () -> Unit, | ||
) { | ||
Column(modifier = modifier) { | ||
Spacer(space = 20.dp) | ||
// 구분선 | ||
QuackDivider() | ||
// 버튼 모음 Layout | ||
// TODO(riflockle7): 추후 Layout 을 활용해 처리하기 | ||
Row( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 16.dp, vertical = 9.dp), | ||
verticalAlignment = Alignment.CenterVertically, | ||
horizontalArrangement = Arrangement.SpaceBetween, | ||
) { | ||
// 좋아요 버튼 | ||
QuackImage( | ||
src = if (state.isHeart) { | ||
R.drawable.quack_ic_heart_filled_24 | ||
} else { | ||
R.drawable.quack_ic_heart_24 | ||
}, | ||
size = DpSize(24.dp, 24.dp), | ||
onClick = onHeartClick, | ||
) | ||
|
||
// 버튼 | ||
QuackSmallButton( | ||
text = state.buttonTitle, | ||
type = QuackSmallButtonType.Fill, | ||
enabled = true, | ||
onClick = onChallengeClick, | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.