Skip to content

Commit 4b02e71

Browse files
feat: separator between assignment policies on the progress
1 parent 924461f commit 4b02e71

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

core/src/main/java/org/openedx/core/ui/theme/AppColors.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ data class AppColors(
7878
val settingsTitleContent: Color,
7979

8080
val progressBarColor: Color,
81-
val progressBarBackgroundColor: Color
81+
val progressBarBackgroundColor: Color,
82+
val gradeProgressBarBorder: Color,
8283
) {
8384
val primary: Color get() = material.primary
8485
val primaryVariant: Color get() = material.primaryVariant

core/src/main/java/org/openedx/core/ui/theme/Theme.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ private val DarkColorPalette = AppColors(
9696
settingsTitleContent = dark_settings_title_content,
9797

9898
progressBarColor = dark_progress_bar_color,
99-
progressBarBackgroundColor = dark_progress_bar_background_color
99+
progressBarBackgroundColor = dark_progress_bar_background_color,
100+
gradeProgressBarBorder = dark_grade_progress_bar_color
100101
)
101102

102103
private val LightColorPalette = AppColors(
@@ -185,7 +186,8 @@ private val LightColorPalette = AppColors(
185186
settingsTitleContent = light_settings_title_content,
186187

187188
progressBarColor = light_progress_bar_color,
188-
progressBarBackgroundColor = light_progress_bar_background_color
189+
progressBarBackgroundColor = light_progress_bar_background_color,
190+
gradeProgressBarBorder = light_grade_progress_bar_color
189191
)
190192

191193
val MaterialTheme.appColors: AppColors

core/src/openedx/org/openedx/core/ui/theme/Colors.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ val light_course_home_back_btn_background = Color.White
7474
val light_settings_title_content = Color.White
7575
val light_progress_bar_color = light_primary
7676
val light_progress_bar_background_color = Color(0xFFCCD4E0)
77+
val light_grade_progress_bar_color = Color.Black
7778

7879
val dark_primary = Color(0xFF3F68F8)
7980
val dark_primary_variant = Color(0xFF3700B3)
@@ -147,3 +148,4 @@ val dark_course_home_back_btn_background = Color.Black
147148
val dark_settings_title_content = Color.White
148149
val dark_progress_bar_color = light_primary
149150
val dark_progress_bar_background_color = Color(0xFF8E9BAE)
151+
val dark_grade_progress_bar_color = Color.Transparent

course/src/main/java/org/openedx/course/presentation/progress/CourseProgressScreen.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,11 @@ private fun OverallGradeView(
310310
.clip(CircleShape)
311311
.border(
312312
width = 1.dp,
313-
color = MaterialTheme.appColors.cardViewBackground,
313+
color = MaterialTheme.appColors.gradeProgressBarBorder,
314314
shape = CircleShape
315315
)
316316
) {
317-
gradingPolicy.assignmentPolicies.forEach { assignmentPolicy ->
317+
gradingPolicy.assignmentPolicies.forEachIndexed { index, assignmentPolicy ->
318318
val assignmentColors = gradingPolicy.assignmentColors
319319
val color = if (assignmentColors.isNotEmpty()) {
320320
assignmentColors[
@@ -334,6 +334,16 @@ private fun OverallGradeView(
334334
.background(color)
335335
.fillMaxHeight()
336336
)
337+
338+
// Add black separator between assignment policies (except after the last one)
339+
if (index < gradingPolicy.assignmentPolicies.size - 1) {
340+
Box(
341+
modifier = Modifier
342+
.width(1.dp)
343+
.background(Color.Black)
344+
.fillMaxHeight()
345+
)
346+
}
337347
}
338348
}
339349
if (notCompletedWeightedGradePercent > 0f) {

0 commit comments

Comments
 (0)