From b37894e13f7024bbd68f68950bd6749ace292c5f Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 18 Dec 2021 04:25:18 +0800 Subject: [PATCH] more renaming --- .../devicecalendar/CalendarDelegate.kt | 32 +++++++++---------- .../devicecalendar/DeviceCalendarPlugin.kt | 14 ++++---- .../devicecalendar/models/Event.kt | 14 ++++---- ios/Classes/SwiftDeviceCalendarPlugin.swift | 12 +++---- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/android/src/main/kotlin/com/builttoroam/devicecalendar/CalendarDelegate.kt b/android/src/main/kotlin/com/builttoroam/devicecalendar/CalendarDelegate.kt index 6df728be..63ffc2e4 100644 --- a/android/src/main/kotlin/com/builttoroam/devicecalendar/CalendarDelegate.kt +++ b/android/src/main/kotlin/com/builttoroam/devicecalendar/CalendarDelegate.kt @@ -467,9 +467,9 @@ class CalendarDelegate : PluginRegistry.RequestPermissionsResultListener { private fun buildEventContentValues(event: Event, calendarId: String): ContentValues { val values = ContentValues() val duration: String? = null - values.put(Events.ALL_DAY, event.allDay) + values.put(Events.ALL_DAY, event.eventAllDay) - if (event.allDay) { + if (event.eventAllDay) { val calendar = java.util.Calendar.getInstance() calendar.timeInMillis = event.eventStartDate!! calendar.set(java.util.Calendar.HOUR, 0) @@ -479,18 +479,18 @@ class CalendarDelegate : PluginRegistry.RequestPermissionsResultListener { values.put(Events.DTSTART, calendar.timeInMillis) values.put(Events.DTEND, calendar.timeInMillis) - values.put(Events.EVENT_TIMEZONE, getTimeZone(event.startTimeZone).id) + values.put(Events.EVENT_TIMEZONE, getTimeZone(event.eventStartTimeZone).id) } else { values.put(Events.DTSTART, event.eventStartDate!!) - values.put(Events.EVENT_TIMEZONE, getTimeZone(event.startTimeZone).id) + values.put(Events.EVENT_TIMEZONE, getTimeZone(event.eventStartTimeZone).id) values.put(Events.DTEND, event.eventEndDate!!) - values.put(Events.EVENT_END_TIMEZONE, getTimeZone(event.endTimeZone).id) + values.put(Events.EVENT_END_TIMEZONE, getTimeZone(event.eventEndTimeZone).id) } - values.put(Events.TITLE, event.title) - values.put(Events.DESCRIPTION, event.description) - values.put(Events.EVENT_LOCATION, event.location) - values.put(Events.CUSTOM_APP_URI, event.url) + values.put(Events.TITLE, event.eventTitle) + values.put(Events.DESCRIPTION, event.eventDescription) + values.put(Events.EVENT_LOCATION, event.eventLocation) + values.put(Events.CUSTOM_APP_URI, event.eventURL) values.put(Events.CALENDAR_ID, calendarId) values.put(Events.DURATION, duration) values.put(Events.AVAILABILITY, getAvailability(event.availability)) @@ -713,18 +713,18 @@ class CalendarDelegate : PluginRegistry.RequestPermissionsResultListener { val availability = parseAvailability(cursor.getInt(EVENT_PROJECTION_AVAILABILITY_INDEX)) val event = Event() - event.title = title ?: "New Event" + event.eventTitle = title ?: "New Event" event.eventId = eventId.toString() event.calendarId = calendarId - event.description = description + event.eventDescription = description event.eventStartDate = begin event.eventEndDate = end - event.allDay = allDay - event.location = location - event.url = url + event.eventAllDay = allDay + event.eventLocation = location + event.eventURL = url event.recurrenceRule = parseRecurrenceRuleString(recurringRule) - event.startTimeZone = startTimeZone - event.endTimeZone = endTimeZone + event.eventStartTimeZone = startTimeZone + event.eventEndTimeZone = endTimeZone event.availability = availability return event diff --git a/android/src/main/kotlin/com/builttoroam/devicecalendar/DeviceCalendarPlugin.kt b/android/src/main/kotlin/com/builttoroam/devicecalendar/DeviceCalendarPlugin.kt index 9a544551..34b8c222 100644 --- a/android/src/main/kotlin/com/builttoroam/devicecalendar/DeviceCalendarPlugin.kt +++ b/android/src/main/kotlin/com/builttoroam/devicecalendar/DeviceCalendarPlugin.kt @@ -164,17 +164,17 @@ class DeviceCalendarPlugin() : FlutterPlugin, MethodCallHandler, ActivityAware { private fun parseEventArgs(call: MethodCall, calendarId: String?): Event { val event = Event() - event.title = call.argument(EVENT_TITLE_ARGUMENT) + event.eventTitle = call.argument(EVENT_TITLE_ARGUMENT) event.calendarId = calendarId event.eventId = call.argument(EVENT_ID_ARGUMENT) - event.description = call.argument(EVENT_DESCRIPTION_ARGUMENT) - event.allDay = call.argument(EVENT_ALL_DAY_ARGUMENT) ?: false + event.eventDescription = call.argument(EVENT_DESCRIPTION_ARGUMENT) + event.eventAllDay = call.argument(EVENT_ALL_DAY_ARGUMENT) ?: false event.eventStartDate = call.argument(EVENT_START_DATE_ARGUMENT)!! event.eventEndDate = call.argument(EVENT_END_DATE_ARGUMENT)!! - event.startTimeZone = call.argument(EVENT_START_TIMEZONE_ARGUMENT) - event.endTimeZone = call.argument(EVENT_END_TIMEZONE_ARGUMENT) - event.location = call.argument(EVENT_LOCATION_ARGUMENT) - event.url = call.argument(EVENT_URL_ARGUMENT) + event.eventStartTimeZone = call.argument(EVENT_START_TIMEZONE_ARGUMENT) + event.eventEndTimeZone = call.argument(EVENT_END_TIMEZONE_ARGUMENT) + event.eventLocation = call.argument(EVENT_LOCATION_ARGUMENT) + event.eventURL = call.argument(EVENT_URL_ARGUMENT) event.availability = parseAvailability(call.argument(EVENT_AVAILABILITY_ARGUMENT)) if (call.hasArgument(RECURRENCE_RULE_ARGUMENT) && call.argument>(RECURRENCE_RULE_ARGUMENT) != null) { diff --git a/android/src/main/kotlin/com/builttoroam/devicecalendar/models/Event.kt b/android/src/main/kotlin/com/builttoroam/devicecalendar/models/Event.kt index b8a07b76..5fc8a774 100644 --- a/android/src/main/kotlin/com/builttoroam/devicecalendar/models/Event.kt +++ b/android/src/main/kotlin/com/builttoroam/devicecalendar/models/Event.kt @@ -2,17 +2,17 @@ package com.builttoroam.devicecalendar.models class Event { - var title: String? = null + var eventTitle: String? = null var eventId: String? = null var calendarId: String? = null - var description: String? = null + var eventDescription: String? = null var eventStartDate: Long? = null var eventEndDate: Long? = null - var startTimeZone: String? = null - var endTimeZone: String? = null - var allDay: Boolean = false - var location: String? = null - var url: String? = null + var eventStartTimeZone: String? = null + var eventEndTimeZone: String? = null + var eventAllDay: Boolean = false + var eventLocation: String? = null + var eventURL: String? = null var attendees: MutableList = mutableListOf() var recurrenceRule: RecurrenceRule? = null var organizer: Attendee? = null diff --git a/ios/Classes/SwiftDeviceCalendarPlugin.swift b/ios/Classes/SwiftDeviceCalendarPlugin.swift index 111380c2..5d0cc573 100644 --- a/ios/Classes/SwiftDeviceCalendarPlugin.swift +++ b/ios/Classes/SwiftDeviceCalendarPlugin.swift @@ -26,15 +26,15 @@ public class SwiftDeviceCalendarPlugin: NSObject, FlutterPlugin { struct Event: Codable { let eventId: String let calendarId: String - let title: String - let description: String? + let eventTitle: String + let eventDescription: String? let eventStartDate: Int64 let eventEndDate: Int64 - let startTimeZone: String? - let allDay: Bool + let eventStartTimeZone: String? + let eventAllDay: Bool let attendees: [Attendee] - let location: String? - let url: String? + let eventLocation: String? + let eventURL: String? let recurrenceRule: RecurrenceRule? let organizer: Attendee? let reminders: [Reminder]