diff --git a/CHANGELOG.md b/CHANGELOG.md index 142ddf928..eff0ad5d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Mnemonic warning text transitions on reveal #857 ### Changed +- Show end of address on Receive Bitcoin screen using middle ellipsis truncation #886 - Update funding screen: replace Advanced with Manual Setup, fix Use Other Wallet navigation to open amount entry, and add Fund Wallet button to no-funds dialog #885 - Updated design of the success screen in the manual channel setup flow #883 - Unified send flow with payment method switcher, details toggle, Lightning support for BIP21 payments, and improved fee rate defaults #863 diff --git a/app/src/main/java/to/bitkit/ui/components/Text.kt b/app/src/main/java/to/bitkit/ui/components/Text.kt index 5150545fe..d092758e3 100644 --- a/app/src/main/java/to/bitkit/ui/components/Text.kt +++ b/app/src/main/java/to/bitkit/ui/components/Text.kt @@ -254,12 +254,16 @@ fun BodyS( modifier: Modifier = Modifier, color: Color = MaterialTheme.colorScheme.primary, textAlign: TextAlign = TextAlign.Start, + maxLines: Int = Int.MAX_VALUE, + overflow: TextOverflow = TextOverflow.Clip, ) { BodyS( text = AnnotatedString(text), - modifier = modifier, color = color, textAlign = textAlign, + maxLines = maxLines, + overflow = overflow, + modifier = modifier ) } @@ -269,6 +273,8 @@ fun BodyS( modifier: Modifier = Modifier, color: Color = MaterialTheme.colorScheme.primary, textAlign: TextAlign = TextAlign.Start, + maxLines: Int = Int.MAX_VALUE, + overflow: TextOverflow = TextOverflow.Clip, ) { Text( text = text, @@ -276,7 +282,9 @@ fun BodyS( color = color, textAlign = textAlign, ), - modifier = modifier, + maxLines = maxLines, + overflow = overflow, + modifier = modifier ) } diff --git a/app/src/main/java/to/bitkit/ui/screens/wallets/receive/ReceiveQrScreen.kt b/app/src/main/java/to/bitkit/ui/screens/wallets/receive/ReceiveQrScreen.kt index 7d10de0c3..630aefc70 100644 --- a/app/src/main/java/to/bitkit/ui/screens/wallets/receive/ReceiveQrScreen.kt +++ b/app/src/main/java/to/bitkit/ui/screens/wallets/receive/ReceiveQrScreen.kt @@ -10,11 +10,9 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -45,6 +43,7 @@ import androidx.compose.ui.platform.LocalHapticFeedback import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Devices.NEXUS_5 import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -56,7 +55,6 @@ import kotlinx.coroutines.launch import org.lightningdevkit.ldknode.ChannelDetails import to.bitkit.R import to.bitkit.ext.setClipboardText -import to.bitkit.ext.truncate import to.bitkit.models.NodeLifecycleState import to.bitkit.repositories.LightningState import to.bitkit.repositories.WalletState @@ -199,7 +197,7 @@ fun ReceiveQrScreen( ) { SheetTopBar(stringResource(R.string.wallet__receive_bitcoin)) Column { - Spacer(Modifier.height(16.dp)) + VerticalSpacer(16.dp) // Tab row CustomTabRowWithSpacing( @@ -221,7 +219,7 @@ fun ReceiveQrScreen( modifier = Modifier.padding(horizontal = 16.dp) ) - Spacer(Modifier.height(24.dp)) + VerticalSpacer(24.dp) // Content area (QR or Details) with LazyRow LazyRow( @@ -268,6 +266,7 @@ fun ReceiveQrScreen( walletState.bip21, walletState.onchainAddress, ) + else -> invoice } @@ -289,7 +288,7 @@ fun ReceiveQrScreen( } } - Spacer(Modifier.height(24.dp)) + VerticalSpacer(24.dp) AnimatedVisibility(visible = lightningState.nodeLifecycleState.isRunning()) { val showCjitButton = showingCjitOnboarding && selectedTab == ReceiveTab.SPENDING @@ -332,7 +331,7 @@ fun ReceiveQrScreen( ) } - Spacer(Modifier.height(16.dp)) + VerticalSpacer(16.dp) } } } @@ -366,7 +365,7 @@ private fun ReceiveQrView( modifier = Modifier.weight(1f, fill = false) ) - Spacer(modifier = Modifier.height(16.dp)) + VerticalSpacer(16.dp) Row( horizontalArrangement = Arrangement.spacedBy(16.dp), verticalAlignment = Alignment.Top, @@ -434,7 +433,7 @@ private fun ReceiveQrView( modifier = Modifier.weight(1f) ) } - Spacer(modifier = Modifier.height(16.dp)) + VerticalSpacer(16.dp) } } @@ -577,12 +576,14 @@ private fun CopyAddressCard( .padding(24.dp) ) { Caption13Up(text = title, color = Colors.White64) - Spacer(modifier = Modifier.height(16.dp)) + VerticalSpacer(16.dp) BodyS( - text = (body ?: address).truncate(32).uppercase(), + text = (body ?: address).uppercase(), + maxLines = 1, + overflow = TextOverflow.MiddleEllipsis, modifier = testTag?.let { Modifier.testTag(it) } ?: Modifier ) - Spacer(modifier = Modifier.height(16.dp)) + VerticalSpacer(16.dp) Row( horizontalArrangement = Arrangement.spacedBy(16.dp) ) { @@ -862,7 +863,8 @@ private fun PreviewDetailsMode() { tab = ReceiveTab.AUTO, walletState = WalletState( onchainAddress = "bcrt1qfserxgtuesul4m9zva56wzk849yf9l8rk4qy0l", - bolt11 = "lnbcrt500u1pn7umn7pp5x0s9lt9fwrff6rp70pz3guwnjgw97sjuv79...", + bolt11 = "lnbcrt500u1pn7umn7pp5x0s9lt9fwrff6rp70pz3guwnjgw97sjuv79vhx9n2ps8q6tcdehhxapqd9h8vmmfv" + + "djjqen0wgsyqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxq" ), cjitInvoice = null, onClickEditInvoice = {},