mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 04:10:45 +01:00
remove a redundant interface
This commit is contained in:
parent
ab0bfebdf1
commit
a105d270c0
@ -22,7 +22,7 @@ import kotlinx.android.synthetic.main.activity_event.*
|
|||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
class EventActivity : SimpleActivity() {
|
||||||
companion object {
|
companion object {
|
||||||
val STORED_LOCALLY_ONLY = 0
|
val STORED_LOCALLY_ONLY = 0
|
||||||
}
|
}
|
||||||
@ -753,13 +753,4 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
|||||||
event_type_image.applyColorFilter(textColor)
|
event_type_image.applyColorFilter(textColor)
|
||||||
event_caldav_calendar_image.applyColorFilter(textColor)
|
event_caldav_calendar_image.applyColorFilter(textColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun eventInserted(event: Event) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun eventsDeleted(cnt: Int) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun gotEvents(events: MutableList<Event>) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,9 @@ import com.simplemobiletools.calendar.extensions.config
|
|||||||
import com.simplemobiletools.calendar.extensions.dbHelper
|
import com.simplemobiletools.calendar.extensions.dbHelper
|
||||||
import com.simplemobiletools.calendar.extensions.getAppropriateTheme
|
import com.simplemobiletools.calendar.extensions.getAppropriateTheme
|
||||||
import com.simplemobiletools.calendar.extensions.getFilteredEvents
|
import com.simplemobiletools.calendar.extensions.getFilteredEvents
|
||||||
import com.simplemobiletools.calendar.helpers.*
|
import com.simplemobiletools.calendar.helpers.DAY_CODE
|
||||||
|
import com.simplemobiletools.calendar.helpers.EVENT_ID
|
||||||
|
import com.simplemobiletools.calendar.helpers.EVENT_OCCURRENCE_TS
|
||||||
import com.simplemobiletools.calendar.helpers.Formatter
|
import com.simplemobiletools.calendar.helpers.Formatter
|
||||||
import com.simplemobiletools.calendar.interfaces.DeleteEventsListener
|
import com.simplemobiletools.calendar.interfaces.DeleteEventsListener
|
||||||
import com.simplemobiletools.calendar.interfaces.NavigationListener
|
import com.simplemobiletools.calendar.interfaces.NavigationListener
|
||||||
@ -31,7 +33,7 @@ import kotlinx.android.synthetic.main.top_navigation.view.*
|
|||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class DayFragment : Fragment(), DBHelper.EventUpdateListener, DeleteEventsListener {
|
class DayFragment : Fragment(), DeleteEventsListener {
|
||||||
var mListener: NavigationListener? = null
|
var mListener: NavigationListener? = null
|
||||||
private var mTextColor = 0
|
private var mTextColor = 0
|
||||||
private var mDayCode = ""
|
private var mDayCode = ""
|
||||||
@ -110,7 +112,7 @@ class DayFragment : Fragment(), DBHelper.EventUpdateListener, DeleteEventsListen
|
|||||||
fun checkEvents() {
|
fun checkEvents() {
|
||||||
val startTS = Formatter.getDayStartTS(mDayCode)
|
val startTS = Formatter.getDayStartTS(mDayCode)
|
||||||
val endTS = Formatter.getDayEndTS(mDayCode)
|
val endTS = Formatter.getDayEndTS(mDayCode)
|
||||||
DBHelper.newInstance(context!!, this).getEvents(startTS, endTS) {
|
context!!.dbHelper.getEvents(startTS, endTS) {
|
||||||
receivedEvents(it)
|
receivedEvents(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -165,15 +167,4 @@ class DayFragment : Fragment(), DBHelper.EventUpdateListener, DeleteEventsListen
|
|||||||
}
|
}
|
||||||
(activity as DayActivity).recheckEvents()
|
(activity as DayActivity).recheckEvents()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun eventInserted(event: Event) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun eventsDeleted(cnt: Int) {
|
|
||||||
(activity as DayActivity).recheckEvents()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun gotEvents(events: MutableList<Event>) {
|
|
||||||
receivedEvents(events)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -70,10 +70,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
val REGULAR_EVENT_TYPE_ID = 1
|
val REGULAR_EVENT_TYPE_ID = 1
|
||||||
var dbInstance: DBHelper? = null
|
var dbInstance: DBHelper? = null
|
||||||
|
|
||||||
private var mEventsListener: EventUpdateListener? = null
|
fun newInstance(context: Context): DBHelper {
|
||||||
|
|
||||||
fun newInstance(context: Context, callback: EventUpdateListener? = null): DBHelper {
|
|
||||||
mEventsListener = callback
|
|
||||||
if (dbInstance == null)
|
if (dbInstance == null)
|
||||||
dbInstance = DBHelper(context)
|
dbInstance = DBHelper(context)
|
||||||
|
|
||||||
@ -427,7 +424,6 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
mDb.delete(EXCEPTIONS_TABLE_NAME, exceptionSelection, null)
|
mDb.delete(EXCEPTIONS_TABLE_NAME, exceptionSelection, null)
|
||||||
|
|
||||||
context.updateWidgets()
|
context.updateWidgets()
|
||||||
mEventsListener?.eventsDeleted(ids.size)
|
|
||||||
|
|
||||||
ids.forEach {
|
ids.forEach {
|
||||||
context.cancelNotification(it.toInt())
|
context.cancelNotification(it.toInt())
|
||||||
@ -961,12 +957,4 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
cursor?.close()
|
cursor?.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface EventUpdateListener {
|
|
||||||
fun eventInserted(event: Event)
|
|
||||||
|
|
||||||
fun eventsDeleted(cnt: Int)
|
|
||||||
|
|
||||||
fun gotEvents(events: MutableList<Event>)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user