mirror of
https://github.com/AdrianKuta/KahootQuiz.git
synced 2025-09-15 01:24:23 +02:00
feat: Enhance QuizScreen UI and introduce core design system module
This commit significantly revamps the `QuizScreen` UI to display question details including image and text, and introduces a new `core:designsystem` module to centralize theme, colors, typography, and drawable resources. Key changes: - **UI Layer (`ui:quiz` module):** - Updated `QuizScreen.kt`: - Implemented a background image for the screen. - Added a `Toolbar` composable to display question progress and type. - Created `QuestionContent` composable to show the question image (using Coil for image loading) and text. - Added a placeholder `Choices` composable (currently an empty `LazyVerticalGrid`). - Applied `fillMaxSize()` to the main `QuizScreen` modifier. - Included a `@Preview` for `QuizScreen` with sample data. - Modified `QuizScreenViewModel.kt` to update `QuizUiState` with the first `Question` from the fetched quiz. - Added a `quiz` string resource in `strings.xml`. - Added dependencies for Coil (compose and okhttp) in `ui/quiz/build.gradle.kts`. - **Core Design System (`core:designsystem` module):** - Created a new Android library module `core:designsystem`. - Moved `Color.kt`, `Theme.kt`, and `Type.kt` from `app/src/main/java/dev/adriankuta/kahootquiz/ui/theme` to this new module. - Added a new `Grey` color to `Color.kt`. - Added `bg_image.webp` and `ic_type.xml` drawable resources. - Configured the module with `kahootquiz.android.library.compose` plugin. - **App Module (`app` module):** - Updated `MainActivity.kt` to import `KahootQuizTheme` from the new `core.designsystem` package. - Added `implementation(projects.core.designsystem)` dependency in `app/build.gradle.kts`. - **Domain Layer (`domain` module):** - Made several fields in `Question.kt` and `Choice.kt` nullable and provided default null values to accommodate potential missing data from the API. - Specifically, `Question.image` is now non-nullable (`String`). - **Build System:** - Added `coilCompose` and `coilNetworkOkhttp` versions to `gradle/libs.versions.toml`. - Included `:core:designsystem` in `settings.gradle.kts`.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
[versions]
|
||||
coilCompose = "3.3.0"
|
||||
coilNetworkOkhttp = "3.3.0"
|
||||
retrofit = "3.0.0"
|
||||
targetSdk = "36"
|
||||
compileSdk = "36"
|
||||
@@ -94,6 +96,8 @@ androidx-work-testing = { group = "androidx.work", name = "work-testing", versio
|
||||
app-update-ktx = { module = "com.google.android.play:app-update-ktx", version.ref = "appUpdateKtx" }
|
||||
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
|
||||
billing-ktx = { group = "com.android.billingclient", name = "billing-ktx", version.ref = "billing" }
|
||||
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coilCompose" }
|
||||
coil-network-okhttp = { module = "io.coil-kt.coil3:coil-network-okhttp", version.ref = "coilNetworkOkhttp" }
|
||||
detekt-compose = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektCompose" }
|
||||
detekt-ktlint = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
|
||||
dotlottie-android = { module = "com.github.LottieFiles:dotlottie-android", version.ref = "dotlottieAndroid" }
|
||||
|
Reference in New Issue
Block a user