/**
* Handle a google signIn
* @param result - the result of the signin attempt
*/
private void handleSignInResult(GoogleSignInResult result) {
Log.d(TAG, "handleSignInResult:" + result.isSuccess());
final ImageView accountImageView = findViewById(R.id.account_picture);
if (result.isSuccess()) {
// Signed in successfully, show authenticated UI.
GoogleSignInAccount acct = result.getSignInAccount();
if (acct != null) {
Glide.with(this).load(acct.getPhotoUrl()).asBitmap().centerCrop().into(new BitmapImageViewTarget(accountImageView) {
/**
* Set a glide image
* @param resource - the image to set
*/
@Override
protected void setResource(Bitmap resource) {
RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), resource);
circularBitmapDrawable.setCircular(true);
accountImageView.setImageDrawable(circularBitmapDrawable);
}
});
}
}
}
AccountActivity.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:Botanist
作者:
评论列表
文章目录