mirror of
https://github.com/usetrmnl/trmnl-android.git
synced 2026-04-29 13:35:26 -07:00
feat: Add View Refresh Logs button to AppSettingsScreen
- Add ViewLogsRequested event to AppSettingsScreen.Event - Add event handler to navigate to DisplayRefreshLogScreen - Add OutlinedButton 'View Refresh Logs' after Cancel button in WorkScheduleStatusCard - Uses Icons.AutoMirrored.Filled.List for visual clarity - Follows same navigation pattern as TrmnlMirrorDisplayScreen - Makes refresh logs easily accessible from settings screen
This commit is contained in:
@@ -96,6 +96,7 @@ import ink.trmnl.android.ui.aboutapp.AppInfoScreen
|
||||
import ink.trmnl.android.ui.devicemodel.DeviceModelSelectorScreen
|
||||
import ink.trmnl.android.ui.display.TrmnlMirrorDisplayScreen
|
||||
import ink.trmnl.android.ui.icons.Icons
|
||||
import ink.trmnl.android.ui.refreshlog.DisplayRefreshLogScreen
|
||||
import ink.trmnl.android.ui.settings.AppSettingsScreen.ValidationResult
|
||||
import ink.trmnl.android.ui.settings.AppSettingsScreen.ValidationResult.Failure
|
||||
import ink.trmnl.android.ui.settings.AppSettingsScreen.ValidationResult.InvalidServerUrl
|
||||
@@ -251,6 +252,11 @@ data class AppSettingsScreen(
|
||||
* Event triggered when the override display model button is clicked.
|
||||
*/
|
||||
data object OverrideDisplayModelPressed : Event()
|
||||
|
||||
/**
|
||||
* Event triggered when the user wants to view the refresh logs.
|
||||
*/
|
||||
data object ViewLogsRequested : Event()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,6 +525,11 @@ class AppSettingsPresenter
|
||||
navigator.goTo(AppInfoScreen)
|
||||
}
|
||||
|
||||
AppSettingsScreen.Event.ViewLogsRequested -> {
|
||||
// Navigate to DisplayRefreshLogScreen
|
||||
navigator.goTo(DisplayRefreshLogScreen)
|
||||
}
|
||||
|
||||
AppSettingsScreen.Event.OverrideDisplayModelPressed -> {
|
||||
// Navigate to DeviceModelSelectorScreen using answering navigator
|
||||
// Pass the current device type so the screen knows which type this selection is for
|
||||
@@ -1252,6 +1263,23 @@ private fun WorkScheduleStatusCard(
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Text("Cancel Periodic Refresh Job")
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
OutlinedButton(
|
||||
onClick = {
|
||||
state.eventSink(AppSettingsScreen.Event.ViewLogsRequested)
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Filled.List,
|
||||
contentDescription = "View logs",
|
||||
modifier = Modifier.size(20.dp),
|
||||
)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Text("View Refresh Logs")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Text(
|
||||
@@ -1262,6 +1290,8 @@ private fun WorkScheduleStatusCard(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user