[go: nahoru, domu]

blob: 07447c6bcd3638efbf75318c8eca52f600509d27 [file] [log] [blame]
Andrey Kulikov6e28e972020-03-25 12:31:24 +00001/*
2 * Copyright 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package androidx.ui.material
18
19import androidx.compose.staticAmbientOf
Louis Pullen-Freilichddda7be2020-07-17 18:28:12 +010020import androidx.compose.foundation.shape.corner.CornerBasedShape
21import androidx.compose.foundation.shape.corner.RoundedCornerShape
Louis Pullen-Freilicha7eeb102020-07-22 17:54:24 +010022import androidx.compose.ui.unit.dp
Andrey Kulikov6e28e972020-03-25 12:31:24 +000023
24/**
25 * Components are grouped into shape categories based on their size. These categories provide a
26 * way to change multiple component values at once, by changing the category’s values.
27 * Shape categories include:
28 * - Small components
29 * - Medium components
30 * - Large components
31 *
32 * See [Material shape specification](https://material.io/design/shape/applying-shape-to-ui
33 * .html#)
34 */
35data class Shapes(
36 /**
37 * Shape used by small components like [Button] or [Snackbar]. Components like
38 * [FloatingActionButton], [ExtendedFloatingActionButton] use this shape, but override
39 * the corner size to be 50%.
40 */
41 val small: CornerBasedShape = RoundedCornerShape(4.dp),
42 /**
43 * Shape used by medium components like [Card] or [AlertDialog].
44 */
45 val medium: CornerBasedShape = RoundedCornerShape(4.dp),
46 /**
Matvei Malkov9f27abf2020-05-19 15:15:56 +010047 * Shape used by large components like [ModalDrawerLayout] or [BottomDrawerLayout].
Andrey Kulikov6e28e972020-03-25 12:31:24 +000048 */
49 val large: CornerBasedShape = RoundedCornerShape(0.dp)
50)
51
52/**
53 * Ambient used to specify the default shapes for the surfaces.
54 */
55internal val ShapesAmbient = staticAmbientOf { Shapes() }