Skip to content

Commit

Permalink
more renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
thomassth committed Dec 17, 2021
1 parent 5a30136 commit b37894e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,17 @@ class DeviceCalendarPlugin() : FlutterPlugin, MethodCallHandler, ActivityAware {

private fun parseEventArgs(call: MethodCall, calendarId: String?): Event {
val event = Event()
event.title = call.argument<String>(EVENT_TITLE_ARGUMENT)
event.eventTitle = call.argument<String>(EVENT_TITLE_ARGUMENT)
event.calendarId = calendarId
event.eventId = call.argument<String>(EVENT_ID_ARGUMENT)
event.description = call.argument<String>(EVENT_DESCRIPTION_ARGUMENT)
event.allDay = call.argument<Boolean>(EVENT_ALL_DAY_ARGUMENT) ?: false
event.eventDescription = call.argument<String>(EVENT_DESCRIPTION_ARGUMENT)
event.eventAllDay = call.argument<Boolean>(EVENT_ALL_DAY_ARGUMENT) ?: false
event.eventStartDate = call.argument<Long>(EVENT_START_DATE_ARGUMENT)!!
event.eventEndDate = call.argument<Long>(EVENT_END_DATE_ARGUMENT)!!
event.startTimeZone = call.argument<String>(EVENT_START_TIMEZONE_ARGUMENT)
event.endTimeZone = call.argument<String>(EVENT_END_TIMEZONE_ARGUMENT)
event.location = call.argument<String>(EVENT_LOCATION_ARGUMENT)
event.url = call.argument<String>(EVENT_URL_ARGUMENT)
event.eventStartTimeZone = call.argument<String>(EVENT_START_TIMEZONE_ARGUMENT)
event.eventEndTimeZone = call.argument<String>(EVENT_END_TIMEZONE_ARGUMENT)
event.eventLocation = call.argument<String>(EVENT_LOCATION_ARGUMENT)
event.eventURL = call.argument<String>(EVENT_URL_ARGUMENT)
event.availability = parseAvailability(call.argument<String>(EVENT_AVAILABILITY_ARGUMENT))

if (call.hasArgument(RECURRENCE_RULE_ARGUMENT) && call.argument<Map<String, Any>>(RECURRENCE_RULE_ARGUMENT) != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Attendee> = mutableListOf()
var recurrenceRule: RecurrenceRule? = null
var organizer: Attendee? = null
Expand Down
12 changes: 6 additions & 6 deletions ios/Classes/SwiftDeviceCalendarPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit b37894e

Please sign in to comment.