mirror of
https://github.com/AdrianKuta/KahootQuiz.git
synced 2025-10-30 16:33:42 +01:00
7cd3394098389bbc2a48bd81f088f1ae23d94cc2
This commit refactors `QuizScreen.kt` by extracting several composable functions for better organization and readability. It also includes improvements to the timer logic and minor UI adjustments.
Key changes:
- **QuizScreen.kt:**
- Extracted `QuizScreenLoading` and `QuizScreenSuccess` composables to handle different UI states.
- Further decomposed `QuizScreenSuccess` into `LazyListScope` extension functions for `toolbar`, `questionContent`, `choices`, `timer`, and `continueButton`. This improves the structure of the `LazyColumn` and allows for more granular recomposition.
- Improved `TimerBar` logic:
- Ensured `targetValue` for `animateFloatAsState` is properly calculated to avoid division by zero when `totalSeconds` is 0.
- Coerced the progress `Float` value to be within `0f` and `1f` before applying it to `fillMaxWidth`.
- Changed `contentDescription` of the type icon in `QuizType` to `null` as it's decorative.
- Used `androidx.compose.runtime.remember` for `questionText` in `QuestionContent` to avoid unnecessary recomposition of `HtmlCompat.fromHtml`.
Description
No description provided
Languages
Kotlin
100%