A bit wasteful but first draw a rounded rectangle with all 4 corners rounded, then draw second, regular rectangle radius
height below to draw over the bottom rounded corners
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
float radius = 20f;
@Override
public void onDraw(Canvas canvas) {
// Draw the top part that has rounded corners with twice the height of the radius
canvas.drawRoundRect(0f, 0f, 100f, 2 * radius, radius, radius, paint);
// Draw the bottom part, partly on top of the top part
canvas.drawRect(0f, radius, 100f, 100f, paint);
}
A tiny bit of math needed to account for the desired height but shouldn't be that hard :)