diff --git a/CollabTableAndroid/app/src/main/java/com/collabtable/app/ui/navigation/MainApp.kt b/CollabTableAndroid/app/src/main/java/com/collabtable/app/ui/navigation/MainApp.kt index 6f61c4b..e868311 100644 --- a/CollabTableAndroid/app/src/main/java/com/collabtable/app/ui/navigation/MainApp.kt +++ b/CollabTableAndroid/app/src/main/java/com/collabtable/app/ui/navigation/MainApp.kt @@ -4,6 +4,7 @@ import androidx.compose.animation.core.tween import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Home import androidx.compose.material.icons.filled.Settings @@ -106,7 +107,13 @@ fun MainApp() { } }, ) { innerPadding -> - Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { + // Apply the innerPadding from the Scaffold so content is not obscured by the bottom navigation bar. + Surface( + modifier = Modifier + .fillMaxSize() + .padding(innerPadding), + color = MaterialTheme.colorScheme.background, + ) { NavHost( navController = navController, startDestination = Routes.Tables, diff --git a/CollabTableAndroid/app/src/main/java/com/collabtable/app/ui/screens/SettingsScreen.kt b/CollabTableAndroid/app/src/main/java/com/collabtable/app/ui/screens/SettingsScreen.kt index 1839a55..32c2add 100644 --- a/CollabTableAndroid/app/src/main/java/com/collabtable/app/ui/screens/SettingsScreen.kt +++ b/CollabTableAndroid/app/src/main/java/com/collabtable/app/ui/screens/SettingsScreen.kt @@ -133,11 +133,6 @@ fun SettingsScreen( topBar = { TopAppBar( title = { Text(stringResource(R.string.settings)) }, - navigationIcon = { - IconButton(onClick = onNavigateBack) { - Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Back") - } - }, actions = { ConnectionStatusAction(prefs = preferencesManager) }, @@ -322,110 +317,7 @@ fun SettingsScreen( } } - // Diagnostics / Logs - Text( - text = "Diagnostics", - style = MaterialTheme.typography.titleMedium, - ) - Card( - modifier = Modifier.fillMaxWidth(), - colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant), - ) { - Column( - modifier = Modifier.padding(12.dp), - verticalArrangement = Arrangement.spacedBy(8.dp), - ) { - Text( - text = "View application logs", - style = MaterialTheme.typography.labelSmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) - Button(onClick = onNavigateToLogs, modifier = Modifier.fillMaxWidth()) { - Icon(Icons.AutoMirrored.Filled.List, contentDescription = null) - Spacer(modifier = Modifier.width(8.dp)) - Text("Open Logs") - } - } - } - - // Leave Server section - Text( - text = "Leave Server", - style = MaterialTheme.typography.titleMedium, - ) - Card( - modifier = Modifier.fillMaxWidth(), - colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant), - ) { - Column( - modifier = Modifier.padding(12.dp), - verticalArrangement = Arrangement.spacedBy(8.dp), - ) { - // Warning/info text appears above the action button - Text( - text = "Leaving removes local data", - style = MaterialTheme.typography.labelLarge, - color = MaterialTheme.colorScheme.onSurface, - ) - Text( - text = "Disconnects and clears local database", - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) - Text( - text = "Clears stored server URL and password", - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) - Text( - text = "Deletes all local data (tables, fields, items)", - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) - Text( - text = "Returns to server setup screen", - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) - - // Action button placed after the information for better UX - Button( - onClick = { showLeaveDialog = true }, - modifier = Modifier.fillMaxWidth(), - enabled = !isLeaving, - colors = - ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.error, - contentColor = MaterialTheme.colorScheme.onError, - ), - ) { - if (isLeaving) { - CircularProgressIndicator( - modifier = Modifier.size(16.dp), - color = MaterialTheme.colorScheme.onError, - strokeWidth = 2.dp, - ) - Spacer(modifier = Modifier.width(8.dp)) - Text("Leaving...") - } else { - Text("Leave Server") - } - } - } - } - - - } - - // Notifications section (placed after main content but before dialogs) - Column( - modifier = - Modifier - .fillMaxWidth() - .padding(padding) - .padding(16.dp), - verticalArrangement = Arrangement.spacedBy(16.dp), - ) { + // Notifications section (moved inside the main scroll column so it doesn't overlay other content) Text( text = "Notifications", style = MaterialTheme.typography.titleMedium, @@ -523,8 +415,103 @@ fun SettingsScreen( ) } } + + // Diagnostics / Logs + Text( + text = "Diagnostics", + style = MaterialTheme.typography.titleMedium, + ) + Card( + modifier = Modifier.fillMaxWidth(), + colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant), + ) { + Column( + modifier = Modifier.padding(12.dp), + verticalArrangement = Arrangement.spacedBy(8.dp), + ) { + Text( + text = "View application logs", + style = MaterialTheme.typography.labelSmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + Button(onClick = onNavigateToLogs, modifier = Modifier.fillMaxWidth()) { + Icon(Icons.AutoMirrored.Filled.List, contentDescription = null) + Spacer(modifier = Modifier.width(8.dp)) + Text("Open Logs") + } + } + } + + // Leave Server section + Text( + text = "Leave Server", + style = MaterialTheme.typography.titleMedium, + ) + Card( + modifier = Modifier.fillMaxWidth(), + colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant), + ) { + Column( + modifier = Modifier.padding(12.dp), + verticalArrangement = Arrangement.spacedBy(8.dp), + ) { + // Warning/info text appears above the action button + Text( + text = "Leaving removes local data", + style = MaterialTheme.typography.labelLarge, + color = MaterialTheme.colorScheme.onSurface, + ) + Text( + text = "Disconnects and clears local database", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + Text( + text = "Clears stored server URL and password", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + Text( + text = "Deletes all local data (tables, fields, items)", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + Text( + text = "Returns to server setup screen", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + + // Action button placed after the information for better UX + Button( + onClick = { showLeaveDialog = true }, + modifier = Modifier.fillMaxWidth(), + enabled = !isLeaving, + colors = + ButtonDefaults.buttonColors( + containerColor = MaterialTheme.colorScheme.error, + contentColor = MaterialTheme.colorScheme.onError, + ), + ) { + if (isLeaving) { + CircularProgressIndicator( + modifier = Modifier.size(16.dp), + color = MaterialTheme.colorScheme.onError, + strokeWidth = 2.dp, + ) + Spacer(modifier = Modifier.width(8.dp)) + Text("Leaving...") + } else { + Text("Leave Server") + } + } + } + } + + } + if (showLeaveDialog) { AlertDialog( onDismissRequest = { showLeaveDialog = false },