forked from github/wulkanowy-mirror
Display comment after entry in grade notifications (#1741)
This commit is contained in:
parent
20673c4ead
commit
a03bcf8e62
@ -22,7 +22,10 @@ class NewGradeNotification @Inject constructor(
|
|||||||
val notificationDataList = items.map {
|
val notificationDataList = items.map {
|
||||||
NotificationData(
|
NotificationData(
|
||||||
title = context.getPlural(R.plurals.grade_new_items, 1),
|
title = context.getPlural(R.plurals.grade_new_items, 1),
|
||||||
content = "${it.subject}: ${it.entry}",
|
content = buildString {
|
||||||
|
append("${it.subject}: ${it.entry}")
|
||||||
|
if (it.comment.isNotBlank()) append(" (${it.comment})")
|
||||||
|
},
|
||||||
intentToStart = SplashActivity.getStartIntent(context, Destination.Grade),
|
intentToStart = SplashActivity.getStartIntent(context, Destination.Grade),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import java.time.LocalDate
|
|||||||
|
|
||||||
val debugGradeDetailsItems = listOf(
|
val debugGradeDetailsItems = listOf(
|
||||||
generateGrade("Matematyka", "+"),
|
generateGrade("Matematyka", "+"),
|
||||||
generateGrade("Matematyka", "2="),
|
generateGrade("Matematyka", "120", comment = "%"),
|
||||||
generateGrade("Fizyka", "-"),
|
generateGrade("Fizyka", "-"),
|
||||||
generateGrade("Geografia", "4+"),
|
generateGrade("Geografia", "4+"),
|
||||||
generateGrade("Sieci komputerowe", "1"),
|
generateGrade("Sieci komputerowe", "1"),
|
||||||
@ -17,14 +17,14 @@ val debugGradeDetailsItems = listOf(
|
|||||||
generateGrade("Wychowanie fizyczne", "5"),
|
generateGrade("Wychowanie fizyczne", "5"),
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun generateGrade(subject: String, entry: String) = Grade(
|
private fun generateGrade(subject: String, entry: String, comment: String = "") = Grade(
|
||||||
subject = subject,
|
subject = subject,
|
||||||
entry = entry,
|
entry = entry,
|
||||||
semesterId = 0,
|
semesterId = 0,
|
||||||
studentId = 0,
|
studentId = 0,
|
||||||
value = 0.0,
|
value = 0.0,
|
||||||
modifier = 0.0,
|
modifier = 0.0,
|
||||||
comment = "",
|
comment = comment,
|
||||||
color = "",
|
color = "",
|
||||||
gradeSymbol = "",
|
gradeSymbol = "",
|
||||||
description = "",
|
description = "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user