Browse Source

turns out there is a current week too

* don't debug timetable cod on Sundays, since there are no lessons on Sunday
pull/35/head
Jannik 3 years ago
parent
commit
b240beacc9
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
  1. 4
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/HomeFragment.kt
  2. 6
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/TimeTableFragment.kt

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

@ -150,8 +150,8 @@ class HomeFragment : Fragment() {
for (dayIndex in dayIndexSearch..5) {
dayTimetable = timetables[weekIndexSearch].timetable.days[dayIndex]
// some wired calendar magic, calculate the correct date to be shown ((timetable week - current week * 7) + days of calendar week + 1)
val daysToAdd = (timetables[weekIndexSearch].meta.weekNumberYear - NotRetardedCalendar.getWeekOfYear() - 1) * 7 + dayIndex +1
// some wired calendar magic, calculate the correct date to be shown ((timetable week - current week * 7) + (dayIndex - dayIndex of current week)
val daysToAdd =(timetables[weekIndexSearch].meta.weekNumberYear - NotRetardedCalendar.getWeekOfYear()) * 7 + (dayIndex - NotRetardedCalendar.getDayOfWeekIndex())
dayCardView.addTimetableDay(dayTimetable, daysToAdd)
// if there are no lessons don't show the dayCardView

6
app/src/main/java/org/mosad/seil0/projectlaogai/fragments/TimeTableFragment.kt

@ -40,8 +40,6 @@ import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.
import org.mosad.seil0.projectlaogai.controller.TCoRAPIController
import org.mosad.seil0.projectlaogai.hsoparser.NotRetardedCalendar
import org.mosad.seil0.projectlaogai.uicomponents.DayCardView
import java.text.SimpleDateFormat
import java.util.*
/**
* The timetable controller class
@ -122,8 +120,8 @@ class TimeTableFragment : Fragment() {
for (dayIndex in startDayIndex..dayEndIndex) {
val dayCardView = DayCardView(context!!)
// some wired calendar magic, calculate the correct date to be shown ((timetable week - current week * 7) + days of calendar week + 1)
val daysToAdd = (timetableMeta.weekNumberYear - NotRetardedCalendar.getWeekOfYear() - 1) * 7 + dayIndex +1
// some wired calendar magic, calculate the correct date to be shown ((timetable week - current week * 7) + (dayIndex - dayIndex of current week)
val daysToAdd =(timetableMeta.weekNumberYear - NotRetardedCalendar.getWeekOfYear()) * 7 + (dayIndex - NotRetardedCalendar.getDayOfWeekIndex())
dayCardView.addTimetableDay(timetable.days[dayIndex], daysToAdd)
// if there are no lessons don't show the dayCardView

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