add a weekly calendar implementation placeholder

This commit is contained in:
tibbi 2017-01-15 20:48:39 +01:00
parent 9dba6e05ef
commit 80dd147799
3 changed files with 33 additions and 2 deletions

View File

@ -12,13 +12,12 @@ class MonthlyCalendarImpl(val mCallback: MonthlyCalendar, val mContext: Context)
private val DAYS_CNT = 42 private val DAYS_CNT = 42
private val YEAR_PATTERN = "YYYY" private val YEAR_PATTERN = "YYYY"
private val mToday: String private val mToday: String = DateTime().toString(Formatter.DAYCODE_PATTERN)
var mEvents: List<Event> var mEvents: List<Event>
lateinit var mTargetDate: DateTime lateinit var mTargetDate: DateTime
init { init {
mToday = DateTime().toString(Formatter.DAYCODE_PATTERN)
mEvents = ArrayList<Event>() mEvents = ArrayList<Event>()
} }

View File

@ -0,0 +1,25 @@
package com.simplemobiletools.calendar.helpers
import android.content.Context
import com.simplemobiletools.calendar.interfaces.WeeklyCalendar
import com.simplemobiletools.calendar.models.Event
import org.joda.time.DateTime
import java.util.*
class WeeklyCalendarImpl(val mCallback: WeeklyCalendar, val mContext: Context) : DBHelper.GetEventsListener {
var mEvents: List<Event>
lateinit var mTargetDate: DateTime
init {
mEvents = ArrayList<Event>()
}
fun updateWeeklyCalendar(targetDate: DateTime) {
mTargetDate = targetDate
}
override fun gotEvents(events: MutableList<Event>) {
mEvents = events
}
}

View File

@ -0,0 +1,7 @@
package com.simplemobiletools.calendar.interfaces
import com.simplemobiletools.calendar.models.Event
interface WeeklyCalendar {
fun updateWeeklyCalendar(events: List<Event>)
}