Skip to content
Merged

Merge #447

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ private void signUserIn() {
}
} else { // User already logged-in
MainApplication.user.setEmail(PreferenceUtils.getString(this, PreferenceUtils.KEY_USER_ACCOUNT));
((NavigationDrawerFragment) getSupportFragmentManager().findFragmentById(R.id.navigation_drawer)).setUserInfo();
GcmHelper.start(getApplicationContext()); // Register to GCM
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ private static boolean cancelPotentialWork(Person person, ImageView imageView) {

BitmapWorkerTask task = getTaskFromView(imageView);

if (task == null) {
Log.e(TAG, "cancelPotentialWork: No task associated with the ImageView, or an existing task was cancelled"); // No task associated with the ImageView, or an existing task was cancelled
if (task == null || person == null) {
Log.e(TAG, "cancelPotentialWork: No task or person associated with the ImageView, or an existing task was cancelled");
return true;
}

if (!task.data.getEmail().equals(person.getEmail())) {
Log.e(TAG, "cancelPotentialWork: Cancel previous task"); // Cancel previous task
if (task.data == null || task.data.getEmail() == null || !task.data.getEmail().equals(person.getEmail())) {
Log.e(TAG, "cancelPotentialWork: Cancel previous task");
task.cancel(true);
return true;
}
Log.e(TAG, "cancelPotentialWork: The same work is already in progress"); // The same work is already in progress
Log.e(TAG, "cancelPotentialWork: The same work is already in progress");
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import cc.softwarefactory.lokki.android.MainApplication;
import cc.softwarefactory.lokki.android.R;
import cc.softwarefactory.lokki.android.avatar.AvatarLoader;
import cc.softwarefactory.lokki.android.models.MainUser;
import cc.softwarefactory.lokki.android.utilities.PreferenceUtils;

/**
Expand Down Expand Up @@ -107,10 +108,12 @@ public void setUserInfo() {
ImageView avatarImage = (ImageView) mListViewHeader.findViewById(R.id.avatar);
AvatarLoader avatarLoader = new AvatarLoader();

String email = PreferenceUtils.getString(getActivity(), PreferenceUtils.KEY_USER_ACCOUNT);
avatarLoader.load(MainApplication.user, avatarImage);
MainUser user = MainApplication.user;
avatarLoader.load(user, avatarImage);

aq.id(R.id.user_name).text(email);
if (user != null && user.getEmail() != null) {
aq.id(R.id.user_name).text(MainApplication.user.getEmail());
}
}
else {
Log.e(TAG, "Cannot add user info. ListViewHeader not initialized");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package cc.softwarefactory.lokki.android.models;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Model Class for Tracking Place on Map
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class Place implements Comparable<Place> {

private String id; // place id
private String name; // place name
private String img; // Place image
private UserLocation location; // place location
private String id;
private String name;
private String img;
private UserLocation location;

public String getId() {
return id;
Expand Down