Java 类com.bumptech.glide.request.target.BitmapImageViewTarget 实例源码

项目:EasyEmoji    文件:ImageLoader.java   
public void displayImage(final String uri, final ImageView imageView, int defaultIcon, final DisplayListener listener) {
    GenericRequestBuilder req = Glide.with(imageView.getContext().getApplicationContext()).load(uri).asBitmap().diskCacheStrategy(mDiskCacheStrategy);
    if (defaultIcon > 0) {
        req.placeholder(defaultIcon);
    }
    req.into(new BitmapImageViewTarget(imageView) {
        @Override
        public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
            super.onResourceReady(resource, glideAnimation);
            if (listener != null) {
                listener.onLoadCompleted(uri, imageView, resource);
            }
        }

        @Override
        public void onLoadFailed(Exception e, Drawable errorDrawable) {
            super.onLoadFailed(e, errorDrawable);
            if (listener != null) {
                listener.onLoadFailed(uri, imageView);
            }
        }
    });
}
项目:cniao5    文件:GlideUtils.java   
public static void loadRound(final Context context, String url, final ImageView iv) {
    Glide.with(context)//
            .load(url)//
            .asBitmap()//
            .placeholder(R.drawable.company_logo)//
            .centerCrop()//
            .into(new BitmapImageViewTarget(iv) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(context.getResources(),
                                    resource);
                    circularBitmapDrawable.setCircular(true);
                    iv.setImageDrawable(circularBitmapDrawable);
                }
            });
}
项目:Botanist    文件:AccountActivity.java   
/**
 * 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);
                }
            });
        }
    }
}
项目:Hotspot-master-devp    文件:GlideImageLoader.java   
public  void loadRoundImage(final Context context, String imgPath, final ImageView imageView, int placeholderResId, int failedResId) {
    if (context == null) {
        return;
    }
    Context appContext = context.getApplicationContext();
    Glide.with(appContext).
            load(imgPath)
            .asBitmap()
            .placeholder(placeholderResId)
            .error(failedResId)
            .centerCrop()
            .into(new BitmapImageViewTarget(imageView) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(context.getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            imageView.setImageDrawable(circularBitmapDrawable);
        }
    });
}
项目:REDAndroid    文件:ProfileActivity.java   
/*****
 * MVP View methods implementation
 *****/

@Override public void showAvatar(String avatarUrl) {
    if (avatarUrl.contains("gif")) {
        Glide.with(this).load(avatarUrl).asGif().into(avatar);
    } else {
        Glide.with(this).load(avatarUrl).asBitmap().centerCrop().into(new BitmapImageViewTarget(avatar) {
            @Override
            protected void setResource(Bitmap resource) {
                RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), resource);
                circularBitmapDrawable.setCircular(true);
                avatar.setImageDrawable(circularBitmapDrawable);
            }
        });
    }
}
项目:quire    文件:ImageUtils.java   
/**
 * Crops image into a circle that fits within the ImageView.
 */
public static void displayRoundImageFromUrl(final Context context, final String url, final ImageView imageView) {
    Glide.with(context)
            .load(url)
            .asBitmap()
            .centerCrop()
            .dontAnimate()
            .into(new BitmapImageViewTarget(imageView) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(context.getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    imageView.setImageDrawable(circularBitmapDrawable);
                }
            });
}
项目:GCSApp    文件:AcInfoMemberAdapter.java   
@Override
public void onBindViewHolder(final AnchorHotViewHolder holder, final int position) {

    ComMember member = mData.get(position);
    if (StringUtils.isNotEmpty(member.getImageUrl())){
        Glide.with(mContext).load(member.getImageUrl()).asBitmap().centerCrop().into(new BitmapImageViewTarget(holder.pic) {
            @Override
            protected void setResource(Bitmap resource) {
                RoundedBitmapDrawable circularBitmapDrawable =
                        RoundedBitmapDrawableFactory.create(mContext.getResources(), resource);
                circularBitmapDrawable.setCircular(true);
                holder.pic.setImageDrawable(circularBitmapDrawable);
            }
        });
    }
}
项目:GCSApp    文件:CircleDynDelegate.java   
public void setCircleInfo(CircleInfo info) {
    mTvCircleName.setText(info.getCircleName());
    mTvTitle.setText(info.getCircleName());
    mTvCircleNum.setText(info.getNum() + "人");
    mTvIntroduce.setText(info.getAnnouncement());
    String path = info.getLogoUrl();
    if (!path.contains("http://")) {
        path = BuildConfig.QiniuBase + path;
    }
    Glide.with(this.getActivity()).load(path).asBitmap().error(R.mipmap.icon_default_pic).centerCrop().into(new BitmapImageViewTarget(mImgTop) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(getActivity().getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            mImgTop.setImageDrawable(circularBitmapDrawable);
        }
    });
}
项目:GCSApp    文件:CreateCircleDelegate.java   
public void setData(CircleInfo info)
    {
        Glide.with(this.getActivity()).load(info.getLogoUrl()).asBitmap().centerCrop().into(new BitmapImageViewTarget(mImgPic) {
            @Override
            protected void setResource(Bitmap resource) {
                RoundedBitmapDrawable circularBitmapDrawable =
                        RoundedBitmapDrawableFactory.create(getActivity().getResources(), resource);
                circularBitmapDrawable.setCircular(true);
                mImgPic.setImageDrawable(circularBitmapDrawable);
            }
        });
        mTvName.setText(info.getCircleName());
        mEdtAnnouncement.setText(info.getAnnouncement());
//        mTvType.setText();

    }
项目:GCSApp    文件:CommentsAdapter.java   
@Override
public void onBindViewHolder(final AnchorHotViewHolder holder, final int position) {
    ProjectComments comments = mData.get(position);
    if (comments != null) {
        ComMember member = comments.getCommentUser();
        if (null != member && StringUtils.isNotEmpty(member.getName())) {
            holder.tvName.setText(member.getName());
        }
        if (StringUtils.isNotEmpty(member.getImageUrl())){

            Glide.with(mContext).load(member.getImageUrl()).asBitmap().centerCrop().into(new BitmapImageViewTarget(holder.pic) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(mContext.getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    holder.pic.setImageDrawable(circularBitmapDrawable);
                }
            });
        }
    }
    holder.tvContent.setText(comments.getComment());
    holder.tvTime.setText(TimeUtil.getDateToString(comments.getCreateTime()));

}
项目:GCSApp    文件:UserInfoDelegate.java   
public void setUserInfo(ComMember member) {

        if (member.getImageUrl() != null) {
            Glide.with(this.getActivity()).load(member.getImageUrl()).asBitmap().centerCrop().into(new BitmapImageViewTarget(imgPic) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(getActivity().getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    imgPic.setImageDrawable(circularBitmapDrawable);
                }
            });
        }
        if (member.getName() != null)
            tvName.setText(member.getName());

        tv_center_shareholder.setVisibility(member.getShareholder() == 0 ? View.GONE : View.VISIBLE);
        tv_center_investor.setVisibility(member.getInvestor() == 0 ? View.GONE : View.VISIBLE);

        if (StringUtils.isNotEmpty(member.getCompany()))
            tv_center_company.setText(member.getCompany());
        if (StringUtils.isNotEmpty(member.getPosition()))
            tv_center_position.setText(member.getPosition());
    }
项目:GCSApp    文件:RedpacketInfoDelegate.java   
public void setData(ReciveRedPacket info,String name ,String tip) {
        tv_money.setText(info.getMoney()+"");
        String path = info.getImgUrl();
        if (!path.contains("http://")){
            path = BuildConfig.QiniuBase + path;
        }
        Glide.with(this.getActivity()).load(path).asBitmap().centerCrop().into(new BitmapImageViewTarget(img_icon) {
            @Override
            protected void setResource(Bitmap resource) {
                RoundedBitmapDrawable circularBitmapDrawable =
                        RoundedBitmapDrawableFactory.create(getActivity().getResources(), resource);
                circularBitmapDrawable.setCircular(true);
                img_icon.setImageDrawable(circularBitmapDrawable);
            }
        });
        tv_name.setText(name+"的红包");
//        EMTextMessageBody txtBody = (EMTextMessageBody) message.getBody();
//        Spannable span = EaseSmileUtils.getSmiledText(this.getActivity(), txtBody.getMessage());
        // 设置内容
        tv_tip.setText(tip);

    }
项目:TripBuyer    文件:ImageUtil.java   
/**
 * 将url编程圆形的加载在 ImageView中
 */

public static void requestCircleImg(final Context context, String url, final ImageView imageView) {
    Glide.with(context)
            .load(url)
            .asBitmap()
            .centerCrop()
            .into(new BitmapImageViewTarget(imageView) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(context.getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    imageView.setImageDrawable(circularBitmapDrawable);
                }
            });
}
项目:nfkita-mobile    文件:CareChatHolder.java   
public void setRightMessage(Context context, String name, String message, String time, String avatar) {
    layoutright.setVisibility(View.VISIBLE);
    layoutLeft.setVisibility(View.GONE);
    txtNameRight.setVisibility(View.GONE);
    txtNameRight.setText(name);
    txtMessageRight.setText(message);
    txtTimeRight.setText(time);

    Glide.with(context)
            .load(avatar)
            .asBitmap().centerCrop()
            .placeholder(R.mipmap.ic_nfkita_round)
            .into(new BitmapImageViewTarget(imgAvatar) {
                @Override protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable rounded =
                            RoundedBitmapDrawableFactory.create(context.getResources(), resource);
                    rounded.setCircular(true);
                    imgAvatar.setImageDrawable(rounded);
                }
            });
}
项目:nfkita-mobile    文件:ProfileFragment.java   
private void loadData() {
    String avatar = CacheManager.grabString("avatar");
    String name = CacheManager.grabString("name");
    String email = CacheManager.grabString("email");
    Glide.with(getContext())
            .load(avatar)
            .asBitmap().centerCrop()
            .placeholder(R.mipmap.ic_nfkita_round)
            .into(new BitmapImageViewTarget(imgAvatar) {
                  @Override protected void setResource(Bitmap resource) {
                      RoundedBitmapDrawable rounded =
                      RoundedBitmapDrawableFactory.create(getContext().getResources(), resource);
                      rounded.setCircular(true);
                      imgAvatar.setImageDrawable(rounded);
                  }
            });
    txtFullName.setText(name);
    txtEmail.setText(email);
}
项目:Privy    文件:MainActivity.java   
private void loadProfilePic() {
    Glide.with(mContext).load(mSharedPreferences.getString(PROFILE_PIC_URL, ""))
            .asBitmap()
            .fitCenter()
            .diskCacheStrategy(DiskCacheStrategy.ALL)
            .error(R.drawable.default_avatar)
            .into(new BitmapImageViewTarget(profileImg) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(mContext.getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    profileImg.setImageDrawable(circularBitmapDrawable);
                }
            });
}
项目:UNCmorfi    文件:UserCursorAdapter.java   
private void setImage(final UserItemViewHolder holder, User user) {
    Glide.with(mContext)
            .load(USER_IMAGES_URL + user.getImage())
            .asBitmap()
            .placeholder(R.drawable.person_placeholder)
            .diskCacheStrategy(DiskCacheStrategy.ALL)
            .centerCrop()
            .into(new BitmapImageViewTarget(holder.userImage) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(mContext.getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    holder.userImage.setImageDrawable(circularBitmapDrawable);
                }
            });
}
项目:Red-Calorie    文件:RxImageLoader.java   
private RxImageLoader(Builder builder) {
    this.imageView = builder.imageView;
    this.uri = builder.uri;
    this.target = new BitmapImageViewTarget(imageView) {


        @Override
        public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
            super.onResourceReady(resource, glideAnimation);
            onSuccess();
        }

        @Override
        public void onLoadFailed(Exception e, Drawable errorDrawable) {
            super.onLoadFailed(e, errorDrawable);
            onError();
        }
    };
}
项目:Capstone    文件:PlaceListAdapter.java   
@Override
        public void bindCursor(Cursor cursor) {
            name.setText(cursor.getString(cursor.getColumnIndex(PlaceContract.PlaceEntry.COLUMN_NAME)));
            id.setText(cursor.getString(cursor.getColumnIndex(PlaceContract.PlaceEntry.COLUMN_PLACE_ID)));
            photo.setText(cursor.getString(cursor.getColumnIndex(PlaceContract.PlaceEntry.COLUMN_PHOTO)));
            vicinity.setText(cursor.getString(cursor.getColumnIndex(PlaceContract.PlaceEntry.COLUMN_VICINITY)));

            Glide.with(icon.getContext())
                    .load(Config.getPlacePhotoUrl("80", cursor.getString(cursor.getColumnIndex(PlaceContract.PlaceEntry.COLUMN_PHOTO)), Config.API_KEY))
                    .asBitmap().centerCrop().into(new BitmapImageViewTarget(icon) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(mContext.getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    icon.setImageDrawable(circularBitmapDrawable);
                }
            });
//                Log.e("Photo" , Config.getPlacePhotoUrl("80", cursor.getString(cursor.getColumnIndex(PlaceContract.PlaceEntry.COLUMN_PHOTO)), Config.API_KEY));
        }
项目:wnacg    文件:ViewHolder.java   
/** 与Glide高耦合的设置图片 */
public ViewHolder setImageCircle(@IdRes final int viewId, @DrawableRes int resId){
    final ImageView imageView = getView(viewId);
    Glide.with(mContext)
            .load(resId)
            .asBitmap()
            .into(new BitmapImageViewTarget(imageView) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable
                            = RoundedBitmapDrawableFactory.create(mContext.getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    imageView.setImageDrawable(circularBitmapDrawable);
        }
    });
    return this;
}
项目:GankGirl    文件:GirlAdapter.java   
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
    GankBean gankBean = mData.get(position);
    BitmapRequestBuilder<String, Bitmap> requestBuilder = Glide.with(mContext)
            .load(gankBean.url)
            .asBitmap()
            .diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .transform(new GlideRoundTransform(mContext, 4))
            .animate(R.anim.image_alpha_in)
            .error(R.color.accent);
    requestBuilder.into(new BitmapImageViewTarget(holder.ivGirlImg){
        @Override
        protected void setResource(Bitmap resource) {
            holder.ivGirlImg.setOriginalSize(resource.getWidth(), resource.getHeight());
            holder.ivGirlImg.setImageBitmap(resource);
        }
    });
}
项目:BikeBuddy2.0    文件:ArticleListFragment.java   
@Override
        public View getView(int position, View convertView, ViewGroup container) {
            if (convertView == null) {
                convertView = LayoutInflater.from(getActivity()).inflate(R.layout.list_item_ride, container, false);
            }

            final Ride ride = (Ride) getItem(position);
            ((TextView) convertView.findViewById(R.id.ride_date)).setText(ride.date);
            ((TextView) convertView.findViewById(R.id.ride_time)).setText(ride.time);
            final ImageView img = (ImageView) convertView.findViewById(R.id.thumbnail);
            Glide.with(getActivity()).load(imageResIds[position % 5]).asBitmap().fitCenter().into(new BitmapImageViewTarget(img) {
//            Glide.with(getActivity()).load(item.photoId).asBitmap().fitCenter().into(new BitmapImageViewTarget(img) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(getActivity().getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    img.setImageDrawable(circularBitmapDrawable);
                }
            });

            return convertView;
        }
项目:GoogleBookReader-android    文件:ImageViewBindingAdapters.java   
@BindingAdapter(value = {"imageUrl", "circle"}, requireAll = false)
public static void loadImage(ImageView view, String url, Boolean circle) {

    if (circle == null || !circle) {
        Glide.with(view.getContext()).load(url).into(view);
    } else {
        Glide.with(view.getContext()).load(url).asBitmap().centerCrop().into(new BitmapImageViewTarget(view) {
            @Override
            protected void setResource(Bitmap resource) {
                RoundedBitmapDrawable circularBitmapDrawable =
                        RoundedBitmapDrawableFactory.create(view.getResources(), resource);
                circularBitmapDrawable.setCircular(true);
                view.setImageDrawable(circularBitmapDrawable);
            }
        });
    }
}
项目:gank.io-unofficial-android-client    文件:GitHubUserActivity.java   
private void setUserInfo() {

    Glide.with(this)
        .load(mUserInfo.avatarUrl)
        .asBitmap()
        .placeholder(R.drawable.ic_slide_menu_avatar_no_login)
        .into(new BitmapImageViewTarget(mUserInfoAvatar) {

          @Override
          protected void setResource(Bitmap resource) {

            mUserInfoAvatar.setImageDrawable(RoundedBitmapDrawableFactory
                .create(GitHubUserActivity.this.getResources(), resource));
          }
        });
    mUsername.setText(mUserInfo.name);
  }
项目:MaterialHome    文件:EBookReviewsAdapter.java   
@Override
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
    if (holder instanceof BookCommentHolder) {
        List<HotReview.Reviews> reviews = mHotView.getReviews();
        Glide.with(UIUtils.getContext())
                .load(EBookUtils.getImageUrl(reviews.get(position).getAuthor().getAvatar()))
                .asBitmap()
                .centerCrop()
                .into(new BitmapImageViewTarget(((BookCommentHolder) holder).iv_avatar) {
                    @Override
                    protected void setResource(Bitmap resource) {
                        RoundedBitmapDrawable circularBitmapDrawable =
                                RoundedBitmapDrawableFactory.create(UIUtils.getContext().getResources(), resource);
                        circularBitmapDrawable.setCircular(true);
                        ((BookCommentHolder) holder).iv_avatar.setImageDrawable(circularBitmapDrawable);
                    }
                });
        ((BookCommentHolder) holder).tv_user_name.setText(reviews.get(position).getAuthor().getNickname());
        ((BookCommentHolder) holder).ratingBar_hots.setRating((float) reviews.get(position).getRating());
        ((BookCommentHolder) holder).tv_comment_content.setText(reviews.get(position).getContent());
        ((BookCommentHolder) holder).tv_favorite_num.setText(reviews.get(position).getLikeCount() + "");
        ((BookCommentHolder) holder).tv_update_time.setText(reviews.get(position).getUpdated().split("T")[0]);
    }
}
项目:MaterialHome    文件:BookReviewsAdapter.java   
@Override
public void onBindViewHolder(final RecyclerView.ViewHolder holder, int position) {
    if (holder instanceof BookCommentHolder) {
        List<BookReviewResponse> reviews = reviewsListResponse.getReviews();
        Glide.with(UIUtils.getContext())
                .load(reviews.get(position).getAuthor().getAvatar())
                .asBitmap()
                .centerCrop()
                .into(new BitmapImageViewTarget(((BookCommentHolder) holder).iv_avatar) {
                    @Override
                    protected void setResource(Bitmap resource) {
                        RoundedBitmapDrawable circularBitmapDrawable =
                                RoundedBitmapDrawableFactory.create(UIUtils.getContext().getResources(), resource);
                        circularBitmapDrawable.setCircular(true);
                        ((BookCommentHolder) holder).iv_avatar.setImageDrawable(circularBitmapDrawable);
                    }
                });
        ((BookCommentHolder) holder).tv_user_name.setText(reviews.get(position).getAuthor().getName());
        if (reviews.get(position).getRating() != null) {
            ((BookCommentHolder) holder).ratingBar_hots.setRating(Float.valueOf(reviews.get(position).getRating().getValue()));
        }
        ((BookCommentHolder) holder).tv_comment_content.setText(reviews.get(position).getSummary());
        ((BookCommentHolder) holder).tv_favorite_num.setText(reviews.get(position).getVotes() + "");
        ((BookCommentHolder) holder).tv_update_time.setText(reviews.get(position).getUpdated().split(" ")[0]);
    }
}
项目:ReactiveFB    文件:SingleFriendActivity.java   
private void fillProfile(Profile value) {
    Glide.with(this)
            .load(value.getPicture())
            .asBitmap()
            .centerCrop()
            .into(new BitmapImageViewTarget(imageView) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    imageView.setImageDrawable(circularBitmapDrawable);
                }
            });

    result.setText(value.getName());
}
项目:ReactiveFB    文件:ProfileActivity.java   
private void fillProfile(Profile value) {
    Glide.with(this)
            .load(value.getPicture())
            .asBitmap()
            .centerCrop()
            .into(new BitmapImageViewTarget(imageView) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    imageView.setImageDrawable(circularBitmapDrawable);
                }
            });

    result.setText(value.getName());
}
项目:bridddle-for-dribbble    文件:ProfileFragment.java   
@Override
public void showProfile(User user) {
    Glide.with(getContext()).load(user.getAvatarUrl())
            .asBitmap()
            .centerCrop()
            .into(new BitmapImageViewTarget(avatar) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(getContext().getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    avatar.setImageDrawable(circularBitmapDrawable);
                }
            });

    name.setText(user.getName());
    username.setText(user.getUsername());
    shotCount.setText(String.valueOf(user.getShotsCount()));
    followerCount.setText(String.valueOf(user.getFollowersCount()));
    likesCount.setText(String.valueOf(user.getLikesReceivedCount()));
    bio.setText(Html.fromHtml("Co-founder &amp; designer of <a href=\\\"https://dribbble.com/dribbble\\\">@Dribbble</a>. Principal of SimpleBits. Aspiring clawhammer banjoist."));
}
项目:bridddle-for-dribbble    文件:CommentViewHolder.java   
public void bind(Comment comment) {
    Glide.with(itemView.getContext()).load(comment.getUser().getAvatarUrl())
            .asBitmap()
            .centerCrop()
            .into(new BitmapImageViewTarget(avatar) {
                @Override
                protected void setResource(Bitmap resource) {
                    RoundedBitmapDrawable circularBitmapDrawable =
                            RoundedBitmapDrawableFactory.create(itemView.getContext().getResources(), resource);
                    circularBitmapDrawable.setCircular(true);
                    avatar.setImageDrawable(circularBitmapDrawable);
                }
            });

    name.setText(comment.getUser().getName());
    content.setText(comment.getBody());
    LinkUtils.setTextWithLinks(content, comment.getBody());
    time.setText(DateUtils.parse(comment.getCreatedAt()));
}
项目:GankDaily    文件:MainListAdapter.java   
@Override
void bindItem(Context context, final Gank gank, final int position) {
    mTvTime.setText(DateUtil.toDate(gank.publishedAt));

    Glide.with(context)
            .load(gank.url)
            .asBitmap()
            .into(new BitmapImageViewTarget(mImageView){
                @Override
                public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                    super.onResourceReady(resource, glideAnimation);
                    mBkTime.setVisibility(View.VISIBLE);
                }
            });

    mTvTime.setText(DateUtil.toDate(gank.publishedAt));
    mImageView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mIClickItem.onClickGankItemGirl(gank, mImageView, mTvTime);
        }
    });
}
项目:android-design-template    文件:ArticleListFragment.java   
@Override
public View getView(int position, View convertView, ViewGroup container) {
    if (convertView == null) {
        convertView = LayoutInflater.from(getActivity()).inflate(R.layout.list_item_article, container, false);
    }

    final DummyContent.DummyItem item = (DummyContent.DummyItem) getItem(position);
    ((TextView) convertView.findViewById(R.id.article_title)).setText(item.title);
    ((TextView) convertView.findViewById(R.id.article_subtitle)).setText(item.author);
    final ImageView img = (ImageView) convertView.findViewById(R.id.thumbnail);
    Glide.with(getActivity()).load(item.photoId).asBitmap().fitCenter().into(new BitmapImageViewTarget(img) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(getActivity().getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            img.setImageDrawable(circularBitmapDrawable);
        }
    });

    return convertView;
}
项目:Movie-Maniac-Android    文件:ViewPodUserInfo.java   
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    ButterKnife.bind(this, this);

    Glide.with(ivProfileDummy.getContext()).load(R.drawable.dummy_profile).asBitmap().centerCrop().into(new BitmapImageViewTarget(ivProfileDummy) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(ivProfile.getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            ivProfileDummy.setImageDrawable(circularBitmapDrawable);
        }
    });

    EventBus eventBus = EventBus.getDefault();
    if (!eventBus.isRegistered(this)) {
        eventBus.register(this);
    }

    if (UserModel.getInstance().isUserLogin()) {
        UserVO loginUser = UserModel.getInstance().getLoginUser();
        displayLoginUserInfo(loginUser);
    }
}
项目:HLOLI    文件:ImageLoadUtils.java   
public static void loadRoundImage(final Context context, String url, final ImageView imgView) {
    Glide.with(context).load(url).asBitmap().centerCrop().into(new BitmapImageViewTarget(imgView) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(context.getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            imgView.setImageDrawable(circularBitmapDrawable);
        }
    });
}
项目:HLOLI    文件:ImageLoadUtils.java   
public static void loadRoundImage(final Context context, int resId, final ImageView imgView) {
    Glide.with(context).load(resId).asBitmap().centerCrop().into(new BitmapImageViewTarget(imgView) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(context.getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            imgView.setImageDrawable(circularBitmapDrawable);
        }
    });
}
项目:Hillffair17    文件:LeaderBoardAdapter.java   
@Override
public void onBindViewHolder(LeaderBoardViewHolder holder, int position) {
    LeaderBoardActivity.LeaderBoardUserModel user=users.get(position);

    holder.username.setText(user.getName().toString());
    holder.score.setText("Score: "+Integer.toString(user.getSets().getScore()));
    Glide.with(context).load(user.getPhoto()).into(holder.photo);

    final ImageView imageView=holder.photo;

    Glide.with(context).load(user.getPhoto()).asBitmap().centerCrop().into(new BitmapImageViewTarget(imageView) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(context.getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            imageView.setImageDrawable(circularBitmapDrawable);
        }
    });

    Integer prsnlscore = user.getSets().getScore();
    if(prsnlscore>=800) holder.useraward.setImageResource(R.drawable.trophy_gold);
    else if(prsnlscore>=600) holder.useraward.setImageResource(R.drawable.trophy_silver);
    else if(prsnlscore>=450) holder.useraward.setImageResource(R.drawable.trophy_bronze);
    else if(prsnlscore>=300) holder.useraward.setImageResource(R.drawable.trophy_goldbadge);
    else if(prsnlscore>=150) holder.useraward.setImageResource(R.drawable.trophy_silverbadge);
    else if(prsnlscore>0) holder.useraward.setImageResource(R.drawable.trophy_bronzebadge);
    else if(prsnlscore==0) holder.useraward.setImageResource(R.drawable.trophy_participation);
    holder.sets.setText("Sets: "+Integer.toString(user.getSets().getSets()));
}
项目:REDAndroid    文件:BaseActivity.java   
public void loadImageRounded(String imageUrl, final ImageView imageView) {
    Glide.with(this).load(imageUrl).asBitmap().centerCrop().into(new BitmapImageViewTarget(imageView) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            imageView.setImageDrawable(circularBitmapDrawable);
        }
    });
}
项目:REDAndroid    文件:ProfileActivity.java   
@Override public void showDefaultAvatar() {
    Glide.with(this).load(R.drawable.default_avatar).asBitmap().centerCrop().into(new BitmapImageViewTarget(avatar) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            avatar.setImageDrawable(circularBitmapDrawable);
        }
    });
}
项目:Nimbus    文件:LeaderBoardAdapter.java   
@Override
public void onBindViewHolder(LeaderBoardViewHolder holder, int position) {
    LeaderBoardActivity.LeaderBoardUserModel user=users.get(position);

    holder.username.setText(user.getName().toString());
    holder.score.setText("Score: "+Integer.toString(user.getSets().getScore()));
    Glide.with(context).load(user.getPhoto()).into(holder.photo);

    final ImageView imageView=holder.photo;

    Glide.with(context).load(user.getPhoto()).asBitmap().centerCrop().into(new BitmapImageViewTarget(imageView) {
        @Override
        protected void setResource(Bitmap resource) {
            RoundedBitmapDrawable circularBitmapDrawable =
                    RoundedBitmapDrawableFactory.create(context.getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            imageView.setImageDrawable(circularBitmapDrawable);
        }
    });

    Integer prsnlscore = user.getSets().getScore();
    if(prsnlscore>=800) holder.useraward.setImageResource(R.drawable.trophy_gold);
    else if(prsnlscore>=600) holder.useraward.setImageResource(R.drawable.trophy_silver);
    else if(prsnlscore>=450) holder.useraward.setImageResource(R.drawable.trophy_bronze);
    else if(prsnlscore>=300) holder.useraward.setImageResource(R.drawable.trophy_goldbadge);
    else if(prsnlscore>=150) holder.useraward.setImageResource(R.drawable.trophy_silverbadge);
    else if(prsnlscore>0) holder.useraward.setImageResource(R.drawable.trophy_bronzebadge);
    else if(prsnlscore==0) holder.useraward.setImageResource(R.drawable.trophy_participation);
    holder.sets.setText("Sets: "+Integer.toString(user.getSets().getSets()));
}
项目:Android_ImagePicker    文件:ImageLoader.java   
public static void loadRoundedImage(final Context context, final ImageView imageView, String imageUrl, int placeHolderRes) {
    Glide.with(context)
            .load(imageUrl)
            .asBitmap()
            .placeholder(placeHolderRes).centerCrop().into(new BitmapImageViewTarget(imageView) {
        @Override
        protected void setResource(Bitmap resource) {
            final RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.getResources(), resource);
            circularBitmapDrawable.setCircular(true);
            imageView.setImageDrawable(circularBitmapDrawable);
        }
    });
}