BlurShadowImageView

This library provides blurred drop shadows to ImageView similar to iOS backdrop shadows.Provides fast canvas draw as no renderscript needed .The similar shadow blurred effects can also be seen in iOS Music App.

5cf3ca80-449c-11eb-9dc3-9c69310485a3

Download Demo App

Download the demo app .apk file here

app_icon_demo_app

Scan to Download

app_barcode

Installation

Add it in your root build.gradle at the end of repositories :

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add the following dependency to your app build.gradle file :

dependencies {
	        implementation 'com.github.virtualvivek:BlurShadowImageView:1.2'
	}

How to use

Using Xml to config


 <me.virtualiz.blurshadowimageview.BlurShadowImageView
	android:layout_width="200dp"
	android:layout_height="220dp"
	android:layout_gravity="center"
	app:v_shadowOffset="40dp"
	app:v_imageRound="20dp"
	app:v_imageSrc="@drawable/nature" />

Use Java code to config

BlurShadowImageView blurshadowimageview = findViewById(R.id.blurSImageView);

//Sets Border Round Radius
blurshadowimageview.setRound((int) value);  

//Sets Image Resource
blurshadowimageview.setImageResource(ImgRes);  

//Sets Image Drawable
blurshadowimageview.setImageDrawable(drawable);  

//Sets Image Bitmap
blurshadowimageview.setImageBitmap(bitmap);  

Load image with Picasso

app_load_online

 Target target = new Target() {
	@Override
    	public void onBitmapLoaded(Bitmap bitmap,
		Picasso.LoadedFrom from) {
		// Bitmap is loaded, use Image here
		demo_img.setImageBitmap(bitmap);
    	}
    	@Override
    	public void onBitmapFailed(Exception e, Drawable d) {
		// Fires if bitmap couldn't be loaded.
    	}
    	@Override
    	public void onPrepareLoad(Drawable d){
		// Fires bitmap on prepare.
    	}
};
//Use this target for the Picasso.into() method

Picasso.get().load("https://i.imgur.com/DvpvklR.png").into(target);
			

Image Blur Backdrop Offset

app_preview_offset

Documentation

Name Format Default Details
app:v_imageSrc reference image sets image to the ImageView
app:v_imageRound dimension 10dp sets border radius to the ImageView
app:v_shadowOffset dimension 40dp configure the distance between the Image and the Shadow

GitHub

https://github.com/virtualvivek/BlurShadowImageView