Provide the ability in Compose Multiplatform to create ContinuousRoundedCornerShape, which is a smooth rounded corner.
compose-continuous-rounded-shape |
CMP | Kotlin |
---|---|---|
1.0.5 | 1.8.2 | 2.2.10 |
1.0.4 | 1.8.2 | 2.2.0 |
1.0.3 | 1.8.2 | 2.2.0 |
1.0.2 | 1.8.2 | 2.2.0 |
1.0.1 | 1.8.1 | 2.1.21 |
implementation("com.adamglin:compose-continuous-rounded-corner-shape:$version")
compose-continuous-rounded-corner-shape
supports these platforms:
- Android
- iOS
- Desktop (JVM)
- JS/Wasm (Support from 1.0.4)
wasm sample https://adamglin0.github.io/compose-continuous-rounded-corner-shape/sample/
Important
Before v1.0.4, you can still use ContinuousRoundedCornerShape in commonMain, but the smooth parameter on the JS/Wasm side will be ignored.
The RoundedCornerShape has consistent parameters, with an additional smooth parameter, which supports values from 0f to 1f, with a default value of 0.6f, which is the default value in Apple's design system.
ContinuousRoundedCornerShape(50.dp, smooth = 1f)
smooth support from 0f to 1f, the design of ios is 0.6f.
e.g.
Box(
modifier = Modifier
.padding(20.dp)
.size(300.dp)
.clip(ContinuousRoundedCornerShape(50.dp, smooth = 1f))
.background(Color.Red)
)