@@ -52,7 +52,10 @@ private void prepareLayout() {
52
52
parent .removeView (contentView );
53
53
54
54
shadowLayout = new RelativeLayout (context );
55
- shadowLayout .setLayoutParams (contentView .getLayoutParams ());
55
+ ViewGroup .LayoutParams contentViewLp = contentView .getLayoutParams ();
56
+ contentViewLp .width = contentView .getWidth ();
57
+ contentViewLp .height = contentView .getHeight ();
58
+ shadowLayout .setLayoutParams (contentViewLp );
56
59
parent .addView (shadowLayout , orignalIndex );
57
60
shadowLayout .addView (contentView , getContentViewLayoutParams ());
58
61
}
@@ -155,6 +158,9 @@ private void decorateLeft(EdgeShadowView.Builder edgeShadowBuilder) {
155
158
leftRlp .addRule (RelativeLayout .ALIGN_PARENT_BOTTOM );
156
159
}
157
160
}
161
+
162
+ if (shadowSize <= 0 ) return ;
163
+
158
164
EdgeShadowView leftEdgeShadow = edgeShadowBuilder
159
165
.setShadowSize (shadowSize )
160
166
.setDirection (CrazyShadowDirection .LEFT )
@@ -178,6 +184,9 @@ private void decorateTop(EdgeShadowView.Builder edgeShadowBuilder) {
178
184
topRlp .addRule (RelativeLayout .ALIGN_PARENT_RIGHT );
179
185
}
180
186
}
187
+
188
+ if (shadowSize <= 0 ) return ;
189
+
181
190
EdgeShadowView topEdgeShadow = edgeShadowBuilder
182
191
.setShadowSize (shadowSize )
183
192
.setDirection (CrazyShadowDirection .TOP )
@@ -201,6 +210,9 @@ private void decorateRight(EdgeShadowView.Builder edgeShadowBuilder) {
201
210
rightRlp .addRule (RelativeLayout .ALIGN_PARENT_BOTTOM );
202
211
}
203
212
}
213
+
214
+ if (shadowSize <= 0 ) return ;
215
+
204
216
EdgeShadowView rightEdgeShadow = edgeShadowBuilder
205
217
.setShadowSize (shadowSize )
206
218
.setDirection (CrazyShadowDirection .RIGHT )
@@ -224,6 +236,9 @@ private void decorateBottom(EdgeShadowView.Builder edgeShadowBuilder) {
224
236
bottomRlp .addRule (RelativeLayout .ALIGN_PARENT_RIGHT );
225
237
}
226
238
}
239
+
240
+ if (shadowSize <= 0 ) return ;
241
+
227
242
EdgeShadowView bottomEdgeShadow = edgeShadowBuilder
228
243
.setShadowSize (shadowSize )
229
244
.setDirection (CrazyShadowDirection .BOTTOM )
0 commit comments