Browse Source

updated some libs, meal tomorrow shows correct string if there's no meal

pull/20/head
Jannik 4 years ago
parent
commit
b49d16b1a1
  1. 4
      app/build.gradle
  2. 16
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/HomeFragment.kt
  3. 2
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/MensaFragment.kt
  4. 1
      app/src/main/res/values-de-rDE/strings.xml
  5. 1
      app/src/main/res/values/strings.xml

4
app/build.gradle

@ -35,8 +35,8 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'org.jetbrains.anko:anko-commons:0.10.8'
implementation 'com.afollestad.material-dialogs:core:2.0.0-rc1'
implementation 'com.afollestad.material-dialogs:color:2.0.0-rc1'
implementation 'com.afollestad.material-dialogs:core:2.0.0-rc3'
implementation 'com.afollestad.material-dialogs:color:2.0.0-rc3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

16
app/src/main/java/org/mosad/seil0/projectlaogai/fragments/HomeFragment.kt

@ -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)
}
}
}
}

2
app/src/main/java/org/mosad/seil0/projectlaogai/fragments/MensaFragment.kt

@ -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
}

1
app/src/main/res/values-de-rDE/strings.xml

@ -10,6 +10,7 @@
<string name="meal_1_tomorrow">Essen 1, Morgen</string>
<string name="meal_2_tomorrow">Essen 1, Morgen</string>
<string name="no_meal_today">heute keine Essensausgabe</string>
<string name="no_meal_tomorrow">morgen keine Essensausgabe</string>
<string name="no_more_food">Diese Woche keine weitere Essensausgabe</string>
<string name="no_lesson_today">heute keine Vorlesung</string>
<string name="error">Fehler</string>

1
app/src/main/res/values/strings.xml

@ -17,6 +17,7 @@
<string name="meal_1_tomorrow">Meal 1, tomorrow</string>
<string name="meal_2_tomorrow">Meal 2, tomorrow</string>
<string name="no_meal_today">Mensa closed today</string>
<string name="no_meal_tomorrow">Mensa closed tomorrow</string>
<string name="no_more_food">No more Food this week</string>
<string name="no_lesson_today">"no lecture today "</string>

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close