Advertisement
Artyom_Kopan

view/StartGame.kt

May 30th, 2022
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 1.38 KB | None | 0 0
  1. package view
  2.  
  3. import androidx.compose.foundation.layout.Box
  4. import androidx.compose.foundation.layout.Column
  5. import androidx.compose.foundation.layout.fillMaxHeight
  6. import androidx.compose.foundation.layout.fillMaxWidth
  7. import androidx.compose.foundation.layout.height
  8. import androidx.compose.foundation.layout.padding
  9. import androidx.compose.foundation.layout.width
  10. import androidx.compose.material.Button
  11. import androidx.compose.material.ButtonDefaults
  12. import androidx.compose.material.Text
  13. import androidx.compose.runtime.Composable
  14. import androidx.compose.ui.Alignment
  15. import androidx.compose.ui.Modifier
  16. import androidx.compose.ui.graphics.Color
  17. import androidx.compose.ui.text.style.TextAlign
  18. import androidx.compose.ui.unit.dp
  19. import androidx.compose.ui.unit.sp
  20.  
  21. @Composable
  22. fun StartGame(onClick: () -> Unit) = Column(modifier = Modifier.fillMaxWidth()) {
  23.     Box(
  24.         modifier = Modifier.fillMaxWidth().fillMaxHeight(), contentAlignment = Alignment.Center
  25.     ) {
  26.         Button(
  27.             onClick,
  28.             modifier = Modifier.width(300.dp).height(180.dp),
  29.             colors = ButtonDefaults.buttonColors(backgroundColor = Color.Blue)
  30.         ) {
  31.             Text(
  32.                 "Начать игру",
  33.                 fontSize = 35.sp,
  34.                 textAlign = TextAlign.Center,
  35.                 color = Color.White
  36.             )
  37.         }
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement