fixed menu formatting

This commit is contained in:
Jannik 2019-03-17 20:52:34 +01:00
parent a6d14044c2
commit 953185425b
2 changed files with 7 additions and 7 deletions

View File

@ -41,6 +41,7 @@ import org.mosad.seil0.projectlaogai.hsoparser.NotRetardedCalendar
import org.mosad.seil0.projectlaogai.uicomponents.LessonCardView
import org.mosad.seil0.projectlaogai.uicomponents.LessonTextView
import java.util.*
import kotlin.collections.ArrayList
/**
* The "home" controller class
@ -90,15 +91,16 @@ class HomeFragment : Fragment() {
// get the index of the first meal, not a "Schneller Teller"
loop@ for ((i, meal) in dayMeals.withIndex()) {
if (meal.heading.contains("Essen")) {
for ((j, part) in dayMeals[i].parts.withIndex()) {
dayMeals[i].parts.forEachIndexed { index, part ->
txtViewMenu1.append(part)
if (j < (dayMeals[i].parts.size - 2))
if (index < (dayMeals[i].parts.size - 1))
txtViewMenu1.append("\n")
}
for ((j, part) in dayMeals[i + 1].parts.withIndex()) {
dayMeals[i + 1].parts.forEachIndexed { index, part ->
txtViewMenu2.append(part)
if (j < (dayMeals[i + 1].parts.size - 2))
if (index < (dayMeals[i + 1].parts.size - 1))
txtViewMenu2.append("\n")
}

View File

@ -82,7 +82,7 @@ class MensaFragment : Fragment() {
meal.parts.forEachIndexed { partIndex, part ->
menuViewMenu.getTxtViewMenu().append(part)
if(partIndex < (meal.parts.size - 2))
if(partIndex < (meal.parts.size - 1))
menuViewMenu.getTxtViewMenu().append("\n")
}
@ -92,8 +92,6 @@ class MensaFragment : Fragment() {
cardViewMensaDay.getLinLayoutMensaDay().addView(menuViewMenu)
}
println("$dayIndex:" + cardViewMensaDay.getLinLayoutMensaDay().childCount) // remove
if(cardViewMensaDay.getLinLayoutMensaDay().childCount > 1)
linLayoutMensaFragment.addView(cardViewMensaDay)