fixed menu formatting
This commit is contained in:
parent
a6d14044c2
commit
953185425b
@ -41,6 +41,7 @@ import org.mosad.seil0.projectlaogai.hsoparser.NotRetardedCalendar
|
|||||||
import org.mosad.seil0.projectlaogai.uicomponents.LessonCardView
|
import org.mosad.seil0.projectlaogai.uicomponents.LessonCardView
|
||||||
import org.mosad.seil0.projectlaogai.uicomponents.LessonTextView
|
import org.mosad.seil0.projectlaogai.uicomponents.LessonTextView
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
import kotlin.collections.ArrayList
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The "home" controller class
|
* The "home" controller class
|
||||||
@ -90,15 +91,16 @@ class HomeFragment : Fragment() {
|
|||||||
// get the index of the first meal, not a "Schneller Teller"
|
// get the index of the first meal, not a "Schneller Teller"
|
||||||
loop@ for ((i, meal) in dayMeals.withIndex()) {
|
loop@ for ((i, meal) in dayMeals.withIndex()) {
|
||||||
if (meal.heading.contains("Essen")) {
|
if (meal.heading.contains("Essen")) {
|
||||||
for ((j, part) in dayMeals[i].parts.withIndex()) {
|
|
||||||
|
dayMeals[i].parts.forEachIndexed { index, part ->
|
||||||
txtViewMenu1.append(part)
|
txtViewMenu1.append(part)
|
||||||
if (j < (dayMeals[i].parts.size - 2))
|
if (index < (dayMeals[i].parts.size - 1))
|
||||||
txtViewMenu1.append("\n")
|
txtViewMenu1.append("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
for ((j, part) in dayMeals[i + 1].parts.withIndex()) {
|
dayMeals[i + 1].parts.forEachIndexed { index, part ->
|
||||||
txtViewMenu2.append(part)
|
txtViewMenu2.append(part)
|
||||||
if (j < (dayMeals[i + 1].parts.size - 2))
|
if (index < (dayMeals[i + 1].parts.size - 1))
|
||||||
txtViewMenu2.append("\n")
|
txtViewMenu2.append("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class MensaFragment : Fragment() {
|
|||||||
|
|
||||||
meal.parts.forEachIndexed { partIndex, part ->
|
meal.parts.forEachIndexed { partIndex, part ->
|
||||||
menuViewMenu.getTxtViewMenu().append(part)
|
menuViewMenu.getTxtViewMenu().append(part)
|
||||||
if(partIndex < (meal.parts.size - 2))
|
if(partIndex < (meal.parts.size - 1))
|
||||||
menuViewMenu.getTxtViewMenu().append("\n")
|
menuViewMenu.getTxtViewMenu().append("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +92,6 @@ class MensaFragment : Fragment() {
|
|||||||
cardViewMensaDay.getLinLayoutMensaDay().addView(menuViewMenu)
|
cardViewMensaDay.getLinLayoutMensaDay().addView(menuViewMenu)
|
||||||
}
|
}
|
||||||
|
|
||||||
println("$dayIndex:" + cardViewMensaDay.getLinLayoutMensaDay().childCount) // remove
|
|
||||||
|
|
||||||
if(cardViewMensaDay.getLinLayoutMensaDay().childCount > 1)
|
if(cardViewMensaDay.getLinLayoutMensaDay().childCount > 1)
|
||||||
linLayoutMensaFragment.addView(cardViewMensaDay)
|
linLayoutMensaFragment.addView(cardViewMensaDay)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user