use of android.support.v4.graphics.drawable.RoundedBitmapDrawable in project android_packages_apps_Dialer by MoKee.
the class ContactPhotoLoaderTest method testGetIcon_Photo.
public void testGetIcon_Photo() {
ContactInfo info = getTestContactInfo();
info.photoUri = getResourceUri(R.drawable.phone_icon);
ContactPhotoLoader loader = new ContactPhotoLoader(mContext, info);
assertTrue(loader.getIcon() instanceof RoundedBitmapDrawable);
}
use of android.support.v4.graphics.drawable.RoundedBitmapDrawable in project BaseProject by feer921.
the class ViewUtil method imageViewRounded.
public static void imageViewRounded(ImageView iv, int imageResId, int roundedRadius) {
Resources res = iv.getResources();
RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.create(res, BitmapFactory.decodeResource(res, imageResId));
roundedBitmapDrawable.setCornerRadius(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, roundedRadius, res.getDisplayMetrics()));
iv.setImageDrawable(roundedBitmapDrawable);
}
use of android.support.v4.graphics.drawable.RoundedBitmapDrawable in project weiui by kuaifan.
the class PictureAlbumDirectoryAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
final LocalMediaFolder folder = folders.get(position);
String name = folder.getName();
int imageNum = folder.getImageNum();
String imagePath = folder.getFirstImagePath();
boolean isChecked = folder.isChecked();
int checkedNum = folder.getCheckedNum();
holder.tv_sign.setVisibility(checkedNum > 0 ? View.VISIBLE : View.INVISIBLE);
holder.itemView.setSelected(isChecked);
if (mimeType == PictureMimeType.ofAudio()) {
holder.first_image.setImageResource(R.drawable.audio_placeholder);
} else {
RequestOptions options = new RequestOptions().placeholder(R.drawable.ic_placeholder).centerCrop().sizeMultiplier(0.5f).diskCacheStrategy(DiskCacheStrategy.ALL).override(160, 160);
Glide.with(holder.itemView.getContext()).asBitmap().load(imagePath).apply(options).into(new BitmapImageViewTarget(holder.first_image) {
@Override
protected void setResource(Bitmap resource) {
RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(mContext.getResources(), resource);
circularBitmapDrawable.setCornerRadius(8);
holder.first_image.setImageDrawable(circularBitmapDrawable);
}
});
}
holder.image_num.setText("(" + imageNum + ")");
holder.tv_folder_name.setText(name);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (onItemClickListener != null) {
for (LocalMediaFolder mediaFolder : folders) {
mediaFolder.setChecked(false);
}
folder.setChecked(true);
notifyDataSetChanged();
onItemClickListener.onItemClick(folder.getName(), folder.getImages());
}
}
});
}
use of android.support.v4.graphics.drawable.RoundedBitmapDrawable in project philm by chrisbanes.
the class PhilmImageView method setImageBitmapImpl.
void setImageBitmapImpl(final Bitmap bitmap) {
if (mAvatarMode) {
RoundedBitmapDrawable d = RoundedBitmapDrawableFactory.create(getResources(), bitmap);
d.setCircular(true);
setImageDrawable(d);
} else {
setImageBitmap(bitmap);
}
}
use of android.support.v4.graphics.drawable.RoundedBitmapDrawable in project philm by chrisbanes.
the class PhilmImageView method setImageResourceImpl.
void setImageResourceImpl(@DrawableRes int resId) {
if (mAvatarMode) {
BitmapDrawable d = (BitmapDrawable) ContextCompat.getDrawable(getContext(), resId);
RoundedBitmapDrawable rd = RoundedBitmapDrawableFactory.create(getResources(), d.getBitmap());
rd.setCircular(true);
setImageDrawable(rd);
} else {
setImageResource(resId);
}
}
Aggregations