send the ExportEventsDialog checkbox value in the callback
This commit is contained in:
parent
7cd1c0e34b
commit
1280ecce26
|
@ -260,7 +260,8 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
||||||
|
|
||||||
private fun exportEvents() {
|
private fun exportEvents() {
|
||||||
FilePickerDialog(this, pickFile = false) {
|
FilePickerDialog(this, pickFile = false) {
|
||||||
ExportEventsDialog(this, it) {
|
val path = it
|
||||||
|
ExportEventsDialog(this, path) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,20 +8,17 @@ import com.simplemobiletools.commons.extensions.humanizePath
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import kotlinx.android.synthetic.main.dialog_export_events.view.*
|
import kotlinx.android.synthetic.main.dialog_export_events.view.*
|
||||||
|
|
||||||
class ExportEventsDialog(val activity: Activity, val path: String, val callback: (refreshView: Boolean) -> Unit) : AlertDialog.Builder(activity) {
|
class ExportEventsDialog(val activity: Activity, val path: String, val callback: (exportPastEvents: Boolean) -> Unit) : AlertDialog.Builder(activity) {
|
||||||
init {
|
init {
|
||||||
val view = (activity.layoutInflater.inflate(R.layout.dialog_export_events, null) as ViewGroup).apply {
|
val view = (activity.layoutInflater.inflate(R.layout.dialog_export_events, null) as ViewGroup).apply {
|
||||||
export_events_folder.text = activity.humanizePath(path)
|
export_events_folder.text = activity.humanizePath(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder(activity)
|
AlertDialog.Builder(activity)
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, { dialog, which -> callback(view.export_events_checkbox.isChecked) })
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.create().apply {
|
||||||
activity.setupDialogStuff(view, this, R.string.export_events)
|
activity.setupDialogStuff(view, this, R.string.export_events)
|
||||||
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ class YearlyCalendarImpl(val callback: YearlyCalendar, val context: Context, val
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun gotEvents(events: MutableList<Event>) {
|
private fun gotEvents(events: MutableList<Event>) {
|
||||||
val filtered = context.getFilteredEvents(events)
|
val filtered = context.getFilteredEvents(events)
|
||||||
val arr = SparseArray<ArrayList<Int>>(12)
|
val arr = SparseArray<ArrayList<Int>>(12)
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Exportiere raw Datenbank</string>
|
<string name="export_raw_database">Exportiere raw Datenbank</string>
|
||||||
<string name="default_event_type">Standard-Termin-Typ</string>
|
<string name="default_event_type">Standard-Termin-Typ</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Export raw database</string>
|
<string name="export_raw_database">Export raw database</string>
|
||||||
<string name="default_event_type">Default event type</string>
|
<string name="default_event_type">Default event type</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Exporter la base de données brute</string>
|
<string name="export_raw_database">Exporter la base de données brute</string>
|
||||||
<string name="default_event_type">Type d\'evénement par défaut</string>
|
<string name="default_event_type">Type d\'evénement par défaut</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Export raw database</string>
|
<string name="export_raw_database">Export raw database</string>
|
||||||
<string name="default_event_type">Default event type</string>
|
<string name="default_event_type">Default event type</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Export raw database</string>
|
<string name="export_raw_database">Export raw database</string>
|
||||||
<string name="default_event_type">Default event type</string>
|
<string name="default_event_type">Default event type</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Export raw database</string>
|
<string name="export_raw_database">Export raw database</string>
|
||||||
<string name="default_event_type">Default event type</string>
|
<string name="default_event_type">Default event type</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Export raw database</string>
|
<string name="export_raw_database">Export raw database</string>
|
||||||
<string name="default_event_type">Default event type</string>
|
<string name="default_event_type">Default event type</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Export raw database</string>
|
<string name="export_raw_database">Export raw database</string>
|
||||||
<string name="default_event_type">Default event type</string>
|
<string name="default_event_type">Default event type</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Exportar base de dados raw</string>
|
<string name="export_raw_database">Exportar base de dados raw</string>
|
||||||
<string name="default_event_type">Tipo de evento padrão</string>
|
<string name="default_event_type">Tipo de evento padrão</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Exportar base de dados raw</string>
|
<string name="export_raw_database">Exportar base de dados raw</string>
|
||||||
<string name="default_event_type">Tipo de evento padrão</string>
|
<string name="default_event_type">Tipo de evento padrão</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Экспортировать необработанную базу</string>
|
<string name="export_raw_database">Экспортировать необработанную базу</string>
|
||||||
<string name="default_event_type">Тип события по умолчанию</string>
|
<string name="default_event_type">Тип события по умолчанию</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Export raw database</string>
|
<string name="export_raw_database">Export raw database</string>
|
||||||
<string name="default_event_type">Default event type</string>
|
<string name="default_event_type">Default event type</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<string name="export_raw_database">Export raw database</string>
|
<string name="export_raw_database">Export raw database</string>
|
||||||
<string name="default_event_type">Default event type</string>
|
<string name="default_event_type">Default event type</string>
|
||||||
<string name="events_exported">Events have been exported successfully</string>
|
<string name="events_exported">Events have been exported successfully</string>
|
||||||
<string name="export_events_to_ics">Export events to .ics file</string>
|
<string name="export_events_to_ics">Export events to an .ics file</string>
|
||||||
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
<string name="no_events_for_exporting">No events for exporting have been found</string>
|
||||||
<string name="export_past_events_too">Export past events too</string>
|
<string name="export_past_events_too">Export past events too</string>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue