some colors and correct clipping
This commit is contained in:
parent
b22c82de00
commit
c6dd2c633b
2 changed files with 7 additions and 3 deletions
|
|
@ -15,7 +15,6 @@ import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.navigation.compose.NavHost
|
import androidx.navigation.compose.NavHost
|
||||||
|
|
@ -78,7 +77,7 @@ private fun MainContent() {
|
||||||
private fun EmergencyButton() {
|
private fun EmergencyButton() {
|
||||||
FloatingActionButton(
|
FloatingActionButton(
|
||||||
onClick = {},
|
onClick = {},
|
||||||
containerColor = Color.Red
|
containerColor = MaterialTheme.colorScheme.error
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.Emergency,
|
imageVector = Icons.Filled.Emergency,
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalConfiguration
|
import androidx.compose.ui.platform.LocalConfiguration
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
|
@ -84,6 +85,7 @@ private fun TopCalendar() {
|
||||||
Row {
|
Row {
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
.clip(CircleShape)
|
||||||
.clickable(onClick = {
|
.clickable(onClick = {
|
||||||
currentDateMut.value = currentDateMut.value.minusMonths(1)
|
currentDateMut.value = currentDateMut.value.minusMonths(1)
|
||||||
})
|
})
|
||||||
|
|
@ -94,6 +96,7 @@ private fun TopCalendar() {
|
||||||
|
|
||||||
Icon(
|
Icon(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
.clip(CircleShape)
|
||||||
.clickable(onClick = {
|
.clickable(onClick = {
|
||||||
currentDateMut.value = currentDateMut.value.plusMonths(1)
|
currentDateMut.value = currentDateMut.value.plusMonths(1)
|
||||||
})
|
})
|
||||||
|
|
@ -153,8 +156,9 @@ fun CalendarDaysGrid(selectedDateMut: MutableState<LocalDate>, modifier: Modifie
|
||||||
days[index]?.let { day ->
|
days[index]?.let { day ->
|
||||||
|
|
||||||
var dayBoxModifier = Modifier
|
var dayBoxModifier = Modifier
|
||||||
.aspectRatio(1f)
|
|
||||||
.padding(4.dp)
|
.padding(4.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.aspectRatio(1f)
|
||||||
.clickable(onClick = {
|
.clickable(onClick = {
|
||||||
selectedDateMut.value = LocalDate.of(
|
selectedDateMut.value = LocalDate.of(
|
||||||
selectedDate.year,
|
selectedDate.year,
|
||||||
|
|
@ -162,6 +166,7 @@ fun CalendarDaysGrid(selectedDateMut: MutableState<LocalDate>, modifier: Modifie
|
||||||
day
|
day
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
.clip(CircleShape)
|
||||||
|
|
||||||
//add a mark to the currently selected day
|
//add a mark to the currently selected day
|
||||||
if (day == selectedDate.dayOfMonth) {
|
if (day == selectedDate.dayOfMonth) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue