@@ -11,6 +11,8 @@ import androidx.compose.foundation.layout.fillMaxWidth
1111import androidx.compose.foundation.layout.height
1212import androidx.compose.foundation.layout.padding
1313import androidx.compose.foundation.layout.size
14+ import androidx.compose.foundation.lazy.LazyColumn
15+ import androidx.compose.foundation.lazy.items
1416import androidx.compose.foundation.shape.CircleShape
1517import androidx.compose.material3.HorizontalDivider
1618import androidx.compose.material3.Icon
@@ -36,7 +38,6 @@ import to.bitkit.models.HwWallet
3638import to.bitkit.models.TransportType
3739import to.bitkit.ui.components.BodyM
3840import to.bitkit.ui.components.Display
39- import to.bitkit.ui.components.FillHeight
4041import to.bitkit.ui.components.HorizontalSpacer
4142import to.bitkit.ui.components.HwDeviceIllustrations
4243import to.bitkit.ui.components.MoneySSB
@@ -111,11 +112,19 @@ private fun Content(
111112 if (wallets.isEmpty()) {
112113 EmptyState (modifier = Modifier .weight(1f ))
113114 } else {
114- wallets.forEach { wallet ->
115- HwWalletRow (wallet = wallet, onRemoveClick = onRemoveClick)
116- HorizontalDivider (color = Colors .White10 )
115+ LazyColumn (
116+ modifier = Modifier
117+ .weight(1f )
118+ .fillMaxWidth()
119+ ) {
120+ items(
121+ items = wallets,
122+ key = { it.id },
123+ ) { wallet ->
124+ HwWalletRow (wallet = wallet, onRemoveClick = onRemoveClick)
125+ HorizontalDivider (color = Colors .White10 )
126+ }
117127 }
118- FillHeight ()
119128 }
120129
121130 PrimaryButton (
@@ -168,7 +177,7 @@ private fun HwWalletRow(
168177 modifier = modifier
169178 .fillMaxWidth()
170179 .height(52 .dp)
171- .testTag(" HardwareWalletRow " )
180+ .testTag(" HardwareWalletRow_ ${wallet.id} " )
172181 ) {
173182 HwConnectionBadge (transportType = wallet.transportType, isConnected = wallet.isConnected)
174183 HorizontalSpacer (12 .dp)
@@ -186,7 +195,7 @@ private fun HwWalletRow(
186195 )
187196 IconButton (
188197 onClick = { onRemoveClick(wallet) },
189- modifier = Modifier .testTag(" HardwareWalletRowDelete " )
198+ modifier = Modifier .testTag(" HardwareWalletRowDelete_ ${wallet.id} " )
190199 ) {
191200 Icon (
192201 painter = painterResource(R .drawable.ic_trash),
@@ -204,6 +213,23 @@ private fun HwConnectionBadge(
204213 isConnected : Boolean ,
205214 modifier : Modifier = Modifier ,
206215) {
216+ val contentDescription = when (transportType) {
217+ TransportType .BLUETOOTH -> {
218+ if (isConnected) {
219+ stringResource(R .string.hardware__connection_badge_connected_bluetooth)
220+ } else {
221+ stringResource(R .string.hardware__connection_badge_disconnected_bluetooth)
222+ }
223+ }
224+ TransportType .USB -> {
225+ if (isConnected) {
226+ stringResource(R .string.hardware__connection_badge_connected_usb)
227+ } else {
228+ stringResource(R .string.hardware__connection_badge_disconnected_usb)
229+ }
230+ }
231+ }
232+
207233 Box (
208234 contentAlignment = Alignment .Center ,
209235 modifier = modifier
@@ -218,7 +244,7 @@ private fun HwConnectionBadge(
218244 TransportType .USB -> R .drawable.ic_usb_connected
219245 }
220246 ),
221- contentDescription = null ,
247+ contentDescription = contentDescription ,
222248 tint = if (isConnected) Colors .Green else Colors .White64 ,
223249 modifier = Modifier .size(16 .dp)
224250 )
0 commit comments