Last active
February 1, 2021 03:50
-
-
Save akexorcist/cd700a625254ec9d177dfc729badaaf8 to your computer and use it in GitHub Desktop.
Build Coupon UI - All formulas (https://medium.com/@akexorcist/how-we-built-developer-friendly-coupon-ui-in-android-part-2-78933730d335)
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
### Start point | |
x = area_width - (corner_radius + (border_width / 2)) | |
y = border_width / 2 | |
### Top right corner | |
x1 = area_width - ((corner_radius * 2) + (border_width / 2)) | |
y1 = border_width / 2 | |
x2 = area_width - (border_width / 2) | |
y2 = (corner_radius * 2) + (border_width / 2) | |
start_angle = 270 | |
sweep_angle = 90 | |
### Right edge semi circle | |
x1 = area_width - ((semi_circle_radius / 2) + (border_width / 2)) | |
y1 = (area_height / 2) - (semi_circle_radius / 2) | |
x2 = area_width + ((semi_circle_radius / 2) - (border_width / 2)) | |
y2 = (area_height / 2) + (semi_circle_radius / 2) | |
start_angle = 270 | |
sweep_angle = -180 | |
### Bottom right corner | |
x1 = area_width - ((corner_radius * 2) + (border_width / 2)) | |
y1 = area_height - ((corner_radius * 2) + (border_width / 2)) | |
x2 = area_width - (border_width / 2) | |
y2 = area_height - (botder_width / 2) | |
start_angle = 0 | |
sweep_angle = 90 | |
### Bottom edge semi circle | |
x1 = (area_width / 2) - (semi_circle_radius / 2) | |
y1 = area_height - ((semi_circle_radius / 2) + (border_width / 2)) | |
x2 = (area_width / 2) + (semi_circle_radius / 2) | |
y2 = area_height + ((semi_circle_radius / 2) - (border_width / 2)) | |
start_angle = 0 | |
sweep_angle = -180 | |
### Bottom left corner | |
x1 = border_width / 2 | |
y1 = area_height - ((corner_radius * 2) + (border_width / 2)) | |
x2 = (corner_radius * 2) + (border_width / 2) | |
y2 = area_height - (botder_width / 2) | |
start_angle = 90 | |
sweep_angle = 90 | |
### Left edge semi circle | |
x1 = -(semi_circle_radius / 2) + (border_width / 2) | |
y1 = (area_height / 2) - (semi_circle_radius / 2) | |
x2 = (semi_circle_radius / 2) + (border_width / 2) | |
y2 = (area_height / 2) + (semi_circle_radius / 2) | |
start_angle = 90 | |
sweep_angle = -180 | |
### Top left corner | |
x1 = border_width / 2 | |
y1 = border_width / 2 | |
x2 = (corner_radius * 2) + (border_width / 2) | |
y2 = (corner_radius * 2) + (border_width / 2) | |
start_angle = 180 | |
sweep_angle = 90 | |
### Top edge semi circle | |
x1 = (area_width / 2) - (semi_circle_radius / 2) | |
y1 = -(semi_circle_radius / 2) + (border_width / 2) | |
x2 = (area_width / 2) + (semi_circle_radius / 2) | |
y2 = (semi_circle_radius / 2) + (border_width / 2) | |
start_angle = 180 | |
sweep_angle = -180 |
Top left corner
start_angle = 180 <--------------- top-left corner
sweep_angle = 90
@YobHumnoy Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Top left corner
start_angle = 180 <--------------- top-left corner
sweep_angle = 90