fix no meal info showing if first weeks meals are empty
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jannik 2020-10-02 14:00:42 +02:00
parent f40c0503c0
commit 1162ec73e5
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
3 changed files with 17 additions and 17 deletions

View File

@ -14,8 +14,8 @@ android {
applicationId "org.mosad.seil0.projectlaogai"
minSdkVersion 23
targetSdkVersion 30
versionCode 6090 // 00.06.090
versionName "0.6.1-beta1"
versionCode 6091 // 00.06.091
versionName "0.6.1-beta2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resValue "string", "build_time", buildTime()
setProperty("archivesBaseName", "projectlaogai-$versionName")
@ -63,8 +63,8 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8'
implementation 'androidx.core:core:1.3.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
implementation 'androidx.core:core:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'

View File

@ -61,18 +61,18 @@ class MensaFragment : Fragment() {
GlobalScope.launch(Dispatchers.Default) {
val dayCurrent = if(NotRetardedCalendar.getDayOfWeekIndex() == 6) 0 else NotRetardedCalendar.getDayOfWeekIndex()
// add the current and next week
addWeek(mensaMenu.currentWeek, dayCurrent).join()
addWeek(mensaMenu.nextWeek, 0).join()
// add the next week
addWeek(mensaMenu.nextWeek, 0)
}
// show a info if there are no more menus
if (linLayout_Mensa.childCount == 0) {
val txtViewInfo = TextViewInfo(context!!).set {
txt = resources.getString(R.string.no_more_meals)
// show a info if there are no more menus
if (linLayout_Mensa.childCount == 0) {
val txtViewInfo = TextViewInfo(context!!).set {
txt = resources.getString(R.string.no_more_meals)
}
linLayout_Mensa.addView(txtViewInfo)
}
linLayout_Mensa.addView(txtViewInfo)
}
}
@ -133,10 +133,10 @@ class MensaFragment : Fragment() {
// add the refreshed menus
val dayCurrent = if (NotRetardedCalendar.getDayOfWeekIndex() == 6) 0 else NotRetardedCalendar.getDayOfWeekIndex()
addWeek(mensaMenu.currentWeek, dayCurrent).join()
// add the next week
addWeek(mensaMenu.nextWeek, 0)
// add the current and next week
addWeek(mensaMenu.currentWeek, dayCurrent).join()
addWeek(mensaMenu.nextWeek, 0).join()
refreshLayout_Mensa.isRefreshing = false

View File

@ -103,7 +103,7 @@ class GradesUpdateWorker(val context: Context, params: WorkerParameters): Worker
NotificationManagerCompat.from(context).apply {
cancel(notificationIdChecking)
}
return Result.success()
}