Merge branch 'master' of https://github.com/correia55/Simple-Calendar
This commit is contained in:
commit
9a6c8f6c25
|
@ -67,6 +67,7 @@ class EventActivity : SimpleActivity() {
|
|||
private val EVENT_CALENDAR_ID = "EVENT_CALENDAR_ID"
|
||||
private val SELECT_TIME_ZONE_INTENT = 1
|
||||
|
||||
private var mIsAllDayEvent = false
|
||||
private var mReminder1Minutes = REMINDER_OFF
|
||||
private var mReminder2Minutes = REMINDER_OFF
|
||||
private var mReminder3Minutes = REMINDER_OFF
|
||||
|
@ -543,22 +544,22 @@ class EventActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun showReminder1Dialog() {
|
||||
showPickSecondsDialogHelper(mReminder1Minutes) {
|
||||
mReminder1Minutes = if (it <= 0) it else it / 60
|
||||
showPickSecondsDialogHelper(mReminder1Minutes, showDuringDayOption = mIsAllDayEvent){
|
||||
mReminder1Minutes = if (it == -1 || it == 0) it else it / 60
|
||||
checkReminderTexts()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showReminder2Dialog() {
|
||||
showPickSecondsDialogHelper(mReminder2Minutes) {
|
||||
mReminder2Minutes = if (it <= 0) it else it / 60
|
||||
showPickSecondsDialogHelper(mReminder2Minutes, showDuringDayOption = mIsAllDayEvent){
|
||||
mReminder2Minutes = if (it == -1 || it == 0) it else it / 60
|
||||
checkReminderTexts()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showReminder3Dialog() {
|
||||
showPickSecondsDialogHelper(mReminder3Minutes) {
|
||||
mReminder3Minutes = if (it <= 0) it else it / 60
|
||||
showPickSecondsDialogHelper(mReminder3Minutes, showDuringDayOption = mIsAllDayEvent){
|
||||
mReminder3Minutes = if (it == -1 || it == 0) it else it / 60
|
||||
checkReminderTexts()
|
||||
}
|
||||
}
|
||||
|
@ -959,6 +960,7 @@ class EventActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun toggleAllDay(isChecked: Boolean) {
|
||||
mIsAllDayEvent = isChecked
|
||||
hideKeyboard()
|
||||
event_start_time.beGoneIf(isChecked)
|
||||
event_end_time.beGoneIf(isChecked)
|
||||
|
|
|
@ -430,7 +430,7 @@ class SettingsActivity : SimpleActivity() {
|
|||
settings_default_reminder_1.text = getFormattedMinutes(config.defaultReminder1)
|
||||
settings_default_reminder_1_holder.setOnClickListener {
|
||||
showPickSecondsDialogHelper(config.defaultReminder1) {
|
||||
config.defaultReminder1 = if (it <= 0) it else it / 60
|
||||
config.defaultReminder1 = if (it == -1 || it == 0) it else it / 60
|
||||
settings_default_reminder_1.text = getFormattedMinutes(config.defaultReminder1)
|
||||
}
|
||||
}
|
||||
|
@ -440,7 +440,7 @@ class SettingsActivity : SimpleActivity() {
|
|||
settings_default_reminder_2.text = getFormattedMinutes(config.defaultReminder2)
|
||||
settings_default_reminder_2_holder.setOnClickListener {
|
||||
showPickSecondsDialogHelper(config.defaultReminder2) {
|
||||
config.defaultReminder2 = if (it <= 0) it else it / 60
|
||||
config.defaultReminder2 = if (it == -1 || it == 0) it else it / 60
|
||||
settings_default_reminder_2.text = getFormattedMinutes(config.defaultReminder2)
|
||||
}
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ class SettingsActivity : SimpleActivity() {
|
|||
settings_default_reminder_3.text = getFormattedMinutes(config.defaultReminder3)
|
||||
settings_default_reminder_3_holder.setOnClickListener {
|
||||
showPickSecondsDialogHelper(config.defaultReminder3) {
|
||||
config.defaultReminder3 = if (it <= 0) it else it / 60
|
||||
config.defaultReminder3 = if (it == -1 || it == 0) it else it / 60
|
||||
settings_default_reminder_3.text = getFormattedMinutes(config.defaultReminder3)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@ import com.simplemobiletools.commons.extensions.*
|
|||
import kotlinx.android.synthetic.main.dialog_set_reminders.view.*
|
||||
|
||||
class SetRemindersDialog(val activity: Activity, val callback: (reminders: ArrayList<Int>) -> Unit) {
|
||||
private var mReminder1Minutes = -1
|
||||
private var mReminder2Minutes = -1
|
||||
private var mReminder3Minutes = -1
|
||||
private var mReminder1Minutes = REMINDER_OFF
|
||||
private var mReminder2Minutes = REMINDER_OFF
|
||||
private var mReminder3Minutes = REMINDER_OFF
|
||||
|
||||
init {
|
||||
val view = activity.layoutInflater.inflate(R.layout.dialog_set_reminders, null).apply {
|
||||
|
@ -21,28 +21,28 @@ class SetRemindersDialog(val activity: Activity, val callback: (reminders: Array
|
|||
set_reminders_3.text = activity.getFormattedMinutes(mReminder1Minutes)
|
||||
|
||||
set_reminders_1.setOnClickListener {
|
||||
activity.showPickSecondsDialogHelper(mReminder1Minutes) {
|
||||
mReminder1Minutes = if (it <= 0) it else it / 60
|
||||
activity.showPickSecondsDialogHelper(mReminder1Minutes, showDuringDayOption = true) {
|
||||
mReminder1Minutes = if (it == -1 || it == 0) it else it / 60
|
||||
set_reminders_1.text = activity.getFormattedMinutes(mReminder1Minutes)
|
||||
if (mReminder1Minutes != -1) {
|
||||
if (mReminder1Minutes != REMINDER_OFF) {
|
||||
set_reminders_2.beVisible()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_reminders_2.setOnClickListener {
|
||||
activity.showPickSecondsDialogHelper(mReminder2Minutes) {
|
||||
mReminder2Minutes = if (it <= 0) it else it / 60
|
||||
activity.showPickSecondsDialogHelper(mReminder2Minutes, showDuringDayOption = true) {
|
||||
mReminder2Minutes = if (it == -1 || it == 0) it else it / 60
|
||||
set_reminders_2.text = activity.getFormattedMinutes(mReminder2Minutes)
|
||||
if (mReminder2Minutes != -1) {
|
||||
if (mReminder2Minutes != REMINDER_OFF) {
|
||||
set_reminders_3.beVisible()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_reminders_3.setOnClickListener {
|
||||
activity.showPickSecondsDialogHelper(mReminder3Minutes) {
|
||||
mReminder3Minutes = if (it <= 0) it else it / 60
|
||||
activity.showPickSecondsDialogHelper(mReminder3Minutes, showDuringDayOption = true) {
|
||||
mReminder3Minutes = if (it == -1 || it == 0) it else it / 60
|
||||
set_reminders_3.text = activity.getFormattedMinutes(mReminder3Minutes)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import androidx.collection.LongSparseArray
|
|||
import com.simplemobiletools.calendar.pro.extensions.*
|
||||
import com.simplemobiletools.calendar.pro.models.Event
|
||||
import com.simplemobiletools.calendar.pro.models.EventType
|
||||
import com.simplemobiletools.commons.helpers.CHOPPED_LIST_DEFAULT_SIZE
|
||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||
|
||||
class EventsHelper(val context: Context) {
|
||||
|
@ -145,7 +146,7 @@ class EventsHelper(val context: Context) {
|
|||
return
|
||||
}
|
||||
|
||||
ids.chunked(30).forEach {
|
||||
ids.chunked(CHOPPED_LIST_DEFAULT_SIZE).forEach {
|
||||
val eventsWithImportId = eventsDB.getEventsByIdsWithImportIds(it)
|
||||
eventsDB.deleteEvents(it)
|
||||
|
||||
|
@ -159,7 +160,7 @@ class EventsHelper(val context: Context) {
|
|||
}
|
||||
}
|
||||
|
||||
deleteChildEvents(it, deleteFromCalDAV)
|
||||
deleteChildEvents(it as MutableList<Long>, deleteFromCalDAV)
|
||||
context.updateWidgets()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ data class Event(
|
|||
@ColumnInfo(name = "title") var title: String = "",
|
||||
@ColumnInfo(name = "location") var location: String = "",
|
||||
@ColumnInfo(name = "description") var description: String = "",
|
||||
@ColumnInfo(name = "reminder_1_minutes") var reminder1Minutes: Int = -1,
|
||||
@ColumnInfo(name = "reminder_2_minutes") var reminder2Minutes: Int = -1,
|
||||
@ColumnInfo(name = "reminder_3_minutes") var reminder3Minutes: Int = -1,
|
||||
@ColumnInfo(name = "reminder_1_minutes") var reminder1Minutes: Int = REMINDER_OFF,
|
||||
@ColumnInfo(name = "reminder_2_minutes") var reminder2Minutes: Int = REMINDER_OFF,
|
||||
@ColumnInfo(name = "reminder_3_minutes") var reminder3Minutes: Int = REMINDER_OFF,
|
||||
@ColumnInfo(name = "reminder_1_type") var reminder1Type: Int = REMINDER_NOTIFICATION,
|
||||
@ColumnInfo(name = "reminder_2_type") var reminder2Type: Int = REMINDER_NOTIFICATION,
|
||||
@ColumnInfo(name = "reminder_3_type") var reminder3Type: Int = REMINDER_NOTIFICATION,
|
||||
|
|
Loading…
Reference in New Issue