Andrey Kulikov | 6e28e97 | 2020-03-25 12:31:24 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package androidx.ui.material |
| 18 | |
| 19 | import androidx.compose.staticAmbientOf |
Louis Pullen-Freilich | ddda7be | 2020-07-17 18:28:12 +0100 | [diff] [blame] | 20 | import androidx.compose.foundation.shape.corner.CornerBasedShape |
| 21 | import androidx.compose.foundation.shape.corner.RoundedCornerShape |
Louis Pullen-Freilich | a7eeb10 | 2020-07-22 17:54:24 +0100 | [diff] [blame] | 22 | import androidx.compose.ui.unit.dp |
Andrey Kulikov | 6e28e97 | 2020-03-25 12:31:24 +0000 | [diff] [blame] | 23 | |
| 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 | */ |
| 35 | data 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 Malkov | 9f27abf | 2020-05-19 15:15:56 +0100 | [diff] [blame] | 47 | * Shape used by large components like [ModalDrawerLayout] or [BottomDrawerLayout]. |
Andrey Kulikov | 6e28e97 | 2020-03-25 12:31:24 +0000 | [diff] [blame] | 48 | */ |
| 49 | val large: CornerBasedShape = RoundedCornerShape(0.dp) |
| 50 | ) |
| 51 | |
| 52 | /** |
| 53 | * Ambient used to specify the default shapes for the surfaces. |
| 54 | */ |
| 55 | internal val ShapesAmbient = staticAmbientOf { Shapes() } |