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 {
|
||||
NotificationData(
|
||||
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),
|
||||
)
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import java.time.LocalDate
|
||||
|
||||
val debugGradeDetailsItems = listOf(
|
||||
generateGrade("Matematyka", "+"),
|
||||
generateGrade("Matematyka", "2="),
|
||||
generateGrade("Matematyka", "120", comment = "%"),
|
||||
generateGrade("Fizyka", "-"),
|
||||
generateGrade("Geografia", "4+"),
|
||||
generateGrade("Sieci komputerowe", "1"),
|
||||
@ -17,14 +17,14 @@ val debugGradeDetailsItems = listOf(
|
||||
generateGrade("Wychowanie fizyczne", "5"),
|
||||
)
|
||||
|
||||
private fun generateGrade(subject: String, entry: String) = Grade(
|
||||
private fun generateGrade(subject: String, entry: String, comment: String = "") = Grade(
|
||||
subject = subject,
|
||||
entry = entry,
|
||||
semesterId = 0,
|
||||
studentId = 0,
|
||||
value = 0.0,
|
||||
modifier = 0.0,
|
||||
comment = "",
|
||||
comment = comment,
|
||||
color = "",
|
||||
gradeSymbol = "",
|
||||
description = "",
|
||||
|
Loading…
x
Reference in New Issue
Block a user