[Bugs] Update gradle. Fix crashes in the timetable widget.

This commit is contained in:
Kuba Szczodrzyński 2019-11-15 19:55:46 +01:00
parent 13b58a1d56
commit 965f5e73d9
4 changed files with 7 additions and 3 deletions

View File

@ -185,12 +185,12 @@ class WidgetTimetable : AppWidgetProvider() {
// search for lessons to display // search for lessons to display
val timetableDate = Date.getToday() val timetableDate = Date.getToday()
var checkedDays = 0 var checkedDays = 0
var lessons = lessonList.filter { it.profileId == profile.id && it.displayDate == timetableDate } var lessons = lessonList.filter { it.profileId == profile.id && it.displayDate == timetableDate && it.type != Lesson.TYPE_NO_LESSONS }
while ((lessons.isEmpty() || lessons.none { while ((lessons.isEmpty() || lessons.none {
it.displayDate != today || (it.displayDate == today && it.displayEndTime != null && it.displayEndTime!! >= now) it.displayDate != today || (it.displayDate == today && it.displayEndTime != null && it.displayEndTime!! >= now)
}) && checkedDays < 7) { }) && checkedDays < 7) {
timetableDate.stepForward(0, 0, 1) timetableDate.stepForward(0, 0, 1)
lessons = lessonList.filter { it.profileId == profile.id && it.displayDate == timetableDate } lessons = lessonList.filter { it.profileId == profile.id && it.displayDate == timetableDate && it.type != Lesson.TYPE_NO_LESSONS }
checkedDays++ checkedDays++
} }

View File

@ -50,6 +50,8 @@ class EventManualV2Dialog(
private var defaultLoaded = false private var defaultLoaded = false
init { run { init { run {
if (activity.isFinishing)
return@run
job = Job() job = Job()
onShowListener?.invoke(TAG) onShowListener?.invoke(TAG)
b = DialogEventManualV2Binding.inflate(activity.layoutInflater) b = DialogEventManualV2Binding.inflate(activity.layoutInflater)

View File

@ -33,6 +33,8 @@ class LessonDetailsDialog(
private lateinit var dialog: AlertDialog private lateinit var dialog: AlertDialog
init { run { init { run {
if (activity.isFinishing)
return@run
onShowListener?.invoke(TAG) onShowListener?.invoke(TAG)
b = DialogLessonDetailsBinding.inflate(activity.layoutInflater) b = DialogLessonDetailsBinding.inflate(activity.layoutInflater)
dialog = MaterialAlertDialogBuilder(activity) dialog = MaterialAlertDialogBuilder(activity)

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip