Search in sources :

Example 1 with UserEventListener

use of com.example.c4q.capstone.utils.currentuser.UserEventListener 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");
            }
        }
    });
// 
}
Also used : Context(android.content.Context) CurrentUserUtility(com.example.c4q.capstone.utils.currentuser.CurrentUserUtility) UserEventListener(com.example.c4q.capstone.utils.currentuser.UserEventListener) InviteNotifications(com.example.c4q.capstone.userinterface.alerts.InviteNotifications) UserEvent(com.example.c4q.capstone.database.events.UserEvent)

Aggregations

Context (android.content.Context)1 UserEvent (com.example.c4q.capstone.database.events.UserEvent)1 InviteNotifications (com.example.c4q.capstone.userinterface.alerts.InviteNotifications)1 CurrentUserUtility (com.example.c4q.capstone.utils.currentuser.CurrentUserUtility)1 UserEventListener (com.example.c4q.capstone.utils.currentuser.UserEventListener)1