Skip to content

Commit

Permalink
Fixed wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Hitomis committed Nov 11, 2016
1 parent cbf91c6 commit 9c800bb
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ private void prepareLayout() {
parent.removeView(contentView);

shadowLayout = new RelativeLayout(context);
shadowLayout.setLayoutParams(contentView.getLayoutParams());
ViewGroup.LayoutParams contentViewLp = contentView.getLayoutParams();
contentViewLp.width = contentView.getWidth();
contentViewLp.height = contentView.getHeight();
shadowLayout.setLayoutParams(contentViewLp);
parent.addView(shadowLayout, orignalIndex);
shadowLayout.addView(contentView, getContentViewLayoutParams());
}
Expand Down Expand Up @@ -155,6 +158,9 @@ private void decorateLeft(EdgeShadowView.Builder edgeShadowBuilder) {
leftRlp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
}
}

if (shadowSize <= 0) return ;

EdgeShadowView leftEdgeShadow = edgeShadowBuilder
.setShadowSize(shadowSize)
.setDirection(CrazyShadowDirection.LEFT)
Expand All @@ -178,6 +184,9 @@ private void decorateTop(EdgeShadowView.Builder edgeShadowBuilder) {
topRlp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
}
}

if (shadowSize <= 0) return ;

EdgeShadowView topEdgeShadow = edgeShadowBuilder
.setShadowSize(shadowSize)
.setDirection(CrazyShadowDirection.TOP)
Expand All @@ -201,6 +210,9 @@ private void decorateRight(EdgeShadowView.Builder edgeShadowBuilder) {
rightRlp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
}
}

if (shadowSize <= 0) return ;

EdgeShadowView rightEdgeShadow = edgeShadowBuilder
.setShadowSize(shadowSize)
.setDirection(CrazyShadowDirection.RIGHT)
Expand All @@ -224,6 +236,9 @@ private void decorateBottom(EdgeShadowView.Builder edgeShadowBuilder) {
bottomRlp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
}
}

if (shadowSize <= 0) return ;

EdgeShadowView bottomEdgeShadow = edgeShadowBuilder
.setShadowSize(shadowSize)
.setDirection(CrazyShadowDirection.BOTTOM)
Expand Down

0 comments on commit 9c800bb

Please sign in to comment.