add an ics file exporter class
This commit is contained in:
parent
e9c63c3968
commit
8158c876c2
1 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
package com.simplemobiletools.calendar.helpers
|
||||
|
||||
import android.content.Context
|
||||
import com.simplemobiletools.calendar.helpers.IcsExporter.ExportResult.*
|
||||
|
||||
class IcsExporter {
|
||||
enum class ExportResult {
|
||||
EXPORT_FAIL, EXPORT_OK, EXPORT_PARTIAL
|
||||
}
|
||||
|
||||
var eventsExported = 0
|
||||
var eventsFailed = 0
|
||||
|
||||
fun exportEvents(context: Context, path: String): ExportResult {
|
||||
|
||||
return if (eventsExported == 0) {
|
||||
EXPORT_FAIL
|
||||
} else if (eventsFailed > 0) {
|
||||
EXPORT_PARTIAL
|
||||
} else {
|
||||
EXPORT_OK
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue