Notifications can now show type when additional string is empty

This commit is contained in:
Deniz Düzgören
2019-09-18 16:24:12 +02:00
parent be810e5bfb
commit 1414cdbb38
2 changed files with 4 additions and 6 deletions
@@ -190,7 +190,7 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
) )
}.forEach { substItem -> }.forEach { substItem ->
if (countOfNotificationItems < 4) { if (countOfNotificationItems < 4) {
notificationText += ("${if (notificationText.isNotEmpty()) ",\n" else ""}${substItem.course}: ${if (substItem.additional.isNotEmpty()) substItem.additional else "---"}") notificationText += ("${if (notificationText.isNotEmpty()) ",\n" else ""}${substItem.course}: ${if (substItem.additional.isNotEmpty()) substItem.additional else if (substItem.type.isNotEmpty()) substItem.type else "---"}")
countOfNotificationItems += 1 countOfNotificationItems += 1
} else { } else {
countOfMoreNotificationItems += 1 countOfMoreNotificationItems += 1
@@ -142,20 +142,18 @@ internal object HelperFunctions {
return true return true
} }
if (coursePreference.isEmpty() && classPreference.isNotEmpty()) { if (coursePreference.isEmpty() && classPreference.isNotEmpty()) {
if (group.isNotEmpty() && group != "") { if (group.isNotEmpty()) {
if (classPreference.contains(group) || group.contains(classPreference)) { if (classPreference.contains(group) || group.contains(classPreference)) {
return true return true
} }
} }
} else if (classPreference.isNotEmpty() && coursePreference.isNotEmpty()) { } else if (classPreference.isNotEmpty() && coursePreference.isNotEmpty()) {
if (group != "" && course != "") { if (group != "" && course != "") {
if (coursePreference.contains(course)) { if ((classPreference.contains(group) || group.contains(classPreference)) && coursePreference.contains(course)) {
if (classPreference.contains(group) || group.contains(classPreference)) {
return true return true
} }
} }
} }
}
return false return false
} }