[go: nahoru, domu]

blob: 865b912f1f39aae94e84fd7306c2f8aa09c8b9e7 [file] [log] [blame]
Matvei Malkovd08b02d2020-01-22 18:23:49 +00001/*
2 * Copyright 2020 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
Louis Pullen-Freilichddda7be2020-07-17 18:28:12 +010017package androidx.compose.foundation.samples
Matvei Malkovd08b02d2020-01-22 18:23:49 +000018
19import androidx.annotation.Sampled
20import androidx.compose.Composable
Adam Powell999a89b2020-03-11 09:08:07 -070021import androidx.ui.core.Modifier
Louis Pullen-Freilichddda7be2020-07-17 18:28:12 +010022import androidx.compose.foundation.Border
23import androidx.compose.foundation.Box
24import androidx.compose.foundation.ContentGravity
25import androidx.compose.foundation.Text
26import androidx.compose.foundation.shape.corner.CircleShape
Matvei Malkovd08b02d2020-01-22 18:23:49 +000027import androidx.ui.graphics.Color
Louis Pullen-Freilich623e4052020-07-19 20:24:03 +010028import androidx.compose.foundation.layout.preferredSize
Matvei Malkovd08b02d2020-01-22 18:23:49 +000029import androidx.ui.unit.dp
30
31@Sampled
32@Composable
33fun SimpleCircleBox() {
34 Box(
Adam Powell999a89b2020-03-11 09:08:07 -070035 modifier = Modifier.preferredSize(100.dp),
Matvei Malkovd08b02d2020-01-22 18:23:49 +000036 backgroundColor = Color.Cyan,
37 border = Border(10.dp, Color.Red),
38 shape = CircleShape,
39 gravity = ContentGravity.Center
40 ) {
41 Text("I'm box")
42 }
43}