Clipped layout in android

62 Views Asked by At

Can you help me design Android layout as the mockup: enter image description here

Description:

  • Orange layout with rounded radius.
  • Green layout is cut off at bottom and overflow at top
  • Yellow layout in front of Green and cut off at rounded corner of Orange.

Please help me, I was crazy with this problem.

Thank you so much!

My Code here:

Clipped view

public class ClippedView extends FrameLayout {
public ClippedView(Context context) {
    super(context);
}

public ClippedView(Context context, AttributeSet attrs) {
    super(context, attrs);
}

public ClippedView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
}

@Override
protected void onDraw(Canvas canvas) {
    Path clipPath = new Path();
    clipPath.addRoundRect(new RectF(canvas.getClipBounds()), 120, 120, Path.Direction.CW);
    canvas.clipPath(clipPath);
    super.onDraw(canvas);
}

}

It's cut OK but Orange layout cut all side. I want cut children only at bottom

0

There are 0 best solutions below