From ddadd73686e65808f66242bdfe6166a459d21fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20G=C3=B6ransson?= Date: Thu, 25 Jul 2024 10:44:49 +0200 Subject: [PATCH] Fix lint warning --- .../compose/cell/RelayLocationCell.kt | 10 +++---- .../compose/screen/SelectLocationScreen.kt | 29 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/RelayLocationCell.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/RelayLocationCell.kt index 24547c147c7c..cf9682bcbe3e 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/RelayLocationCell.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/RelayLocationCell.kt @@ -66,12 +66,12 @@ private fun PreviewCheckableRelayLocationCell( fun StatusRelayItemCell( item: RelayItem, isSelected: Boolean, - onClick: () -> Unit, - onLongClick: (() -> Unit)? = null, - onToggleExpand: ((Boolean) -> Unit), - isExpanded: Boolean, - depth: Int, modifier: Modifier = Modifier, + onClick: () -> Unit = {}, + onLongClick: (() -> Unit)? = null, + onToggleExpand: ((Boolean) -> Unit) = {}, + isExpanded: Boolean = false, + depth: Int = 0, activeColor: Color = MaterialTheme.colorScheme.selected, inactiveColor: Color = MaterialTheme.colorScheme.error, disabledColor: Color = MaterialTheme.colorScheme.onSecondary, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt index ab6821664eef..bae8a9b05dd3 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt @@ -436,11 +436,11 @@ fun LazyItemScope.RelayLocationItem( StatusRelayItemCell( location, relayItem.isSelected, - { onSelectRelay() }, - { onLongClick() }, - { onExpand(it) }, - relayItem.expanded, - relayItem.depth + onClick = { onSelectRelay() }, + onLongClick = { onLongClick() }, + onToggleExpand = { onExpand(it) }, + isExpanded = relayItem.expanded, + depth = relayItem.depth ) } @@ -455,11 +455,10 @@ fun LazyItemScope.CustomListItem( StatusRelayItemCell( customListItem, itemState.isSelected, - { onSelectRelay(customListItem) }, - { onShowEditBottomSheet(customListItem) }, - { onExpand(customListItem.id, it) }, - itemState.expanded, - 0 + onClick = { onSelectRelay(customListItem) }, + onLongClick = { onShowEditBottomSheet(customListItem) }, + onToggleExpand = { onExpand(customListItem.id, it) }, + isExpanded = itemState.expanded ) } @@ -474,11 +473,11 @@ fun LazyItemScope.CustomListEntryItem( StatusRelayItemCell( customListEntryItem, false, - onSelectRelay, - onShowEditCustomListEntryBottomSheet, - onToggleExpand, - itemState.expanded, - itemState.depth + onClick = onSelectRelay, + onLongClick = onShowEditCustomListEntryBottomSheet, + onToggleExpand = onToggleExpand, + isExpanded = itemState.expanded, + depth = itemState.depth ) }