mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
some style updates and removing redundant code
This commit is contained in:
@@ -613,7 +613,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
importIDs[it.importId] = it.startTS
|
importIDs[it.importId] = it.startTS
|
||||||
}
|
}
|
||||||
|
|
||||||
val eventTypeId = if (birthdays) getBirthdaysEventTypeId() else getAnniversariesEventTypeId()
|
val eventTypeId = if (birthdays) eventsHelper.getBirthdaysEventTypeId() else eventsHelper.getAnniversariesEventTypeId()
|
||||||
val source = if (birthdays) SOURCE_CONTACT_BIRTHDAY else SOURCE_CONTACT_ANNIVERSARY
|
val source = if (birthdays) SOURCE_CONTACT_BIRTHDAY else SOURCE_CONTACT_ANNIVERSARY
|
||||||
|
|
||||||
queryCursor(uri, projection, selection, selectionArgs, showErrors = true) { cursor ->
|
queryCursor(uri, projection, selection, selectionArgs, showErrors = true) { cursor ->
|
||||||
@@ -684,7 +684,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val eventTypeId = if (birthdays) getBirthdaysEventTypeId() else getAnniversariesEventTypeId()
|
val eventTypeId = if (birthdays) eventsHelper.getBirthdaysEventTypeId() else eventsHelper.getAnniversariesEventTypeId()
|
||||||
val source = if (birthdays) SOURCE_CONTACT_BIRTHDAY else SOURCE_CONTACT_ANNIVERSARY
|
val source = if (birthdays) SOURCE_CONTACT_BIRTHDAY else SOURCE_CONTACT_ANNIVERSARY
|
||||||
|
|
||||||
val existingEvents = if (birthdays) eventsDB.getBirthdays() else eventsDB.getAnniversaries()
|
val existingEvents = if (birthdays) eventsDB.getBirthdays() else eventsDB.getAnniversaries()
|
||||||
@@ -746,14 +746,6 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
callback(eventsFound, eventsAdded)
|
callback(eventsFound, eventsAdded)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getBirthdaysEventTypeId(): Long {
|
|
||||||
return eventsHelper.getBirthdaysEventTypeId()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getAnniversariesEventTypeId(): Long {
|
|
||||||
return eventsHelper.getAnniversariesEventTypeId()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun updateView(view: Int) {
|
private fun updateView(view: Int) {
|
||||||
calendar_fab.beVisibleIf(view != YEARLY_VIEW && view != WEEKLY_VIEW)
|
calendar_fab.beVisibleIf(view != YEARLY_VIEW && view != WEEKLY_VIEW)
|
||||||
config.storedView = view
|
config.storedView = view
|
||||||
|
Reference in New Issue
Block a user