This commit is contained in:
IsaykinEugene 2025-04-09 14:09:08 +03:00
parent ba493bfba1
commit d60d28827a
5 changed files with 122 additions and 57 deletions

View File

@ -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
)
}
}

View File

@ -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,

View File

@ -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)
}
}

1
gradlew.bat vendored
View File

@ -1,3 +1,4 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem