mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-18 04:40:36 +01:00
do not pass exportPastEvents in the Export dialogs callback
This commit is contained in:
parent
a7d8c88174
commit
dabbe0dff1
@ -783,15 +783,9 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||
private fun tryExportEvents() {
|
||||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||
if (it) {
|
||||
exportEvents()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun exportEvents() {
|
||||
ExportEventsDialog(this, config.lastExportPath, false) { exportPastEvents, file, eventTypes ->
|
||||
ExportEventsDialog(this, config.lastExportPath, false) { file, eventTypes ->
|
||||
ensureBackgroundThread {
|
||||
val events = eventsHelper.getEventsToExport(exportPastEvents, eventTypes)
|
||||
val events = eventsHelper.getEventsToExport(config.exportPastEvents, eventTypes)
|
||||
if (events.isEmpty()) {
|
||||
toast(R.string.no_entries_for_exporting)
|
||||
} else {
|
||||
@ -808,6 +802,8 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun launchSettings() {
|
||||
startActivity(Intent(applicationContext, SettingsActivity::class.java))
|
||||
|
@ -15,7 +15,7 @@ import java.io.File
|
||||
import java.util.*
|
||||
|
||||
class ExportEventsDialog(val activity: SimpleActivity, val path: String, val hidePath: Boolean,
|
||||
val callback: (exportPastEvents: Boolean, file: File, eventTypes: ArrayList<Long>) -> Unit) {
|
||||
val callback: (file: File, eventTypes: ArrayList<Long>) -> Unit) {
|
||||
private var realPath = if (path.isEmpty()) activity.internalStoragePath else path
|
||||
val config = activity.config
|
||||
|
||||
@ -72,7 +72,7 @@ class ExportEventsDialog(val activity: SimpleActivity, val path: String, val hid
|
||||
config.exportPastEvents = view.export_events_checkbox.isChecked
|
||||
|
||||
val eventTypes = (view.export_events_types_list.adapter as FilterEventTypeAdapter).getSelectedItemsList()
|
||||
callback(view.export_events_checkbox.isChecked, file, eventTypes)
|
||||
callback(file, eventTypes)
|
||||
dismiss()
|
||||
}
|
||||
else -> activity.toast(R.string.invalid_name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user