{"repo":"Kyant0/Capsule","free":true,"listed":false,"github":"https://github.com/Kyant0/Capsule","clone":"git clone https://github.com/Kyant0/Capsule.git","description":"Jetpack Compose smooth corners","language":"Kotlin","stars":184,"topics":["jetpack-compose"],"license":"Apache-2.0","category":"mobile-apps","readme_excerpt":"Capsule Capsule is a Jetpack Compose library that creates G2 continuous rounded rectangles. Customizable curvature combs: Playground app Installation In build.gradle.kts, add Usages Replace the RoundedCornerShape with ContinuousRoundedRectangle or ContinuousCapsule : Custom continuity: The following parameters are supported by G2ContinuityProfile : - extended fraction: the transition length between original corner and line, relative to the corner radius - arc fraction: the ratio of the arc to the corner - Bezier curvature scale : the multiplier of the end curvature of the Bezier curve - arc curvature scale : the multiplier of the arc curvature Note: It guarantees G1 continuity at least. Only if the Bezier curvature scale equals the arc curvature scale, it will have exact G2 continuity. Tips Performance Drawing cubic Bézier curves on Android performs poorly. However, the Capsule library uses a very efficient method to calculate the control points, achieving optimal theoretical performance. When the shape area is large (almost fullscreen) and the corner radius is constantly changing, performance may decrease. Use animatedShape.copy(continuity = G1Continuity) to temporarily disable corner smoothing during the animation.","default_branch":null,"files":null,"tree":[],"storefront":"/r/Kyant0","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Kyant0/Capsule/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}