send the ExportEventsDialog checkbox value in the callback

This commit is contained in:
tibbi 2017-04-02 22:14:02 +02:00
parent 7cd1c0e34b
commit 1280ecce26
16 changed files with 18 additions and 20 deletions

View File

@ -260,7 +260,8 @@ class MainActivity : SimpleActivity(), NavigationListener {
private fun exportEvents() {
FilePickerDialog(this, pickFile = false) {
ExportEventsDialog(this, it) {
val path = it
ExportEventsDialog(this, path) {
}
}

View File

@ -8,20 +8,17 @@ import com.simplemobiletools.commons.extensions.humanizePath
import com.simplemobiletools.commons.extensions.setupDialogStuff
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 {
val view = (activity.layoutInflater.inflate(R.layout.dialog_export_events, null) as ViewGroup).apply {
export_events_folder.text = activity.humanizePath(path)
}
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)
.create().apply {
activity.setupDialogStuff(view, this, R.string.export_events)
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
})
}
}
}

View File

@ -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 arr = SparseArray<ArrayList<Int>>(12)

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Exportiere raw Datenbank</string>
<string name="default_event_type">Standard-Termin-Typ</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Export raw database</string>
<string name="default_event_type">Default event type</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<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="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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Export raw database</string>
<string name="default_event_type">Default event type</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Export raw database</string>
<string name="default_event_type">Default event type</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Export raw database</string>
<string name="default_event_type">Default event type</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Export raw database</string>
<string name="default_event_type">Default event type</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Export raw database</string>
<string name="default_event_type">Default event type</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Exportar base de dados raw</string>
<string name="default_event_type">Tipo de evento padrão</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Exportar base de dados raw</string>
<string name="default_event_type">Tipo de evento padrão</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Экспортировать необработанную базу</string>
<string name="default_event_type">Тип события по умолчанию</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Export raw database</string>
<string name="default_event_type">Default event type</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="export_past_events_too">Export past events too</string>

View File

@ -105,7 +105,7 @@
<string name="export_raw_database">Export raw database</string>
<string name="default_event_type">Default event type</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="export_past_events_too">Export past events too</string>