mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2026-01-15 20:54:27 +01:00
Remove duplicate
This commit is contained in:
@@ -7,20 +7,12 @@ import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.WindowInsetsSides
|
||||
import androidx.compose.foundation.layout.displayCutout
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.imePadding
|
||||
import androidx.compose.foundation.layout.only
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.DeveloperBoardOff
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedCard
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -29,7 +21,6 @@ import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
@@ -38,6 +29,7 @@ import no.nordicsemi.android.common.permissions.ble.RequireLocation
|
||||
import no.nordicsemi.android.common.permissions.notification.RequestNotificationPermission
|
||||
import no.nordicsemi.android.toolbox.lib.utils.Profile
|
||||
import no.nordicsemi.android.toolbox.profile.data.displayMessage
|
||||
import no.nordicsemi.android.toolbox.profile.view.DFUScreen
|
||||
import no.nordicsemi.android.toolbox.profile.view.battery.BatteryScreen
|
||||
import no.nordicsemi.android.toolbox.profile.view.bps.BPSScreen
|
||||
import no.nordicsemi.android.toolbox.profile.view.cgms.CGMScreen
|
||||
@@ -201,7 +193,10 @@ internal fun DeviceConnectedView(
|
||||
// Display the appropriate screen for each profile.
|
||||
when (serviceManager.profile) {
|
||||
Profile.HTS -> HTSScreen()
|
||||
Profile.CHANNEL_SOUNDING -> ChannelSoundingScreen(isNotificationPermissionGranted)
|
||||
Profile.CHANNEL_SOUNDING -> ChannelSoundingScreen(
|
||||
isNotificationPermissionGranted
|
||||
)
|
||||
|
||||
Profile.BPS -> BPSScreen()
|
||||
Profile.CSC -> CSCScreen()
|
||||
Profile.CGM -> CGMScreen()
|
||||
@@ -220,47 +215,3 @@ internal fun DeviceConnectedView(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun DFUScreen(
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.then(modifier),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
OutlinedCard(
|
||||
modifier = Modifier
|
||||
.widthIn(max = 460.dp),
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.DeveloperBoardOff,
|
||||
contentDescription = null,
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
modifier = Modifier.size(48.dp)
|
||||
)
|
||||
|
||||
Text(
|
||||
text = "DFU is not supported",
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
)
|
||||
|
||||
Text(
|
||||
text = "DFU is not implemented in the current version of the app." +
|
||||
" Please use the Nordic Semiconductor app for firmware updates.",
|
||||
textAlign = TextAlign.Center,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user