Ejemplo n.º 1
0
 public void onGotAccount(String userId) {
   User user = TrailBookState.getCurrentUser();
   if (user == null) {
     user = new User();
   }
   user.userId = userId;
   BusProvider.getInstance().post(new UserUpdatedEvent(user));
   if (mActionOnAccountReceived != null) mActionOnAccountReceived.execute();
 }
Ejemplo n.º 2
0
  private void setUserDetails() {
    if (mGoogleApiClient.isConnected()
        && Plus.PeopleApi.getCurrentPerson(mGoogleApiClient) != null) {
      Person currentPerson = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
      String personName = currentPerson.getDisplayName();
      Person.Image personPhoto = currentPerson.getImage();
      User user = TrailBookState.getCurrentUser();
      if (personPhoto != null) user.profilePhotoUrl = personPhoto.getUrl();

      user.userName = personName;
      TrailBookState.getInstance().setUser(user);
    }
  }