mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
lets warn the user if the new events type is filtered out
This commit is contained in:
@@ -20,6 +20,7 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.core.app.AlarmManagerCompat
|
import androidx.core.app.AlarmManagerCompat
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
import androidx.print.PrintHelper
|
import androidx.print.PrintHelper
|
||||||
@@ -98,7 +99,11 @@ fun Context.scheduleNextEventReminder(event: Event, showToasts: Boolean) {
|
|||||||
val validReminders = event.getReminders().filter { it.type == REMINDER_NOTIFICATION }
|
val validReminders = event.getReminders().filter { it.type == REMINDER_NOTIFICATION }
|
||||||
if (validReminders.isEmpty()) {
|
if (validReminders.isEmpty()) {
|
||||||
if (showToasts) {
|
if (showToasts) {
|
||||||
|
if (config.displayEventTypes.contains(event.eventType.toString())) {
|
||||||
toast(R.string.saving)
|
toast(R.string.saving)
|
||||||
|
} else {
|
||||||
|
toast(R.string.saving_filtered_out, Toast.LENGTH_LONG)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user