updated some libs, meal tomorrow shows correct string if there's no meal
This commit is contained in:
@ -75,7 +75,6 @@ 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)
|
||||
}
|
||||
@ -86,16 +85,16 @@ class HomeFragment : Fragment() {
|
||||
if (dayMenus.size >= 2) {
|
||||
// get the index of the first meal, not a "Schneller Teller"
|
||||
loop@ for ((i, meal) in dayMenus.withIndex()) {
|
||||
if(meal.heading.contains("Essen")) {
|
||||
if (meal.heading.contains("Essen")) {
|
||||
for ((j, part) in dayMenus[i].parts.withIndex()) {
|
||||
txtViewMenu1.append(part)
|
||||
if(j < (dayMenus[i].parts.size - 2))
|
||||
if (j < (dayMenus[i].parts.size - 2))
|
||||
txtViewMenu1.append("\n")
|
||||
}
|
||||
|
||||
for ((j, part) in dayMenus[i + 1].parts.withIndex()) {
|
||||
txtViewMenu2.append(part)
|
||||
if(j < (dayMenus[i + 1].parts.size - 2))
|
||||
if (j < (dayMenus[i + 1].parts.size - 2))
|
||||
txtViewMenu2.append("\n")
|
||||
}
|
||||
|
||||
@ -104,8 +103,13 @@ class HomeFragment : Fragment() {
|
||||
}
|
||||
|
||||
} else {
|
||||
txtViewMenu1.text = resources.getString(R.string.no_meal_today)
|
||||
txtViewMenu2.text = resources.getString(R.string.no_meal_today)
|
||||
if (txtView_Menu1Heading.text == resources.getString(R.string.meal_1_tomorrow)) {
|
||||
txtViewMenu1.text = resources.getString(R.string.no_meal_tomorrow)
|
||||
txtViewMenu2.text = resources.getString(R.string.no_meal_tomorrow)
|
||||
} else {
|
||||
txtViewMenu1.text = resources.getString(R.string.no_meal_today)
|
||||
txtViewMenu2.text = resources.getString(R.string.no_meal_today)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ class MensaFragment : Fragment() {
|
||||
menuViewMenu.getTxtViewMenu().append("\n")
|
||||
}
|
||||
|
||||
cardViewMensaDay.setDayHeading(meal.day) //TODO move this out of the first for loop, performance!!
|
||||
cardViewMensaDay.setDayHeading(meal.day)
|
||||
cardViewMensaDay.getLinLayoutMensaDay().addView(menuViewMenu)
|
||||
add = true
|
||||
}
|
||||
|
Reference in New Issue
Block a user