Merge pull request #232 from usetrmnl/disable-device-model

[UPDATE] Disabled device model chooser UI that is no longer needed
This commit is contained in:
Hossain Khan
2025-12-06 16:39:25 -05:00
committed by GitHub
2 changed files with 79 additions and 6 deletions
@@ -64,6 +64,18 @@ import kotlinx.parcelize.Parcelize
* - Select a device model
* - Return the selected model to the previous screen via PopResult
*
* ----
*
* ⚠️ NOTE: Device model choosing is disabled for now as it is not supported yet.
*
* See following references:
* - https://github.com/usetrmnl/trmnl-android/issues/229
* - https://github.com/usetrmnl/trmnl-android/issues/163
* - https://discord.com/channels/1281055965508141100/1331360842809348106/1446953346278625433
* - https://discord.com/channels/1281055965508141100/1331360842809348106/1446954432007766140
* - https://discord.com/channels/1281055965508141100/1331360842809348106/1446959843507306678
* - https://discord.com/channels/1281055965508141100/1331360842809348106/1446959897571889182
*
* @property deviceType The device type this model selection is for (e.g., BYOD, BYOS)
*/
@Parcelize
@@ -913,6 +913,19 @@ private fun DeviceTypeSelectorConfig(
// Control device ID visibility
var deviceIdVisible by remember { mutableStateOf(false) }
/**
* Device model choosing is disabled for now as it is not supported yet.
*
* See following references:
* - https://github.com/usetrmnl/trmnl-android/issues/229
* - https://github.com/usetrmnl/trmnl-android/issues/163
* - https://discord.com/channels/1281055965508141100/1331360842809348106/1446953346278625433
* - https://discord.com/channels/1281055965508141100/1331360842809348106/1446954432007766140
* - https://discord.com/channels/1281055965508141100/1331360842809348106/1446959843507306678
* - https://discord.com/channels/1281055965508141100/1331360842809348106/1446959897571889182
*/
val shouldDisableDeviceModel = true
Column(modifier = modifier.fillMaxWidth()) {
SingleChoiceSegmentedButtonRow(modifier = Modifier.fillMaxWidth()) {
TrmnlDeviceType.entries.forEachIndexed { index, deviceType ->
@@ -1047,7 +1060,7 @@ private fun DeviceTypeSelectorConfig(
}
// Show saved device model if available
if (savedDeviceModel != null) {
if (!shouldDisableDeviceModel && savedDeviceModel != null) {
Card(
modifier =
Modifier
@@ -1076,11 +1089,13 @@ private fun DeviceTypeSelectorConfig(
}
}
OutlinedButton(
onClick = onOverrideDisplayModelPressed,
modifier = Modifier.fillMaxWidth(),
) {
Text("Override Display Model")
if (!shouldDisableDeviceModel) {
OutlinedButton(
onClick = onOverrideDisplayModelPressed,
modifier = Modifier.fillMaxWidth(),
) {
Text("Override Display Model")
}
}
}
}
@@ -1431,3 +1446,49 @@ private fun PreviewFakeApiInfoBanner() {
FakeApiInfoBanner()
}
}
@Preview(name = "App Settings Content - BYOD Selected")
@Composable
private fun PreviewAppSettingsContentByod() {
TrmnlDisplayAppTheme {
AppSettingsContent(
state =
AppSettingsScreen.State(
deviceType = TrmnlDeviceType.BYOD,
serverBaseUrl = "https://usetrmnl.com",
accessToken = "byod-access-token-here",
deviceMacId = "",
isByodMasterDevice = false,
usesFakeApiData = false,
isLoading = false,
validationResult = null,
nextRefreshJobInfo = null,
savedDeviceModel = null,
eventSink = {},
),
)
}
}
@Preview(name = "App Settings Content - BYOS Selected")
@Composable
private fun PreviewAppSettingsContentByos() {
TrmnlDisplayAppTheme {
AppSettingsContent(
state =
AppSettingsScreen.State(
deviceType = TrmnlDeviceType.BYOS,
serverBaseUrl = "https://my-custom-server.com",
accessToken = "byos-access-token-here",
deviceMacId = "AA:BB:CC:DD:EE:FF",
isByodMasterDevice = true,
usesFakeApiData = false,
isLoading = false,
validationResult = null,
nextRefreshJobInfo = null,
savedDeviceModel = null,
eventSink = {},
),
)
}
}