Advertisement
Artyom_Kopan

view/GameModeChoice.kt

May 30th, 2022
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 1.41 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.runtime.Composable
  11. import androidx.compose.material.Button
  12. import androidx.compose.material.Text
  13. import androidx.compose.ui.Alignment
  14. import androidx.compose.ui.Modifier
  15. import androidx.compose.ui.text.style.TextAlign
  16. import androidx.compose.ui.unit.dp
  17. import androidx.compose.ui.unit.sp
  18.  
  19. @Suppress("FunctionNaming")
  20. @Composable
  21. fun GameModeChoice(onClick1: () -> Unit, onClick2: () -> Unit) = Box(
  22.     modifier = Modifier.fillMaxWidth().fillMaxHeight(), contentAlignment = Alignment.Center
  23. ) {
  24.     Column(modifier = Modifier.width(600.dp).height(800.dp)) {
  25.         Button(
  26.             onClick = onClick1,
  27.             modifier = Modifier.fillMaxWidth()
  28.         ) {
  29.             Text("Одиночная игра", textAlign = TextAlign.Center, fontSize = 35.sp)
  30.         }
  31.  
  32.         Button(
  33.             onClick = onClick2,
  34.             modifier = Modifier.fillMaxWidth().padding(0.dp, 100.dp)
  35.         ) {
  36.             Text("Игра с ботом", textAlign = TextAlign.Center, fontSize = 35.sp)
  37.         }
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement