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);
}
});
}
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;
}
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;
}
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;
}
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;
}
Aggregations