Skip to content

Instantly share code, notes, and snippets.

View intrepidkarthi's full-sized avatar
🚀
while(!(tastedSuccess = tryTryAgain()));

Karthikeyan NG intrepidkarthi

🚀
while(!(tastedSuccess = tryTryAgain()));
View GitHub Profile
@gabrielemariotti
gabrielemariotti / MainActivity.java
Last active February 3, 2026 07:04
How to obtain a CardView (support library) with a Image and rounded corners for API<21
ImageView imageView = (ImageView) findViewById(R.id.card_thumbnail_image);
Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.rose);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
//Default
imageView.setBackgroundResource(R.drawable.rose);
} else {
//RoundCorners
RoundCornersDrawable round = new RoundCornersDrawable(mBitmap,
getResources().getDimension(R.dimen.cardview_default_radius), 0); //or your custom radius