the home screen will now always show the first 2 meals

* things like a "Schneller Teller" are not shown in the home screen anymore
* updated ti kotlin 1.3.10
This commit is contained in:
Jannik 2018-11-16 14:19:24 +01:00
parent 8fa0d496c6
commit f6f652ffb6
3 changed files with 17 additions and 8 deletions

View File

@ -12,8 +12,8 @@ android {
applicationId "org.mosad.seil0.projectlaogai"
minSdkVersion 21
targetSdkVersion 28
versionCode 6
versionName "0.2.2"
versionCode 7
versionName "0.2.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {

View File

@ -76,6 +76,7 @@ class HomeFragment : Fragment() {
} else {
dayMenus = MensaParser().getMensaMenuDay(mainActivity.getWeekMenu(), cal.get(Calendar.DAY_OF_WEEK) + 1)
uiThread {
// TODO Mensa closed today is showing
txtView_Menu1Heading.text = resources.getString(R.string.meal_1_tomorrow)
txtView_Menu2Heading.text = resources.getString(R.string.meal_2_tomorrow)
}
@ -84,13 +85,21 @@ class HomeFragment : Fragment() {
uiThread {
if (dayMenus.size >= 2) {
for (part in dayMenus[0].parts) {
// get the index of the first meal, not a "Schneller Teller"
loop@ for ((i, meal) in dayMenus.withIndex()) {
if(meal.heading.contains("Essen")) {
for (part in dayMenus[i].parts) {
txtViewMenu1.append(part)
}
for (part in dayMenus[1].parts) {
for (part in dayMenus[i + 1].parts) {
txtViewMenu2.append(part)
}
break@loop
}
}
} else {
txtViewMenu1.text = resources.getString(R.string.no_meal_today)
txtViewMenu2.text = resources.getString(R.string.no_meal_today)

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.0'
ext.kotlin_version = '1.3.10'
repositories {
google()
jcenter()