Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class CustomShadowBackground extends Drawable {
private int mOffsetY;

@Nullable
private RectF mRectF;
private RectF mRectF = new RectF();
@Nullable
private Paint mPaint;

Expand All @@ -62,11 +62,9 @@ protected CustomShadowBackground(@ColorInt int color, @Nullable int[] colorArray

@Override
public void draw(@NonNull Canvas canvas) {
if (mRectF == null) {
Rect bounds = getBounds();
mRectF = new RectF(bounds.left + mShadowRadius - mOffsetX, bounds.top + mShadowRadius - mOffsetY, bounds.right - mShadowRadius - mOffsetX,
bounds.bottom - mShadowRadius - mOffsetY);
}
Rect bounds = getBounds();
mRectF.set(bounds.left + mShadowRadius - mOffsetX, bounds.top + mShadowRadius - mOffsetY, bounds.right - mShadowRadius - mOffsetX,
bounds.bottom - mShadowRadius - mOffsetY);

if (mPaint == null) {
initPaint();
Expand Down