为什么 JetpackCompose Material 主题形状是关于边缘圆度的?

Why JetpackCompose Material Theme shape is about the edge roundedness?

在 Jetpack Compose 中,我们可以轻松定义 Material 颜色、排版和形状的主题。 令我困惑的是形状。

默认形状是

val Shapes = Shapes(
    small = RoundedCornerShape(4.dp),
    medium = RoundedCornerShape(4.dp),
    large = RoundedCornerShape(0.dp)
)

为什么形状的大小与圆角半径有关? (例如,越小的形状越圆?)。背后有什么道理

在 Material 设计中,所有组件都根据其大小分组到形状类别中。
Shape categories include:

  • 小组件
  • 中等成分
  • 大组件

对于它们中的每一个,您都可以定义定义角和边角的形状类型,并且 curves.The 角由形状系列(例如 RoundedCorner)和形状大小(4.dp 例如)。 有一些内置形状,例如 RoundedCornerShape, CutCornerShape, CircleShape.

每个组件都归入一个类别。 为 more info 检查此 link。

例如在 Button 定义中您可以找到默认值:

shape: Shape = MaterialTheme.shapes.small