Compare commits
6 Commits
master
...
1.3-beta-2
| Author | SHA1 | Date | |
|---|---|---|---|
| 50556dec31 | |||
| a08e4a9355 | |||
| e9f6e2c7a3 | |||
| 373c5be7fc | |||
| 8a055b7fcb | |||
| bf500596fb |
@ -18,7 +18,6 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
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.Close
|
||||
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.Button
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.FilledTonalButton
|
||||
import androidx.compose.material3.Icon
|
||||
@ -264,29 +262,10 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
|
||||
)
|
||||
}
|
||||
|
||||
Column(modifier = Modifier.fillMaxWidth()) {
|
||||
if (enabledRideProfiles.isEmpty()) {
|
||||
Text("Enabled for all profiles")
|
||||
} else {
|
||||
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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Switch(checked = isActive, onCheckedChange = { isActive = it})
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
Text("Is Active")
|
||||
}
|
||||
|
||||
FilledTonalButton(modifier = Modifier
|
||||
@ -294,15 +273,9 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
|
||||
.height(60.dp), onClick = {
|
||||
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))
|
||||
Text("Limit to Profile")
|
||||
}
|
||||
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Switch(checked = isActive, onCheckedChange = { isActive = it})
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
Text("Is Active")
|
||||
Text("Ride Profiles: ${if (enabledRideProfiles.isEmpty()) "All" else enabledRideProfiles.joinToString(", ")}")
|
||||
}
|
||||
|
||||
FilledTonalButton(modifier = Modifier
|
||||
@ -358,7 +331,6 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
|
||||
.fillMaxWidth()
|
||||
.padding(10.dp),
|
||||
shape = RoundedCornerShape(10.dp),
|
||||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
@ -367,6 +339,28 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
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(
|
||||
value = newProfileName,
|
||||
@ -379,23 +373,18 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
|
||||
onClick = {
|
||||
if (newProfileName.isNotBlank()) {
|
||||
enabledRideProfiles = enabledRideProfiles.toMutableSet().apply { add(newProfileName) }
|
||||
newProfileName = ""
|
||||
rideProfileDialogVisible = false
|
||||
newProfileName = "" // Clear the text field
|
||||
}
|
||||
},
|
||||
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")
|
||||
}
|
||||
|
||||
|
||||
FilledTonalButton(
|
||||
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")
|
||||
}
|
||||
}
|
||||
@ -410,7 +399,6 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
|
||||
.fillMaxWidth()
|
||||
.padding(10.dp),
|
||||
shape = RoundedCornerShape(10.dp),
|
||||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
|
||||
) {
|
||||
Column(modifier = Modifier
|
||||
.padding(5.dp)
|
||||
@ -455,7 +443,6 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
|
||||
.fillMaxWidth()
|
||||
.padding(10.dp),
|
||||
shape = RoundedCornerShape(10.dp),
|
||||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
|
||||
) {
|
||||
Column(modifier = Modifier
|
||||
.padding(5.dp)
|
||||
@ -491,7 +478,6 @@ fun DetailScreen(isCreating: Boolean, reminder: Reminder, onSubmit: (updatedRemi
|
||||
.fillMaxWidth()
|
||||
.padding(10.dp),
|
||||
shape = RoundedCornerShape(10.dp),
|
||||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surface)
|
||||
) {
|
||||
Column(modifier = Modifier
|
||||
.padding(5.dp)
|
||||
|
||||
@ -254,4 +254,4 @@ fun MainScreen(reminders: MutableList<Reminder>, onNavigateToReminder: (r: Remin
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user