From ac157f9edd088bcf4377dd8bf1e0a467827a015a Mon Sep 17 00:00:00 2001 From: Nstd Date: Mon, 7 Jun 2021 17:12:46 +0800 Subject: [PATCH 1/2] bugfix: view size changed but drawable size not changed --- .../cn/davidsu/library/CustomShadowBackground.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/library/src/main/java/cn/davidsu/library/CustomShadowBackground.java b/library/src/main/java/cn/davidsu/library/CustomShadowBackground.java index 59cf225..7aed765 100644 --- a/library/src/main/java/cn/davidsu/library/CustomShadowBackground.java +++ b/library/src/main/java/cn/davidsu/library/CustomShadowBackground.java @@ -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; @@ -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(); From eec68575ce6275d858fc49fa1aa40d59af54aa0f Mon Sep 17 00:00:00 2001 From: Nstd Date: Mon, 7 Jun 2021 17:13:35 +0800 Subject: [PATCH 2/2] update version to 1.1 --- library/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 1be59f8..50ddc0b 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -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"