當前位置: 首頁>>代碼示例>>Java>>正文


Java BitmapImageViewTarget類代碼示例

本文整理匯總了Java中com.bumptech.glide.request.target.BitmapImageViewTarget的典型用法代碼示例。如果您正苦於以下問題:Java BitmapImageViewTarget類的具體用法?Java BitmapImageViewTarget怎麽用?Java BitmapImageViewTarget使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BitmapImageViewTarget類屬於com.bumptech.glide.request.target包,在下文中一共展示了BitmapImageViewTarget類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: displayImage

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
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);
            }
        }
    });
}
 
開發者ID:nickyangjun,項目名稱:EasyEmoji,代碼行數:24,代碼來源:ImageLoader.java

示例2: loadRound

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
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);
                }
            });
}
 
開發者ID:gaolhjy,項目名稱:cniao5,代碼行數:18,代碼來源:GlideUtils.java

示例3: handleSignInResult

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
/**
 * 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);
                }
            });
        }
    }
}
 
開發者ID:iskandergaba,項目名稱:Botanist,代碼行數:27,代碼來源:AccountActivity.java

示例4: loadRoundImage

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
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);
        }
    });
}
 
開發者ID:SavorGit,項目名稱:Hotspot-master-devp,代碼行數:22,代碼來源:GlideImageLoader.java

示例5: showAvatar

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
/*****
 * 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);
			}
		});
	}
}
 
開發者ID:stuxo,項目名稱:REDAndroid,代碼行數:19,代碼來源:ProfileActivity.java

示例6: displayRoundImageFromUrl

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
/**
 * 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);
                }
            });
}
 
開發者ID:narenkukreja,項目名稱:quire,代碼行數:20,代碼來源:ImageUtils.java

示例7: onBindViewHolder

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
@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);
            }
        });
    }
}
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:17,代碼來源:AcInfoMemberAdapter.java

示例8: setCircleInfo

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
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);
        }
    });
}
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:20,代碼來源:CircleDynDelegate.java

示例9: setData

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
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();

    }
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:17,代碼來源:CreateCircleDelegate.java

示例10: onBindViewHolder

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
@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()));

}
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:26,代碼來源:CommentsAdapter.java

示例11: setUserInfo

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
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());
    }
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:25,代碼來源:UserInfoDelegate.java

示例12: setData

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
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);

    }
 
開發者ID:mangestudio,項目名稱:GCSApp,代碼行數:23,代碼來源:RedpacketInfoDelegate.java

示例13: requestCircleImg

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
/**
 * 將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);
                }
            });
}
 
開發者ID:linsir6,項目名稱:TripBuyer,代碼行數:20,代碼來源:ImageUtil.java

示例14: setRightMessage

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
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);
                }
            });
}
 
開發者ID:daeng-id,項目名稱:nfkita-mobile,代碼行數:22,代碼來源:CareChatHolder.java

示例15: loadData

import com.bumptech.glide.request.target.BitmapImageViewTarget; //導入依賴的package包/類
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);
}
 
開發者ID:daeng-id,項目名稱:nfkita-mobile,代碼行數:20,代碼來源:ProfileFragment.java


注:本文中的com.bumptech.glide.request.target.BitmapImageViewTarget類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。