improved menu layout
This commit is contained in:
@@ -36,29 +36,20 @@ fun MenuScreen(modifier: Modifier = Modifier) {
|
|||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
verticalArrangement = Arrangement.Center
|
verticalArrangement = Arrangement.Center
|
||||||
) {
|
) {
|
||||||
// Button to trigger the dialog
|
MenuButton({ showDialog = true }, "Odhlásit se")
|
||||||
Button(
|
|
||||||
onClick = { showDialog = true },
|
|
||||||
colors = ButtonDefaults.buttonColors(
|
|
||||||
contentColor = Color.White,
|
|
||||||
containerColor = Color.Black
|
|
||||||
),
|
|
||||||
modifier = Modifier
|
|
||||||
.border(
|
|
||||||
width = 5.dp,
|
|
||||||
shape = RoundedCornerShape(roundedCornerDimen),
|
|
||||||
color = PastelYellow
|
|
||||||
)
|
|
||||||
.width(230.dp)
|
|
||||||
.height(80.dp)
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = "Odhlásit se",
|
|
||||||
fontSize = 23.sp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(100.dp))
|
Spacer(modifier = Modifier.height(80.dp))
|
||||||
|
|
||||||
|
MenuButton({ screenToShow.value = Screen.SignIn }, "Změnit přihlášení")
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(80.dp))
|
||||||
|
|
||||||
|
MenuButton({ isShowing.value = IsShowing.About }, "O aplikaci")
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(80.dp))
|
||||||
|
|
||||||
|
MenuButton({ isShowing.value = IsShowing.Settings }, "Nastavení")
|
||||||
|
}
|
||||||
|
|
||||||
// Dialog implementation
|
// Dialog implementation
|
||||||
if (showDialog) {
|
if (showDialog) {
|
||||||
@@ -114,10 +105,12 @@ fun MenuScreen(modifier: Modifier = Modifier) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Button(onClick = {
|
@Composable
|
||||||
screenToShow.value = Screen.SignIn
|
fun MenuButton(onClick: () -> Unit, text: String) {
|
||||||
},
|
Button(
|
||||||
|
onClick = onClick,
|
||||||
colors = ButtonDefaults.buttonColors(
|
colors = ButtonDefaults.buttonColors(
|
||||||
contentColor = Color.White,
|
contentColor = Color.White,
|
||||||
containerColor = Color.Black
|
containerColor = Color.Black
|
||||||
@@ -132,57 +125,8 @@ fun MenuScreen(modifier: Modifier = Modifier) {
|
|||||||
.height(80.dp)
|
.height(80.dp)
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "Změnit přihlášení",
|
text = text,
|
||||||
fontSize = 23.sp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(100.dp))
|
|
||||||
|
|
||||||
Button(onClick = {
|
|
||||||
isShowing.value = IsShowing.About
|
|
||||||
},
|
|
||||||
colors = ButtonDefaults.buttonColors(
|
|
||||||
contentColor = Color.White,
|
|
||||||
containerColor = Color.Black
|
|
||||||
),
|
|
||||||
modifier = Modifier
|
|
||||||
.border(
|
|
||||||
width = 5.dp,
|
|
||||||
shape = RoundedCornerShape(roundedCornerDimen),
|
|
||||||
color = PastelYellow
|
|
||||||
)
|
|
||||||
.width(230.dp)
|
|
||||||
.height(80.dp)
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = "O aplikaci",
|
|
||||||
fontSize = 23.sp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(100.dp))
|
|
||||||
|
|
||||||
Button(onClick = {
|
|
||||||
isShowing.value = IsShowing.Settings
|
|
||||||
},
|
|
||||||
colors = ButtonDefaults.buttonColors(
|
|
||||||
contentColor = Color.White,
|
|
||||||
containerColor = Color.Black
|
|
||||||
),
|
|
||||||
modifier = Modifier
|
|
||||||
.border(
|
|
||||||
width = 5.dp,
|
|
||||||
shape = RoundedCornerShape(roundedCornerDimen),
|
|
||||||
color = PastelYellow
|
|
||||||
)
|
|
||||||
.width(230.dp)
|
|
||||||
.height(80.dp)
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = "Nastavení",
|
|
||||||
fontSize = 23.sp
|
fontSize = 23.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user