本文整理汇总了Java中com.google.android.gms.plus.model.people.Person.Image方法的典型用法代码示例。如果您正苦于以下问题:Java Person.Image方法的具体用法?Java Person.Image怎么用?Java Person.Image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.plus.model.people.Person
的用法示例。
在下文中一共展示了Person.Image方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onConnected
import com.google.android.gms.plus.model.people.Person; //导入方法依赖的package包/类
@Override
public void onConnected(Bundle bundle) {
if (!mClearingAccounts) {
String email = Plus.AccountApi.getAccountName(google);
Person person = Plus.PeopleApi.getCurrentPerson(google);
if (person != null) {
String personName = person.getDisplayName();
Person.Image avatar = person.getImage();
String photoURL = "false";
if (person.hasImage() && avatar.hasUrl()) {
photoURL = avatar.getUrl().split("\\?")[0];
}
OUser user = new OUser();
user.setUsername(email);
user.setPassword("odoo_mobile_shop_google_user");
user.setName(personName);
user.setAvatar(photoURL);
user.setDatabase(OConstants.publicUser().getDatabase());
new AccountCreator().execute(user);
}
} else {
Plus.AccountApi.clearDefaultAccount(google);
mClearingAccounts = false;
}
}
示例2: onConnected
import com.google.android.gms.plus.model.people.Person; //导入方法依赖的package包/类
@Override
public void onConnected(Bundle bundle) {
if (operationLogin) {
Person person = Plus.PeopleApi.getCurrentPerson(googleApiClient);
final String id = person.getId();
final String displayName = person.getDisplayName();
final Person.Image image = person.getImage();
final String imageUrl = image.hasUrl() ? image.getUrl() : null;
final String accountName = Plus.AccountApi.getAccountName(googleApiClient);
new AsyncTask<Void, Void, Void>() {
AuthData authData;
Exception cause;
@Override
protected Void doInBackground(Void... params) {
try {
String token = GoogleAuthUtil.getToken(activity, accountName, "oauth2:" + Plus.SCOPE_PLUS_LOGIN);
authData = createAuthData(id, token, displayName, imageUrl);
} catch (IOException | GoogleAuthException e) {
cause = e;
}
googleApiClient.disconnect();
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
if (cause != null) {
onError(createAuthError(cause));
} else {
onSuccess(authData);
}
}
}.execute();
} else {
Plus.AccountApi.clearDefaultAccount(googleApiClient);
Plus.AccountApi.revokeAccessAndDisconnect(googleApiClient).setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(Status status) {
googleApiClient.disconnect();
if (status.isSuccess()) {
onSuccess(createAuthData());
} else if (status.isCanceled()) {
onCancelled(createAuthCancel());
} else {
onError(createAuthError(status.getStatusMessage()));
}
}
});
}
}
示例3: getProfileImageUrl
import com.google.android.gms.plus.model.people.Person; //导入方法依赖的package包/类
private String getProfileImageUrl(Person person) {
Person.Image image = person.getImage();
return image.hasUrl() ? image.getUrl() : null;
}
示例4: getImage
import com.google.android.gms.plus.model.people.Person; //导入方法依赖的package包/类
public final Person.Image getImage()
{
return this.Fw;
}
示例5: getImage
import com.google.android.gms.plus.model.people.Person; //导入方法依赖的package包/类
public final Person.Image getImage()
{
return new ig.c(getString("image"));
}