fixed text overlapping and some crashes
This commit is contained in:
@ -87,12 +87,16 @@ class HomeFragment : Fragment() {
|
||||
// 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) {
|
||||
for ((j, part) in dayMenus[i].parts.withIndex()) {
|
||||
txtViewMenu1.append(part)
|
||||
if(j < (dayMenus[i].parts.size - 2))
|
||||
txtViewMenu1.append("\n")
|
||||
}
|
||||
|
||||
for (part in dayMenus[i + 1].parts) {
|
||||
for ((j, part) in dayMenus[i + 1].parts.withIndex()) {
|
||||
txtViewMenu2.append(part)
|
||||
if(j < (dayMenus[i + 1].parts.size - 2))
|
||||
txtViewMenu2.append("\n")
|
||||
}
|
||||
|
||||
break@loop
|
||||
|
@ -55,7 +55,11 @@ class TimeTableFragment : Fragment() {
|
||||
|
||||
linLayoutTTFragment = view.findViewById(R.id.linLayout_TTFragment)
|
||||
|
||||
addCurrentWeek()
|
||||
if (mainActivity.getTimeTableCurrentWeek().isNotEmpty()) {
|
||||
addCurrentWeek()
|
||||
} else {
|
||||
// TODO show card with error msg
|
||||
}
|
||||
|
||||
return view
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class MensaParser {
|
||||
for (i in 0 .. (element.select("div.row h4").size - 1)) {
|
||||
try {
|
||||
val heading = element.select("div.row h4")[i].text()
|
||||
val parts = ArrayList<String>(element.select("div.row").select("div.menu-info")[i].html().substringBefore("<span").replace("<br>", "|").split("|"))
|
||||
val parts = ArrayList<String>(element.select("div.row").select("div.menu-info")[i].html().substringBefore("<span").replace("<br>", "").split("\n"))
|
||||
val additives = element.select("div.row").select("div.menu-info")[i].select("span.show-with-allergenes").text()
|
||||
|
||||
mealList.add(Meal(day, heading, parts, additives))
|
||||
@ -52,6 +52,7 @@ class MensaParser {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mealList
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user