From a39efe79c730c578abe8614986d63520005a8e59 Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Mon, 27 Jul 2020 19:59:17 +0200 Subject: [PATCH] Android Package is now `com.calendarevents.RNCalendarEvents` --- ...endarEvents.java => RNCalendarEvents.java} | 6 ++--- ...kage.java => RNCalendarEventsPackage.java} | 4 ++-- index.android.js | 24 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) rename android/src/main/java/com/calendarevents/{CalendarEvents.java => RNCalendarEvents.java} (99%) rename android/src/main/java/com/calendarevents/{CalendarEventsPackage.java => RNCalendarEventsPackage.java} (84%) diff --git a/android/src/main/java/com/calendarevents/CalendarEvents.java b/android/src/main/java/com/calendarevents/RNCalendarEvents.java similarity index 99% rename from android/src/main/java/com/calendarevents/CalendarEvents.java rename to android/src/main/java/com/calendarevents/RNCalendarEvents.java index 856399a..4170668 100644 --- a/android/src/main/java/com/calendarevents/CalendarEvents.java +++ b/android/src/main/java/com/calendarevents/RNCalendarEvents.java @@ -41,21 +41,21 @@ import java.util.TimeZone; import android.util.Log; -public class CalendarEvents extends ReactContextBaseJavaModule implements PermissionListener { +public class RNCalendarEvents extends ReactContextBaseJavaModule implements PermissionListener { private static int PERMISSION_REQUEST_CODE = 37; private final ReactContext reactContext; private static final String RNC_PREFS = "REACT_NATIVE_CALENDAR_PREFERENCES"; private static final HashMap permissionsPromises = new HashMap<>(); - public CalendarEvents(ReactApplicationContext reactContext) { + public RNCalendarEvents(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; } @Override public String getName() { - return "CalendarEvents"; + return "RNCalendarEvents"; } //region Calendar Permissions diff --git a/android/src/main/java/com/calendarevents/CalendarEventsPackage.java b/android/src/main/java/com/calendarevents/RNCalendarEventsPackage.java similarity index 84% rename from android/src/main/java/com/calendarevents/CalendarEventsPackage.java rename to android/src/main/java/com/calendarevents/RNCalendarEventsPackage.java index 0b04b1a..df7caff 100644 --- a/android/src/main/java/com/calendarevents/CalendarEventsPackage.java +++ b/android/src/main/java/com/calendarevents/RNCalendarEventsPackage.java @@ -9,7 +9,7 @@ import java.util.Collections; import java.util.List; -public class CalendarEventsPackage implements ReactPackage { +public class RNCalendarEventsPackage implements ReactPackage { @Override public List createViewManagers(ReactApplicationContext reactContext) { @@ -21,7 +21,7 @@ public List createNativeModules( ReactApplicationContext reactContext) { List modules = new ArrayList<>(); - modules.add(new CalendarEvents(reactContext)); + modules.add(new RNCalendarEvents(reactContext)); return modules; } diff --git a/index.android.js b/index.android.js index 2e304c5..8aff13b 100644 --- a/index.android.js +++ b/index.android.js @@ -2,54 +2,54 @@ import { NativeModules, processColor } from 'react-native' -var CalendarEvents = NativeModules.CalendarEvents +var RNCalendarEvents = NativeModules.RNCalendarEvents export default { async authorizationStatus () { - return CalendarEvents.getCalendarPermissions() + return RNCalendarEvents.getCalendarPermissions() }, async authorizeEventStore () { - return CalendarEvents.requestCalendarPermissions() + return RNCalendarEvents.requestCalendarPermissions() }, async fetchAllEvents (startDate, endDate, calendars = []) { - return CalendarEvents.findAllEvents(startDate, endDate, calendars) + return RNCalendarEvents.findAllEvents(startDate, endDate, calendars) }, async findCalendars () { - return CalendarEvents.findCalendars() + return RNCalendarEvents.findCalendars() }, async saveCalendar (options = {}) { - return CalendarEvents.saveCalendar({ + return RNCalendarEvents.saveCalendar({ ...options, color: options.color ? processColor(options.color) : undefined, }); }, async removeCalendar (id) { - return CalendarEvents.removeCalendar(id) + return RNCalendarEvents.removeCalendar(id) }, async findEventById (id) { - return CalendarEvents.findById(id) + return RNCalendarEvents.findById(id) }, async saveEvent (title, details, options = {sync: false}) { - return CalendarEvents.saveEvent(title, details, options) + return RNCalendarEvents.saveEvent(title, details, options) }, async removeEvent (id, options = {sync: false}) { - return CalendarEvents.removeEvent(id, options) + return RNCalendarEvents.removeEvent(id, options) }, async uriForCalendar () { - return CalendarEvents.uriForCalendar() + return RNCalendarEvents.uriForCalendar() }, openEventInCalendar (eventID) { - CalendarEvents.openEventInCalendar(eventID) + RNCalendarEvents.openEventInCalendar(eventID) } }