Last active
January 21, 2021 19:13
-
-
Save akexorcist/fc8f154d19aada4955a8c064aaa948a5 to your computer and use it in GitHub Desktop.
Build Coupon UI - Setup path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CouponLayout : FrameLayout { | |
/* ... */ | |
private fun setupPath() { | |
path.apply { | |
reset() | |
moveTo(/* Start point */) | |
topRightCorner (areaWidth, areaHeight, borderWidth, cornerRadius) | |
rightSemiCircle (areaWidth, areaHeight, borderWidth, semiCircleRadius) | |
bottomRightCorner (areaWidth, areaHeight, borderWidth, cornerRadius) | |
bottomSemiCircle (areaWidth, areaHeight, borderWidth, semiCircleRadius) | |
bottomLeftCorner (areaWidth, areaHeight, borderWidth, cornerRadius) | |
leftSemiCircle (areaWidth, areaHeight, borderWidth, semiCircleRadius) | |
topLeftCorner (areaWidth, areaHeight, borderWidth, cornerRadius) | |
topSemiCircle (areaWidth, areaHeight, borderWidth, semiCircleRadius) | |
close() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment