Search in sources :

Example 1 with EventGuest

use of com.example.c4q.capstone.database.events.EventGuest in project Grupp by tmoronta1208.

the class VenueVoteSwipeActivity method loadSwipeView.

public void loadSwipeView(final List<Venue> venueVoteList) {
    mSwipeView.getBuilder().setDisplayViewCount(3).setSwipeDecor(new SwipeDecor().setPaddingTop(20).setRelativeScale(0.01f).setSwipeInMsgLayoutId(R.layout.card_swipe_in_msg_view).setSwipeOutMsgLayoutId(R.layout.card_swipe_out_msg_view));
    mSwipeView.addItemRemoveListener(new ItemRemovedListener() {

        @Override
        public void onItemRemoved(int count) {
            Log.d(TAG, "item removed");
            if (count == 0) {
                // currentEvent.setVenue_map(venueHashMap);
                String id = currentEvent.getEvent_id();
                EventGuest currentGuest = currentEvent.getEvent_guest_map().get(CurrentUser.userID);
                currentGuest.setVoted(true);
                CurrentUserPost.getInstance().postEventGuest(eventID, CurrentUser.userID, currentGuest);
                Intent eventIntent = new Intent(VenueVoteSwipeActivity.this, EventActivity.class);
                eventIntent.putExtra("eventID", eventID);
                eventIntent.putExtra("eventType", eventType);
                startActivity(eventIntent);
                finish();
            }
        }
    });
    for (Venue venue : venueVoteList) {
        mSwipeView.addView(new VenueCardView(mContext, venue, mSwipeView, eventID));
    }
    findViewById(R.id.rejectBtn).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mSwipeView.doSwipe(false);
        }
    });
    findViewById(R.id.acceptBtn).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mSwipeView.doSwipe(true);
        }
    });
}
Also used : SwipeDecor(com.mindorks.placeholderview.SwipeDecor) EventGuest(com.example.c4q.capstone.database.events.EventGuest) Venue(com.example.c4q.capstone.database.events.Venue) Intent(android.content.Intent) SwipePlaceHolderView(com.mindorks.placeholderview.SwipePlaceHolderView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) ItemRemovedListener(com.mindorks.placeholderview.listeners.ItemRemovedListener)

Example 2 with EventGuest

use of com.example.c4q.capstone.database.events.EventGuest in project Grupp by tmoronta1208.

the class NewEventConverter method eventGuestFromPUblicUser.

public EventGuest eventGuestFromPUblicUser(PublicUser publicUser, Boolean confirmed) {
    EventGuest eventGuest = new EventGuest();
    eventGuest.setConfirmed_guest(confirmed);
    eventGuest.setUser_id(publicUser.getUser_id());
    eventGuest.setUser_firstname(publicUser.getFirst_name());
    eventGuest.setUser_lastname(publicUser.getLast_name());
    eventGuest.setZip_code(publicUser.getZip_code());
    eventGuest.setUser_preferences(publicUser.getUser_preferences());
    eventGuest.setRadius(publicUser.getRadius());
    eventGuest.setUser_icon(publicUser.getUser_icon());
    eventGuest.setVoted(false);
    return eventGuest;
}
Also used : EventGuest(com.example.c4q.capstone.database.events.EventGuest)

Example 3 with EventGuest

use of com.example.c4q.capstone.database.events.EventGuest in project Grupp by tmoronta1208.

the class NewEventConverter method guestMapFromPubUser.

public HashMap<String, EventGuest> guestMapFromPubUser(List<PublicUser> guestList, boolean confirmed) {
    HashMap<String, EventGuest> guestHashMap = new HashMap<>();
    for (PublicUser user : guestList) {
        EventGuest eventGuest = eventGuestFromPUblicUser(user, confirmed);
        guestHashMap.put(eventGuest.getUser_id(), eventGuest);
    }
    return guestHashMap;
}
Also used : EventGuest(com.example.c4q.capstone.database.events.EventGuest) PublicUser(com.example.c4q.capstone.database.publicuserdata.PublicUser) HashMap(java.util.HashMap)

Example 4 with EventGuest

use of com.example.c4q.capstone.database.events.EventGuest in project Grupp by tmoronta1208.

the class VenueVoteUtility method checkVoteComplete.

private boolean checkVoteComplete() {
    List<EventGuest> guestList = new ArrayList<>();
    guestList.addAll(event.getEvent_guest_map().values());
    for (EventGuest guest : guestList) {
        if (!guest.isVoted()) {
            return false;
        }
    }
    return true;
}
Also used : EventGuest(com.example.c4q.capstone.database.events.EventGuest) ArrayList(java.util.ArrayList)

Example 5 with EventGuest

use of com.example.c4q.capstone.database.events.EventGuest in project Grupp by tmoronta1208.

the class CreateEventPresenter method setFinalizedEvent.

public String setFinalizedEvent() {
    // TODO new event builder converter method method
    key = CurrentUserPost.getInstance().newEventKey();
    List<String> confirmedGuest = new ArrayList<>();
    confirmedGuest.add(currentUserID);
    newEvent.setEvent_id(newEventBuilder.getEventID());
    newEvent.setEvent_name(newEventBuilder.getEventName());
    newEvent.setEvent_note(newEventBuilder.getEventNote());
    newEvent.setEvent_time(newEventBuilder.getEventTime());
    newEvent.setEvent_date(newEventBuilder.getEventDate());
    newEvent.setVenue_type(newEventBuilder.getEventVenueType());
    newEvent.setEvent_note(newEventBuilder.getEventNote());
    newEvent.setInvited_guests(newEventBuilder.getInvitedGuests());
    newEvent.setEvent_organizer(currentUserID);
    newEvent.setConfirmed_guests(confirmedGuest);
    if (newEventBuilder.getInvitedFriendsUserList() != null) {
        Log.d(TAG, "pub user list size: " + newEventBuilder.getInvitedFriendsUserList());
        eventGuestHashMap = new HashMap<>();
        eventGuestHashMap = newEventConverter.guestMapFromPubUser(newEventBuilder.getInvitedFriendsUserList(), false);
        EventGuest currentUserGuest = newEventConverter.eventGuestFromPUblicUser(CurrentUser.getInstance().getCurrentPublicUser(), true);
        eventGuestHashMap.put(currentUserID, currentUserGuest);
        newEventBuilder.setEventGuestMap(eventGuestHashMap);
    } else {
        Log.d(TAG, "pub user list is null");
    }
    newEvent.setEvent_guest_map(eventGuestHashMap);
    newEvent.setEvent_id(key);
    Log.d(TAG, "event type" + newEventBuilder.getEventVenueType());
    return key;
}
Also used : EventGuest(com.example.c4q.capstone.database.events.EventGuest) ArrayList(java.util.ArrayList)

Aggregations

EventGuest (com.example.c4q.capstone.database.events.EventGuest)5 ArrayList (java.util.ArrayList)2 Intent (android.content.Intent)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 Venue (com.example.c4q.capstone.database.events.Venue)1 PublicUser (com.example.c4q.capstone.database.publicuserdata.PublicUser)1 SwipeDecor (com.mindorks.placeholderview.SwipeDecor)1 SwipePlaceHolderView (com.mindorks.placeholderview.SwipePlaceHolderView)1 ItemRemovedListener (com.mindorks.placeholderview.listeners.ItemRemovedListener)1 HashMap (java.util.HashMap)1