use of com.example.c4q.capstone.database.publicuserdata.PublicUser in project Grupp by tmoronta1208.
the class TempUserActivity method currentUserProfileData.
public void currentUserProfileData() {
iconRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
UserIcon userIcon = dataSnapshot.getValue(UserIcon.class);
try {
String userIconUrl = userIcon.getIcon_url();
Glide.with(TempUserActivity.this).load(userIconUrl).into(profilePic);
} catch (NullPointerException e) {
e.printStackTrace();
profilePic.setImageResource(R.drawable.default_avatar);
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
userRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
PublicUser publicUser = dataSnapshot.getValue(PublicUser.class);
StringBuilder sb = new StringBuilder();
sb.append(publicUser.getFirst_name());
sb.append(" ");
sb.append(publicUser.getLast_name());
personName.setText(sb.toString());
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
use of com.example.c4q.capstone.database.publicuserdata.PublicUser in project Grupp by tmoronta1208.
the class VenueNetworkUtility method getVoteListFromFourSquare.
public void getVoteListFromFourSquare(List<PublicUser> eventGuests) {
if (eventGuests != null) {
Log.d(TAG, "venue util eventGuests" + eventGuests.size());
// eventGuests.add(CurrentUser.getInstance().getCurrentPublicUser());
String preferences = "beer karaoke";
final int callCount = eventGuests.size();
for (PublicUser guest : eventGuests) {
final String id = guest.getUser_id();
String zipCode = guest.getZip_code();
int radius = guest.getRadius();
radius = radius * 1609;
String userRadius = String.valueOf(radius);
Log.d(TAG, "user radius" + guest.getFirst_name() + " : " + userRadius);
NetworkUtility.getNetworkUtility().getFourSQList(zipCode, userRadius, preferences, new VenueNetworkListener() {
@Override
public void getFourSList(List<Venue> fourSVenues) {
Log.d(TAG, "Venue Network Listener called");
Log.d(TAG, "list size" + fourSVenues.size());
Log.d(TAG, "user" + id);
HashMap<String, Venue> listMap = new HashMap<>();
for (Venue venue : fourSVenues) {
listMap.put(venue.getVenue_id(), venue);
}
venueMap.put(id, listMap);
if (venueMap.size() == callCount) {
Log.d(TAG, "ready to compare lists");
compareUserVenueLists();
}
Log.d(TAG, "not ready " + callCount);
}
@Override
public void getFourSVenueIds(List<String> fourSquareVenueIds) {
}
});
}
}
}
Aggregations