use of com.example.c4q.capstone.database.events.UserEvent in project Grupp by tmoronta1208.
the class UserProfileActivity method pushEventInviteNotifications.
public void pushEventInviteNotifications() {
final Context mContext = getApplicationContext();
CurrentUserUtility currentUserUtility = new CurrentUserUtility();
currentUserUtility.getSingleEventInviteList(CurrentUser.userID, new UserEventListener() {
@Override
public void getUserEventList(Map<String, UserEvent> userEventMap) {
if (userEventMap != null) {
Log.d(TAG, "notifications not null");
for (String s : userEventMap.keySet()) {
String eventName = userEventMap.get(s).getEvent_name();
String userName = userEventMap.get(s).getEvent_organizer_full_name();
String title = userName;
String desc = "You're invited to " + eventName + "!";
new InviteNotifications(title, desc, getApplicationContext(), userEventMap.get(s).getEvent_id());
}
} else {
Log.d(TAG, "notifications null");
}
}
});
//
}
use of com.example.c4q.capstone.database.events.UserEvent in project Grupp by tmoronta1208.
the class NewEventConverter method creatUserEventFromEvent.
public UserEvent creatUserEventFromEvent(Events event) {
UserEvent userEvent = new UserEvent();
userEvent.setEvent_date(event.getEvent_date());
userEvent.setEvent_id(event.getEvent_id());
userEvent.setEvent_date(event.getEvent_date());
userEvent.setEvent_time(userEvent.getEvent_time());
userEvent.setEvent_organizer(event.getEvent_organizer());
userEvent.setEvent_note(event.getEvent_note());
userEvent.setEvent_name(event.getEvent_name());
userEvent.setFinal_venue(event.getFinal_venue());
userEvent.setEvent_organizer_full_name(CurrentUser.getInstance().getUserFullName());
userEvent.setEvent_organizer_icon(CurrentUser.getInstance().getCurrentPublicUser().getUser_icon());
Log.d("converter: full name", "user event" + userEvent.getEvent_organizer_full_name());
return userEvent;
}
use of com.example.c4q.capstone.database.events.UserEvent in project Grupp by tmoronta1208.
the class CreateEventPresenter method sendEventToFireBase.
public void sendEventToFireBase(EventFragmentListener listener) {
if (validateEvent()) {
key = setFinalizedEvent();
Log.d(TAG, "event key : " + key);
listener.getEventIdKEy(key);
makeNetworkCall(newEventBuilder.getInvitedFriendsUserList());
Log.d(TAG, "post event called" + newEventBuilder.getInvitedFriendsUserList().size());
CurrentUserPost.getInstance().postNewEvent(key, newEvent);
// UserEvent userEvent = creatUserEventFromEvent(newEvent);
UserEvent userEvent = newEventConverter.creatUserEventFromEvent(newEvent);
CurrentUserPost.getInstance().postEventToUserEventList(key, currentUserID, userEvent);
sendInvites(userEvent, newEvent);
}
}
Aggregations