Skip to content

Commit

Permalink
Android Package is now com.calendarevents.RNCalendarEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Jul 28, 2020
1 parent f20dd9d commit a39efe7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer, Promise> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
Expand All @@ -21,7 +21,7 @@ public List<NativeModule> createNativeModules(
ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();

modules.add(new CalendarEvents(reactContext));
modules.add(new RNCalendarEvents(reactContext));

return modules;
}
Expand Down
24 changes: 12 additions & 12 deletions index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit a39efe7

Please sign in to comment.