mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
add an ics file exporter class
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user