jp.wasabeef.picasso.transformations.RoundedCornersTransformation Java Examples

The following examples show how to use jp.wasabeef.picasso.transformations.RoundedCornersTransformation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FeedAdapter.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onBindViewHolder(@NonNull FeedItemViewHolder holder, int position) {
    holder.nameView.setText(mTweets.get(position).getName());
    holder.screenNameView.setText(mContext.getString(R.string.scree_name, mTweets.get(position).getScreenName()));
    holder.tweetTimeView.setText(mTweets.get(position).getTweetTime());
    holder.textView.setText(mTweets.get(position).getTweetText());
    holder.retweetView.setText(mTweets.get(position).getRetweets());
    holder.favView.setText(mTweets.get(position).getFavorites());

    Picasso.get()
            .load(mTweets.get(position).getProfileImageUrl())
            .transform(new CropCircleTransformation())
            .into(holder.mProfileImage);
    Picasso.get()
            .load(mTweets.get(position).getProfileBackgroundImageUrl())
            .resize(800,460)
            .centerCrop()
            .transform(new RoundedCornersTransformation(10, 0))
            .into(holder.mProfileBackgroundImage);
}
 
Example #2
Source File: UserImage.java    From intra42 with Apache License 2.0 5 votes vote down vote up
public static RequestCreator getPicassoCorned(RequestCreator request) {
    final int radius = 5;
    final int margin = 5;
    final Transformation transformation = new RoundedCornersTransformation(radius, margin);
    request.transform(transformation);
    return request;
}
 
Example #3
Source File: DiscussionListItemViewHolder.java    From SteamGifts with MIT License 5 votes vote down vote up
public void setFrom(Discussion discussion) {
    StringBuilder text = new StringBuilder();
    if (discussion.isPoll())
        text.append("{faw-align-left} ");
    text.append(discussion.getTitle());

    discussionTitle.setText(text);
    discussionAuthor.setText(discussion.getCreator());
    discussionTime.setText(discussion.getRelativeCreatedTime(activity));

    StringUtils.setBackgroundDrawable(activity, itemContainer, discussion.isLocked());

    Picasso.with(activity).load(discussion.getCreatorAvatar()).placeholder(R.drawable.default_avatar_mask).transform(new RoundedCornersTransformation(20, 0)).into(discussionAuthorAvatar);
}
 
Example #4
Source File: PicassoLoader.java    From ImageLoader with Apache License 2.0 4 votes vote down vote up
private void setShapeModeAndBlur(SingleConfig config, RequestCreator request) {
    int shapeMode = config.getShapeMode();
    List<Transformation> transformations = new ArrayList<>();

    if(config.isCropFace()){
         //transformations.add(new FaceCenterCrop(config.getWidth(), config.getHeight()));//脸部识别
    }

    if(config.isNeedBlur()){
        transformations.add(new BlurTransformation(GlobalConfig.context,config.getBlurRadius()));
    }


    switch (shapeMode){
        case ShapeMode.RECT:

            if(config.getBorderWidth()>0){

            }
            break;
        case ShapeMode.RECT_ROUND:
            transformations.add(new RoundedCornersTransformation( config.getRectRoundRadius(), 0, RoundedCornersTransformation.CornerType.ALL));

            if(config.getBorderWidth()>0){

            }
            if(config.isGif() && config.getRoundOverlayColor()>0){

            }
            break;
        case ShapeMode.OVAL:
            transformations.add(new CropCircleTransformation());
            if(config.getBorderWidth()>0){

            }
            if(config.isGif() && config.getRoundOverlayColor()>0){

            }
            break;
    }
    if(transformations.size()>0){
        request.transform(transformations);
    }


}
 
Example #5
Source File: GiveawayGroupViewHolder.java    From SteamGifts with MIT License 4 votes vote down vote up
public void setFrom(GiveawayGroup group) {
    groupName.setText(group.getTitle());
    Picasso.with(context).load(group.getAvatar()).placeholder(R.drawable.default_avatar_mask).transform(new RoundedCornersTransformation(20, 0)).into(groupAvatar);

}