public class BlurDrawable
extends android.graphics.drawable.Drawable
Modifier and Type | Field and Description |
---|---|
private android.graphics.Bitmap |
blurred |
private android.graphics.Paint |
paint |
private int |
radius |
private java.lang.ref.WeakReference<android.view.View> |
targetRef |
Constructor and Description |
---|
BlurDrawable(android.view.View target)
Instantiates a new Blur drawable.
|
BlurDrawable(android.view.View target,
int radius)
Instantiates a new Blur drawable.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(android.graphics.Canvas canvas) |
private static android.graphics.Bitmap |
fastBlur(android.graphics.Bitmap sentBitmap,
int radius)
from https://stackoverflow.com/a/10028267/3133545
Stack Blur v1.0 from
http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html
Java Author: Mario Klingemann
|
int |
getOpacity() |
int |
getRadius()
Gets radius.
|
void |
setAlpha(int alpha) |
void |
setColorFilter(android.graphics.ColorFilter cf) |
void |
setRadius(int radius)
Set the bluring radius that will be applied to target view's bitmap
|
applyTheme, canApplyTheme, clearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getAlpha, getBounds, getCallback, getChangingConfigurations, getColorFilter, getConstantState, getCurrent, getDirtyBounds, getHotspotBounds, getIntrinsicHeight, getIntrinsicWidth, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getOutline, getPadding, getState, getTransparentRegion, inflate, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isStateful, isVisible, jumpToCurrentState, mutate, onBoundsChange, onLayoutDirectionChanged, onLevelChange, onStateChange, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setDither, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setTintList, setTintMode, setVisible, unscheduleSelf
private java.lang.ref.WeakReference<android.view.View> targetRef
private android.graphics.Bitmap blurred
private android.graphics.Paint paint
private int radius
public BlurDrawable(android.view.View target)
target
- the targetpublic BlurDrawable(android.view.View target, int radius)
target
- the targetradius
- the radiuspublic void draw(android.graphics.Canvas canvas)
draw
in class android.graphics.drawable.Drawable
public void setRadius(int radius)
radius
- should be 0-100public int getRadius()
public void setAlpha(int alpha)
setAlpha
in class android.graphics.drawable.Drawable
public void setColorFilter(android.graphics.ColorFilter cf)
setColorFilter
in class android.graphics.drawable.Drawable
public int getOpacity()
getOpacity
in class android.graphics.drawable.Drawable
private static android.graphics.Bitmap fastBlur(android.graphics.Bitmap sentBitmap, int radius)