diff --git a/composeApp/src/commonMain/composeResources/font/comic_sans_ms.ttf b/composeApp/src/commonMain/composeResources/font/comic_sans_ms.ttf new file mode 100644 index 0000000..d17e1be Binary files /dev/null and b/composeApp/src/commonMain/composeResources/font/comic_sans_ms.ttf differ diff --git a/composeApp/src/commonMain/kotlin/org/example/shoesapptest/common/buttonMarathon.kt b/composeApp/src/commonMain/kotlin/org/example/shoesapptest/common/buttonMarathon.kt new file mode 100644 index 0000000..329c453 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/org/example/shoesapptest/common/buttonMarathon.kt @@ -0,0 +1,43 @@ +package org.example.shoesapptest.common + +import androidx.compose.foundation.BorderStroke +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.platform.Font +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp + +@Composable +fun buttonMarathon(text: String, + fontStyle: FontStyle){ + Button( + modifier = Modifier.width(400.dp) + .height(100.dp) + .padding(10.dp), + shape = RoundedCornerShape(15.dp), + border = BorderStroke(2.dp, Color.LightGray), + colors = ButtonDefaults.buttonColors( + contentColor = Color.Black, + backgroundColor = Color(242, 242, 242) + ), + onClick = {} + ) { + Text( + text = text, + fontSize = 18.sp, + fontStyle = fontStyle + ) + } +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/org/example/shoesapptest/App.kt b/composeApp/src/commonMain/kotlin/org/example/shoesapptest/firstScreen.kt similarity index 54% rename from composeApp/src/commonMain/kotlin/org/example/shoesapptest/App.kt rename to composeApp/src/commonMain/kotlin/org/example/shoesapptest/firstScreen.kt index 1c06a4c..26ec567 100644 --- a/composeApp/src/commonMain/kotlin/org/example/shoesapptest/App.kt +++ b/composeApp/src/commonMain/kotlin/org/example/shoesapptest/firstScreen.kt @@ -1,18 +1,13 @@ package org.example.shoesapptest -import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.BorderStroke -import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button @@ -27,18 +22,11 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import org.jetbrains.compose.resources.painterResource -import org.jetbrains.compose.ui.tooling.preview.Preview - -import kotlinproject.composeapp.generated.resources.Res -import kotlinproject.composeapp.generated.resources._collectCommonMainDrawable0Resources -import kotlinproject.composeapp.generated.resources.compose_multiplatform +import org.example.shoesapptest.common.buttonMarathon @Composable -@Preview fun App() { MaterialTheme { Scaffold( @@ -52,53 +40,18 @@ fun App() { verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally ){ - Button( - modifier = Modifier.weight(1f).width(400.dp), - shape = RoundedCornerShape(15.dp), - border = BorderStroke(2.dp, Color.LightGray), - colors = ButtonDefaults.buttonColors( - contentColor = Color.Black, - backgroundColor = Color(242,242,242) - ), - onClick = {} - ){ - Text("Я хочу стать бегуном", fontSize = 18.sp, fontFamily=FontFamily.Monospace) - } - Spacer(modifier = Modifier.weight(0.1f)) - Button( - modifier = Modifier.weight(1f).width(400.dp), - shape = RoundedCornerShape(15.dp), - border = BorderStroke(2.dp, Color.LightGray), - onClick = {}, - colors = ButtonDefaults.buttonColors( - contentColor = Color.Black, - backgroundColor = Color(242,242,242) - ), - ){ - Text("Я хочу стать спонсором бегуна", fontSize = 18.sp, fontFamily=FontFamily.Monospace) - } - Spacer(modifier = Modifier.weight(0.1f)) - Button( - modifier = Modifier.weight(1f).width(400.dp), - shape = RoundedCornerShape(15.dp), - border = BorderStroke(2.dp, Color.LightGray), - colors = ButtonDefaults.buttonColors( - contentColor = Color.Black, - backgroundColor = Color(242,242,242) - ), - onClick = {} - ){ - Text("Я хочу узнать больше о событии", fontSize = 18.sp, fontFamily=FontFamily.Monospace) - } + buttonMarathon("Я хочу стать бегуном", FontStyle.Normal) + buttonMarathon("Я хочу стать спонсором бегуна", FontStyle.Normal) + buttonMarathon("Я хочу узнать больше о событии", FontStyle.Normal) MarathonEnd() - - } } } } + + @Composable fun MarathonTopBar(){ Column( @@ -131,12 +84,13 @@ fun MarathonBottomBar(){ @Composable fun MarathonEnd(){ - Row( - horizontalArrangement = Arrangement.End + Column( + horizontalAlignment = Alignment.End, + modifier = Modifier.fillMaxWidth() ) { Button( - modifier = Modifier.weight(1f).width(100.dp).height(70.dp), - shape = RoundedCornerShape(15.dp), + modifier = Modifier.width(100.dp).height(100.dp), + shape = RoundedCornerShape(10.dp), border = BorderStroke(2.dp, Color.LightGray), colors = ButtonDefaults.buttonColors( contentColor = Color.Black, diff --git a/composeApp/src/commonMain/kotlin/org/example/shoesapptest/secondScreen.kt b/composeApp/src/commonMain/kotlin/org/example/shoesapptest/secondScreen.kt new file mode 100644 index 0000000..35b6551 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/org/example/shoesapptest/secondScreen.kt @@ -0,0 +1,67 @@ +package org.example.shoesapptest + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Button +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Scaffold +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import org.example.shoesapptest.common.buttonMarathon + +@Composable +fun secondScreen(){ + MaterialTheme{ + Scaffold( + topBar = { topBarOnSecondScreen() }, + bottomBar = {bottomBarOnSecondScreen()} + ) { paddingValues -> Column( + modifier = Modifier + .padding(paddingValues) + .fillMaxSize() + .padding(30.dp), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + buttonMarathon("Я учавствовал ранее", FontStyle.Italic) + } + + + } + } +} + +@Composable +fun topBarOnSecondScreen(){ + Row( + modifier = Modifier.fillMaxWidth().background(Color.DarkGray).padding(20.dp)) + { + Button(onClick = {} ){ + Text("Назад") + + } + Text(text=" MARATHON SKILLS 2016", color = Color.White, fontSize = 35.sp) + } +} + +@Composable +fun bottomBarOnSecondScreen(){ + Column( + modifier = Modifier.fillMaxWidth().background(Color.DarkGray), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ){ + Text(text="18 дней 9 часов и 17 минут до старта марафона!", color = Color.White) + } +} \ No newline at end of file diff --git a/gradlew.bat b/gradlew.bat index 9d21a21..8ef77b6 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,4 @@ + @rem @rem Copyright 2015 the original author or authors. @rem