add an ics file exporter class

This commit is contained in:
tibbi 2017-04-02 22:25:40 +02:00
parent e9c63c3968
commit 8158c876c2
1 changed files with 24 additions and 0 deletions

View File

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