Compare commits

..

6 Commits

Author SHA1 Message Date
50556dec31 Update button styling
All checks were successful
Build / build (push) Successful in 4m43s
2025-05-29 14:09:24 +02:00
a08e4a9355 Add readme info
All checks were successful
Build / build (push) Successful in 5m17s
2025-05-29 13:28:08 +02:00
e9f6e2c7a3 Fix BASE_URL
Some checks failed
Build / build (push) Has been cancelled
2025-05-29 13:24:42 +02:00
373c5be7fc Enable pipeline for all branches
Some checks failed
Build / build (push) Has been cancelled
2025-05-29 13:21:26 +02:00
8a055b7fcb Update changelog 2025-05-29 13:20:01 +02:00
bf500596fb Add profile selection dialog 2025-05-29 13:15:24 +02:00
2 changed files with 33 additions and 47 deletions

View File

@ -18,7 +18,6 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.Build import androidx.compose.material.icons.filled.Build
import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.Delete import androidx.compose.material.icons.filled.Delete
@ -26,7 +25,6 @@ import androidx.compose.material.icons.filled.Done
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button import androidx.compose.material3.Button
import androidx.compose.material3.Card import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
@ -264,29 +262,10 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
) )
} }
Column(modifier = Modifier.fillMaxWidth()) { Row(verticalAlignment = Alignment.CenterVertically) {
if (enabledRideProfiles.isEmpty()) { Switch(checked = isActive, onCheckedChange = { isActive = it})
Text("Enabled for all profiles") Spacer(modifier = Modifier.width(10.dp))
} else { Text("Is Active")
Text("Enabled for profiles:")
enabledRideProfiles.forEach { profileName ->
Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 4.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(profileName)
FilledTonalButton(onClick = {
enabledRideProfiles = enabledRideProfiles.toMutableSet().apply { remove(profileName) }
}) {
Icon(Icons.Default.Delete, contentDescription = "Delete profile")
}
}
}
}
} }
FilledTonalButton(modifier = Modifier FilledTonalButton(modifier = Modifier
@ -294,15 +273,9 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
.height(60.dp), onClick = { .height(60.dp), onClick = {
rideProfileDialogVisible = true rideProfileDialogVisible = true
}) { }) {
Icon(Icons.Default.Build, contentDescription = "Change Profiles", modifier = Modifier.size(20.dp)) Icon(Icons.Default.Build, contentDescription = "Change Ride Profiles", modifier = Modifier.size(20.dp))
Spacer(modifier = Modifier.width(5.dp)) Spacer(modifier = Modifier.width(5.dp))
Text("Limit to Profile") Text("Ride Profiles: ${if (enabledRideProfiles.isEmpty()) "All" else enabledRideProfiles.joinToString(", ")}")
}
Row(verticalAlignment = Alignment.CenterVertically) {
Switch(checked = isActive, onCheckedChange = { isActive = it})
Spacer(modifier = Modifier.width(10.dp))
Text("Is Active")
} }
FilledTonalButton(modifier = Modifier FilledTonalButton(modifier = Modifier
@ -358,7 +331,6 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
.fillMaxWidth() .fillMaxWidth()
.padding(10.dp), .padding(10.dp),
shape = RoundedCornerShape(10.dp), shape = RoundedCornerShape(10.dp),
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
) { ) {
Column( Column(
modifier = Modifier modifier = Modifier
@ -367,6 +339,28 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(10.dp) verticalArrangement = Arrangement.spacedBy(10.dp)
) { ) {
if (enabledRideProfiles.isEmpty()) {
Text("All profiles enabled")
} else {
Column(modifier = Modifier.fillMaxWidth()) {
enabledRideProfiles.forEach { profileName ->
Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 4.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(profileName)
FilledTonalButton(onClick = {
enabledRideProfiles = enabledRideProfiles.toMutableSet().apply { remove(profileName) }
}) {
Icon(Icons.Default.Delete, contentDescription = "Delete profile")
}
}
}
}
}
OutlinedTextField( OutlinedTextField(
value = newProfileName, value = newProfileName,
@ -379,23 +373,18 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
onClick = { onClick = {
if (newProfileName.isNotBlank()) { if (newProfileName.isNotBlank()) {
enabledRideProfiles = enabledRideProfiles.toMutableSet().apply { add(newProfileName) } enabledRideProfiles = enabledRideProfiles.toMutableSet().apply { add(newProfileName) }
newProfileName = "" newProfileName = "" // Clear the text field
rideProfileDialogVisible = false
} }
}, },
modifier = Modifier.fillMaxWidth().height(60.dp) modifier = Modifier.fillMaxWidth()
) { ) {
Icon(Icons.Default.Add, contentDescription = "Add Profile")
Spacer(modifier = Modifier.width(5.dp))
Text("Add Profile") Text("Add Profile")
} }
FilledTonalButton( FilledTonalButton(
onClick = { rideProfileDialogVisible = false }, onClick = { rideProfileDialogVisible = false },
modifier = Modifier.fillMaxWidth().height(60.dp) modifier = Modifier.fillMaxWidth()
) { ) {
Icon(Icons.Default.Close, contentDescription = "Cancel Editing")
Spacer(modifier = Modifier.width(5.dp))
Text("Close") Text("Close")
} }
} }
@ -410,7 +399,6 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
.fillMaxWidth() .fillMaxWidth()
.padding(10.dp), .padding(10.dp),
shape = RoundedCornerShape(10.dp), shape = RoundedCornerShape(10.dp),
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
) { ) {
Column(modifier = Modifier Column(modifier = Modifier
.padding(5.dp) .padding(5.dp)
@ -455,7 +443,6 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
.fillMaxWidth() .fillMaxWidth()
.padding(10.dp), .padding(10.dp),
shape = RoundedCornerShape(10.dp), shape = RoundedCornerShape(10.dp),
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
) { ) {
Column(modifier = Modifier Column(modifier = Modifier
.padding(5.dp) .padding(5.dp)
@ -491,7 +478,6 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
.fillMaxWidth() .fillMaxWidth()
.padding(10.dp), .padding(10.dp),
shape = RoundedCornerShape(10.dp), shape = RoundedCornerShape(10.dp),
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
) { ) {
Column(modifier = Modifier Column(modifier = Modifier
.padding(5.dp) .padding(5.dp)

View File

@ -254,4 +254,4 @@ fun MainScreen(reminders: MutableList<Reminder>, onNavigateToReminder: (r: Remin
} }
} }
) )
} }