diff --git a/core/ui/src/main/kotlin/org/meshtastic/core/ui/component/NodeItem.kt b/core/ui/src/main/kotlin/org/meshtastic/core/ui/component/NodeItem.kt index 1021cd6b8..7063154bc 100644 --- a/core/ui/src/main/kotlin/org/meshtastic/core/ui/component/NodeItem.kt +++ b/core/ui/src/main/kotlin/org/meshtastic/core/ui/component/NodeItem.kt @@ -65,31 +65,6 @@ import org.meshtastic.core.resources.signal_quality import org.meshtastic.core.resources.unknown_username import org.meshtastic.core.resources.voltage import org.meshtastic.core.service.ConnectionState -import org.meshtastic.core.ui.component.AirQualityInfo -import org.meshtastic.core.ui.component.ChannelInfo -import org.meshtastic.core.ui.component.DistanceInfo -import org.meshtastic.core.ui.component.ElevationInfo -import org.meshtastic.core.ui.component.HardwareInfo -import org.meshtastic.core.ui.component.HopsInfo -import org.meshtastic.core.ui.component.HumidityInfo -import org.meshtastic.core.ui.component.IconInfo -import org.meshtastic.core.ui.component.LastHeardInfo -import org.meshtastic.core.ui.component.MaterialBatteryInfo -import org.meshtastic.core.ui.component.NodeChip -import org.meshtastic.core.ui.component.NodeIdInfo -import org.meshtastic.core.ui.component.NodeKeyStatusIcon -import org.meshtastic.core.ui.component.PaxcountInfo -import org.meshtastic.core.ui.component.PowerInfo -import org.meshtastic.core.ui.component.PressureInfo -import org.meshtastic.core.ui.component.RoleInfo -import org.meshtastic.core.ui.component.Rssi -import org.meshtastic.core.ui.component.SatelliteCountInfo -import org.meshtastic.core.ui.component.Snr -import org.meshtastic.core.ui.component.SoilMoistureInfo -import org.meshtastic.core.ui.component.SoilTemperatureInfo -import org.meshtastic.core.ui.component.TemperatureInfo -import org.meshtastic.core.ui.component.TransportIcon -import org.meshtastic.core.ui.component.determineSignalQuality import org.meshtastic.core.ui.component.preview.NodePreviewParameterProvider import org.meshtastic.core.ui.icon.AirUtilization import org.meshtastic.core.ui.icon.ChannelUtilization diff --git a/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/AlertScreenshotTest.kt b/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/AlertScreenshotTest.kt index 9a1c7ae6a..aea80850d 100644 --- a/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/AlertScreenshotTest.kt +++ b/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/AlertScreenshotTest.kt @@ -19,11 +19,11 @@ package org.meshtastic.core.ui import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview import com.android.tools.screenshot.PreviewTest -import org.meshtastic.core.ui.util.PreviewTextAlert -import org.meshtastic.core.ui.util.PreviewIconAlert -import org.meshtastic.core.ui.util.PreviewHtmlAlert -import org.meshtastic.core.ui.util.PreviewMultipleChoiceAlert import org.meshtastic.core.ui.util.PreviewComposableAlert +import org.meshtastic.core.ui.util.PreviewHtmlAlert +import org.meshtastic.core.ui.util.PreviewIconAlert +import org.meshtastic.core.ui.util.PreviewMultipleChoiceAlert +import org.meshtastic.core.ui.util.PreviewTextAlert class AlertScreenshotTest { diff --git a/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/AppScreenshotTest.kt b/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/AppScreenshotTest.kt index 52a6952d5..abda6b588 100644 --- a/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/AppScreenshotTest.kt +++ b/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/AppScreenshotTest.kt @@ -24,8 +24,8 @@ import org.meshtastic.core.model.Channel import org.meshtastic.core.ui.component.AdaptiveTwoPane import org.meshtastic.core.ui.component.MainAppBar import org.meshtastic.core.ui.component.preview.previewNode -import org.meshtastic.core.ui.theme.AppTheme import org.meshtastic.core.ui.qr.ScannedQrCodeDialog +import org.meshtastic.core.ui.theme.AppTheme import org.meshtastic.proto.ChannelSet class AppScreenshotTest { @@ -43,7 +43,7 @@ class AppScreenshotTest { canNavigateUp = false, onNavigateUp = {}, actions = {}, - onClickChip = {} + onClickChip = {}, ) } } @@ -54,14 +54,10 @@ class AppScreenshotTest { fun ScannedQrCodeDialogTest() { AppTheme { ScannedQrCodeDialog( - channels = ChannelSet( - settings = listOf(Channel.default.settings), - lora_config = Channel.default.loraConfig - ), - incoming = ChannelSet( - settings = listOf(Channel.default.settings), - lora_config = Channel.default.loraConfig - ), + channels = + ChannelSet(settings = listOf(Channel.default.settings), lora_config = Channel.default.loraConfig), + incoming = + ChannelSet(settings = listOf(Channel.default.settings), lora_config = Channel.default.loraConfig), onDismiss = {}, onConfirm = {}, ) @@ -72,23 +68,13 @@ class AppScreenshotTest { @Preview(showBackground = true, widthDp = 800) @Composable fun AdaptiveTwoPaneExpandedTest() { - AppTheme { - AdaptiveTwoPane( - first = { Text("Left Pane") }, - second = { Text("Right Pane") } - ) - } + AppTheme { AdaptiveTwoPane(first = { Text("Left Pane") }, second = { Text("Right Pane") }) } } @PreviewTest @Preview(showBackground = true, widthDp = 400) @Composable fun AdaptiveTwoPaneCompactTest() { - AppTheme { - AdaptiveTwoPane( - first = { Text("Top Pane") }, - second = { Text("Bottom Pane") } - ) - } + AppTheme { AdaptiveTwoPane(first = { Text("Top Pane") }, second = { Text("Bottom Pane") }) } } } diff --git a/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/ComponentScreenshotTest.kt b/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/ComponentScreenshotTest.kt index f02ecd106..f0781970e 100644 --- a/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/ComponentScreenshotTest.kt +++ b/core/ui/src/screenshotTest/kotlin/org/meshtastic/core/ui/ComponentScreenshotTest.kt @@ -12,7 +12,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. Of not, see . + * along with this program. If not, see . */ package org.meshtastic.core.ui @@ -65,90 +65,70 @@ class ComponentScreenshotTest { @Preview(showBackground = true) @Composable fun BatteryInfoTest(@PreviewParameter(BatteryInfoPreviewParameterProvider::class) info: Pair) { - AppTheme { - MaterialBatteryInfo(level = info.first, voltage = info.second) - } + AppTheme { MaterialBatteryInfo(level = info.first, voltage = info.second) } } @PreviewTest @Preview(showBackground = true) @Composable fun SignalInfoTest(@PreviewParameter(NodePreviewParameterProvider::class) node: Node) { - AppTheme { - SignalInfo(node = node) - } + AppTheme { SignalInfo(node = node) } } @PreviewTest @Preview(showBackground = true) @Composable fun NodeChipTest(@PreviewParameter(NodePreviewParameterProvider::class) node: Node) { - AppTheme { - NodeChip(node = node) - } + AppTheme { NodeChip(node = node) } } @PreviewTest @Preview(showBackground = true) @Composable fun DistanceInfoTest() { - AppTheme { - DistanceInfo(distance = "12.3 km") - } + AppTheme { DistanceInfo(distance = "12.3 km") } } @PreviewTest @Preview(showBackground = true) @Composable fun ElevationInfoTest() { - AppTheme { - ElevationInfo(altitude = 1234, system = Config.DisplayConfig.DisplayUnits.METRIC, suffix = "m") - } + AppTheme { ElevationInfo(altitude = 1234, system = Config.DisplayConfig.DisplayUnits.METRIC, suffix = "m") } } @PreviewTest @Preview(showBackground = true) @Composable fun HopsInfoTest() { - AppTheme { - HopsInfo(hops = 3) - } + AppTheme { HopsInfo(hops = 3) } } @PreviewTest @Preview(showBackground = true) @Composable fun SatelliteCountInfoTest() { - AppTheme { - SatelliteCountInfo(satCount = 8) - } + AppTheme { SatelliteCountInfo(satCount = 8) } } @PreviewTest @Preview(showBackground = true) @Composable fun ChannelInfoTest() { - AppTheme { - ChannelInfo(channel = 1) - } + AppTheme { ChannelInfo(channel = 1) } } @PreviewTest @Preview(showBackground = true) @Composable fun ListItemTest() { - AppTheme { - ListItem(text = "Example Item", leadingIcon = Icons.Rounded.Android) {} - } + AppTheme { ListItem(text = "Example Item", leadingIcon = Icons.Rounded.Android) {} } } @PreviewTest @Preview(showBackground = true) @Composable fun SwitchListItemTest() { - AppTheme { - SwitchListItem(checked = true, text = "Example Switch", onClick = {}) - } + AppTheme { SwitchListItem(checked = true, text = "Example Switch", onClick = {}) } } @PreviewTest @@ -156,11 +136,7 @@ class ComponentScreenshotTest { @Composable fun TitledCardTest() { AppTheme { - Surface { - TitledCard(title = "Example Title") { - Box(modifier = Modifier.fillMaxWidth().height(50.dp)) - } - } + Surface { TitledCard(title = "Example Title") { Box(modifier = Modifier.fillMaxWidth().height(50.dp)) } } } } @@ -168,40 +144,28 @@ class ComponentScreenshotTest { @Preview(showBackground = true) @Composable fun IAQScaleTest() { - AppTheme { - IAQScale() - } + AppTheme { IAQScale() } } @PreviewTest @Preview(showBackground = true) @Composable fun IndoorAirQualityPillTest() { - AppTheme { - IndoorAirQuality(iaq = 101, displayMode = IaqDisplayMode.Pill) - } + AppTheme { IndoorAirQuality(iaq = 101, displayMode = IaqDisplayMode.Pill) } } @PreviewTest @Preview(showBackground = true) @Composable fun AutoLinkTextTest() { - AppTheme { - AutoLinkText("Check out https://meshtastic.org for more info!") - } + AppTheme { AutoLinkText("Check out https://meshtastic.org for more info!") } } @PreviewTest @Preview(showBackground = true) @Composable fun SecurityIconTest() { - AppTheme { - Column { - SecurityState.entries.forEach { state -> - SecurityIcon(securityState = state) - } - } - } + AppTheme { Column { SecurityState.entries.forEach { state -> SecurityIcon(securityState = state) } } } } @PreviewTest @@ -228,7 +192,7 @@ class ComponentScreenshotTest { enabled = true, isSelected = true, onSelected = {}, - channel = Channel.default + channel = Channel.default, ) } } @@ -242,7 +206,7 @@ class ComponentScreenshotTest { title = "Share Contact", uri = Uri.parse("https://meshtastic.org/u/dummy"), qrCode = Bitmap.createBitmap(10, 10, Bitmap.Config.ARGB_8888), - onDismiss = {} + onDismiss = {}, ) } } diff --git a/feature/node/src/main/kotlin/org/meshtastic/feature/node/list/NodeListScreen.kt b/feature/node/src/main/kotlin/org/meshtastic/feature/node/list/NodeListScreen.kt index 77fe78a9a..6e1d891b6 100644 --- a/feature/node/src/main/kotlin/org/meshtastic/feature/node/list/NodeListScreen.kt +++ b/feature/node/src/main/kotlin/org/meshtastic/feature/node/list/NodeListScreen.kt @@ -82,13 +82,13 @@ import org.meshtastic.core.resources.remove_ignored import org.meshtastic.core.resources.unmute import org.meshtastic.core.ui.component.MainAppBar import org.meshtastic.core.ui.component.MeshtasticImportFAB +import org.meshtastic.core.ui.component.NodeItem import org.meshtastic.core.ui.component.ScrollToTopEvent import org.meshtastic.core.ui.component.smartScrollToTop import org.meshtastic.core.ui.qr.ScannedQrCodeDialog import org.meshtastic.core.ui.theme.StatusColors.StatusRed import org.meshtastic.core.ui.util.showToast import org.meshtastic.feature.node.component.NodeFilterTextField -import org.meshtastic.core.ui.component.NodeItem import org.meshtastic.proto.SharedContact @OptIn(ExperimentalMaterial3ExpressiveApi::class) diff --git a/feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/NeighborInfoLog.kt b/feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/NeighborInfoLog.kt index 37f5437c2..87a7d9147 100644 --- a/feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/NeighborInfoLog.kt +++ b/feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/NeighborInfoLog.kt @@ -46,6 +46,7 @@ import org.meshtastic.core.model.getNeighborInfoResponse import org.meshtastic.core.resources.Res import org.meshtastic.core.resources.neighbor_info import org.meshtastic.core.resources.routing_error_no_response +import org.meshtastic.core.ui.component.CooldownIconButton import org.meshtastic.core.ui.component.MainAppBar import org.meshtastic.core.ui.icon.Groups import org.meshtastic.core.ui.icon.MeshtasticIcons @@ -55,7 +56,6 @@ import org.meshtastic.core.ui.theme.StatusColors.StatusGreen import org.meshtastic.core.ui.theme.StatusColors.StatusOrange import org.meshtastic.core.ui.theme.StatusColors.StatusYellow import org.meshtastic.core.ui.util.annotateNeighborInfo -import org.meshtastic.core.ui.component.CooldownIconButton import org.meshtastic.feature.node.detail.NodeRequestEffect @OptIn(ExperimentalFoundationApi::class) diff --git a/feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/TracerouteLog.kt b/feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/TracerouteLog.kt index fab5f95ed..3f96792e3 100644 --- a/feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/TracerouteLog.kt +++ b/feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/TracerouteLog.kt @@ -61,6 +61,7 @@ import org.meshtastic.core.resources.traceroute_log import org.meshtastic.core.resources.traceroute_route_back_to_us import org.meshtastic.core.resources.traceroute_route_towards_dest import org.meshtastic.core.resources.traceroute_time_and_text +import org.meshtastic.core.ui.component.CooldownIconButton import org.meshtastic.core.ui.component.MainAppBar import org.meshtastic.core.ui.icon.Group import org.meshtastic.core.ui.icon.MeshtasticIcons @@ -73,7 +74,6 @@ import org.meshtastic.core.ui.theme.StatusColors.StatusOrange import org.meshtastic.core.ui.theme.StatusColors.StatusYellow import org.meshtastic.core.ui.util.annotateTraceroute import org.meshtastic.feature.map.model.TracerouteOverlay -import org.meshtastic.core.ui.component.CooldownIconButton import org.meshtastic.feature.node.detail.NodeRequestEffect import org.meshtastic.feature.node.metrics.CommonCharts.MS_PER_SEC import org.meshtastic.proto.RouteDiscovery