Skip to content

Commit 03f3656

Browse files
committed
Merge remote-tracking branch 'origin/feat/pubky-profile' into feat/pubky-profile
2 parents efe1e5c + f161dd2 commit 03f3656

25 files changed

Lines changed: 102 additions & 80 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Fixed
11-
- Polish Primary, Secondary, and Tertiary buttons to match Figma design specs #887
11+
- Retouch Primary, Secondary, and Tertiary buttons styling #887
1212
- Avoid msat truncation when paying invoices and LNURL callbacks #879
1313
- Fix ANR on RGS server settings screen caused by catastrophic regex backtracking #880
1414
- Fix crash when returning app to foreground on Receive screen #875
@@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
- Mnemonic warning text transitions on reveal #857
2626

2727
### Changed
28+
- Show end of address on Receive Bitcoin screen using middle ellipsis truncation #886
29+
- 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
2830
- Updated design of the success screen in the manual channel setup flow #883
2931
- Unified send flow with payment method switcher, details toggle, Lightning support for BIP21 payments, and improved fee rate defaults #863
3032
- Settings redesigned with tabbed navigation (General/Security/Advanced) with swipe support #857

app/src/main/java/to/bitkit/ui/ContentView.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ import to.bitkit.ui.screens.wallets.activity.ActivityExploreScreen
122122
import to.bitkit.ui.screens.wallets.activity.AllActivityScreen
123123
import to.bitkit.ui.screens.wallets.activity.DateRangeSelectorSheet
124124
import to.bitkit.ui.screens.wallets.activity.TagSelectorSheet
125+
import to.bitkit.ui.screens.wallets.receive.ReceiveRoute
125126
import to.bitkit.ui.screens.wallets.receive.ReceiveSheet
126127
import to.bitkit.ui.screens.wallets.suggestion.BuyIntroScreen
127128
import to.bitkit.ui.screens.widgets.AddWidgetsScreen
@@ -406,6 +407,7 @@ fun ContentView(
406407
is Sheet.Receive -> {
407408
val walletState by walletViewModel.walletState.collectAsStateWithLifecycle()
408409
ReceiveSheet(
410+
startRoute = sheet.route,
409411
walletState = walletState,
410412
navigateToExternalConnection = {
411413
navController.navigateTo(ExternalConnection())
@@ -505,7 +507,7 @@ fun ContentView(
505507
if (showTabBar) {
506508
TabBar(
507509
onSendClick = { appViewModel.showSheet(Sheet.Send()) },
508-
onReceiveClick = { appViewModel.showSheet(Sheet.Receive) },
510+
onReceiveClick = { appViewModel.showSheet(Sheet.Receive()) },
509511
onScanClick = { appViewModel.showScannerSheet() },
510512
)
511513
}
@@ -702,13 +704,12 @@ private fun RootNavHost(
702704
},
703705
onFund = {
704706
scope.launch {
705-
// TODO show receive sheet -> ReceiveAmount
706707
navController.navigateToHome()
707708
delay(500) // Wait for nav to actually finish
708-
appViewModel.showSheet(Sheet.Receive)
709+
appViewModel.showSheet(Sheet.Receive(route = ReceiveRoute.Amount))
709710
}
710711
},
711-
onAdvanced = { navController.navigateTo(Routes.FundingAdvanced) },
712+
onManual = { navController.navigateTo(Routes.ExternalNav) },
712713
onBackClick = { navController.popBackStack() },
713714
isGeoBlocked = isGeoBlocked,
714715
)
@@ -830,7 +831,7 @@ private fun NavGraphBuilder.home(
830831
onchainActivities = onchainActivities ?: persistentListOf(),
831832
onAllActivityButtonClick = { navController.navigateToAllActivity(activityListViewModel::clearFilters) },
832833
onActivityItemClick = { navController.navigateToActivityItem(it) },
833-
onEmptyActivityRowClick = { appViewModel.showSheet(Sheet.Receive) },
834+
onEmptyActivityRowClick = { appViewModel.showSheet(Sheet.Receive()) },
834835
onTransferToSpendingClick = {
835836
if (!hasSeenSpendingIntro) {
836837
navController.navigateToTransferSpendingIntro()
@@ -852,7 +853,7 @@ private fun NavGraphBuilder.home(
852853
lightningActivities = lightningActivities ?: persistentListOf(),
853854
onAllActivityButtonClick = { navController.navigateToAllActivity(activityListViewModel::clearFilters) },
854855
onActivityItemClick = { navController.navigateToActivityItem(it) },
855-
onEmptyActivityRowClick = { appViewModel.showSheet(Sheet.Receive) },
856+
onEmptyActivityRowClick = { appViewModel.showSheet(Sheet.Receive()) },
856857
onTransferToSavingsClick = {
857858
if (!hasSeenSavingsIntro) {
858859
navController.navigateToTransferSavingsIntro()

app/src/main/java/to/bitkit/ui/components/SheetHost.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import androidx.compose.ui.graphics.Color
2424
import androidx.compose.ui.unit.dp
2525
import kotlinx.coroutines.launch
2626
import to.bitkit.ui.shared.modifiers.clickableAlpha
27+
import to.bitkit.ui.screens.wallets.receive.ReceiveRoute
2728
import to.bitkit.ui.sheets.BackupRoute
2829
import to.bitkit.ui.sheets.PinRoute
2930
import to.bitkit.ui.sheets.SendRoute
@@ -37,7 +38,7 @@ private val sheetContainerColor = Color(0xFF141414) // Equivalent to White08 on
3738
@Stable
3839
sealed interface Sheet {
3940
data class Send(val route: SendRoute = SendRoute.Recipient) : Sheet
40-
data object Receive : Sheet
41+
data class Receive(val route: ReceiveRoute = ReceiveRoute.QR) : Sheet
4142
data class Pin(val route: PinRoute = PinRoute.Prompt()) : Sheet
4243
data object ChangePin : Sheet
4344
data object DisablePin : Sheet

app/src/main/java/to/bitkit/ui/components/Text.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,16 @@ fun BodyS(
256256
modifier: Modifier = Modifier,
257257
color: Color = MaterialTheme.colorScheme.primary,
258258
textAlign: TextAlign = TextAlign.Start,
259+
maxLines: Int = Int.MAX_VALUE,
260+
overflow: TextOverflow = TextOverflow.Clip,
259261
) {
260262
BodyS(
261263
text = AnnotatedString(text),
262-
modifier = modifier,
263264
color = color,
264265
textAlign = textAlign,
266+
maxLines = maxLines,
267+
overflow = overflow,
268+
modifier = modifier
265269
)
266270
}
267271

@@ -271,14 +275,18 @@ fun BodyS(
271275
modifier: Modifier = Modifier,
272276
color: Color = MaterialTheme.colorScheme.primary,
273277
textAlign: TextAlign = TextAlign.Start,
278+
maxLines: Int = Int.MAX_VALUE,
279+
overflow: TextOverflow = TextOverflow.Clip,
274280
) {
275281
Text(
276282
text = text,
277283
style = AppTextStyles.BodyS.merge(
278284
color = color,
279285
textAlign = textAlign,
280286
),
281-
modifier = modifier,
287+
maxLines = maxLines,
288+
overflow = overflow,
289+
modifier = modifier
282290
)
283291
}
284292

app/src/main/java/to/bitkit/ui/scaffold/AppAlertDialog.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import androidx.compose.material3.MaterialTheme
77
import androidx.compose.material3.TextButton
88
import androidx.compose.runtime.Composable
99
import androidx.compose.ui.Modifier
10+
import androidx.compose.ui.graphics.Color
1011
import androidx.compose.ui.platform.testTag
1112
import androidx.compose.ui.res.stringResource
1213
import androidx.compose.ui.semantics.semantics
@@ -30,6 +31,8 @@ fun AppAlertDialog(
3031
modifier: Modifier = Modifier,
3132
confirmText: String = stringResource(R.string.common__ok),
3233
dismissText: String = stringResource(R.string.common__dialog_cancel),
34+
confirmTextColor: Color = Color.Unspecified,
35+
dismissTextColor: Color = Colors.White64,
3336
onDismissRequest: () -> Unit = onDismiss,
3437
properties: DialogProperties = DialogProperties(
3538
dismissOnClickOutside = false,
@@ -43,6 +46,8 @@ fun AppAlertDialog(
4346
modifier = modifier,
4447
confirmText = confirmText,
4548
dismissText = dismissText,
49+
confirmTextColor = confirmTextColor,
50+
dismissTextColor = dismissTextColor,
4651
onDismissRequest = onDismissRequest,
4752
properties = properties,
4853
textContent = { BodyM(text = text, color = Colors.White64) },
@@ -57,6 +62,8 @@ fun AppAlertDialog(
5762
modifier: Modifier = Modifier,
5863
confirmText: String = stringResource(R.string.common__ok),
5964
dismissText: String = stringResource(R.string.common__dialog_cancel),
65+
confirmTextColor: Color = Color.Unspecified,
66+
dismissTextColor: Color = Colors.White64,
6067
onDismissRequest: () -> Unit = onDismiss,
6168
properties: DialogProperties = DialogProperties(
6269
dismissOnClickOutside = false,
@@ -71,15 +78,15 @@ fun AppAlertDialog(
7178
onClick = rememberDebouncedClick(onClick = onConfirm),
7279
modifier = Modifier.testTag("DialogConfirm")
7380
) {
74-
BodyMSB(text = confirmText)
81+
BodyMSB(text = confirmText, color = confirmTextColor)
7582
}
7683
},
7784
dismissButton = {
7885
TextButton(
7986
onClick = rememberDebouncedClick(onClick = onDismiss),
8087
modifier = Modifier.testTag("DialogCancel")
8188
) {
82-
BodyMSB(text = dismissText, color = Colors.White64)
89+
BodyMSB(text = dismissText, color = dismissTextColor)
8390
}
8491
},
8592
title = { Title(text = title) },

app/src/main/java/to/bitkit/ui/screens/transfer/FundingScreen.kt

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ import androidx.compose.foundation.layout.Spacer
77
import androidx.compose.foundation.layout.fillMaxWidth
88
import androidx.compose.foundation.layout.height
99
import androidx.compose.foundation.layout.padding
10-
import androidx.compose.material3.AlertDialog
11-
import androidx.compose.material3.MaterialTheme
12-
import androidx.compose.material3.TextButton
1310
import androidx.compose.runtime.Composable
1411
import androidx.compose.runtime.getValue
1512
import androidx.compose.runtime.mutableStateOf
@@ -24,9 +21,9 @@ import to.bitkit.R
2421
import to.bitkit.env.Defaults
2522
import to.bitkit.ui.LocalBalances
2623
import to.bitkit.ui.components.BodyM
27-
import to.bitkit.ui.components.BodyMB
2824
import to.bitkit.ui.components.Display
2925
import to.bitkit.ui.components.RectangleButton
26+
import to.bitkit.ui.scaffold.AppAlertDialog
3027
import to.bitkit.ui.scaffold.AppTopBar
3128
import to.bitkit.ui.scaffold.DrawerNavIcon
3229
import to.bitkit.ui.scaffold.ScreenColumn
@@ -40,7 +37,7 @@ fun FundingScreen(
4037
isGeoBlocked: Boolean,
4138
onTransfer: () -> Unit = {},
4239
onFund: () -> Unit = {},
43-
onAdvanced: () -> Unit = {},
40+
onManual: () -> Unit = {},
4441
onBackClick: () -> Unit = {},
4542
) {
4643
val balances = LocalBalances.current
@@ -106,29 +103,26 @@ fun FundingScreen(
106103
modifier = Modifier.testTag("FundReceive")
107104
)
108105
RectangleButton(
109-
label = stringResource(R.string.lightning__funding__button3),
110-
icon = R.drawable.ic_share_purple,
106+
label = stringResource(R.string.lightning__funding_advanced__button2),
107+
icon = R.drawable.ic_pencil_full,
111108
iconTint = Colors.Purple,
112-
onClick = onAdvanced,
113-
modifier = Modifier.testTag("FundCustom")
109+
iconSize = 13.37.dp,
110+
onClick = onManual,
111+
modifier = Modifier.testTag("FundManual")
114112
)
115113
}
116114
}
117115
if (showNoFundsAlert) {
118-
AlertDialog(
119-
onDismissRequest = { showNoFundsAlert = false },
120-
confirmButton = {
121-
TextButton(onClick = { showNoFundsAlert = false }) {
122-
BodyM(text = stringResource(R.string.common__ok), color = Colors.Purple)
123-
}
116+
AppAlertDialog(
117+
title = stringResource(R.string.lightning__no_funds__title),
118+
text = stringResource(R.string.lightning__no_funds__description),
119+
confirmText = stringResource(R.string.lightning__no_funds__fund_wallet),
120+
confirmTextColor = Colors.Purple,
121+
onConfirm = {
122+
showNoFundsAlert = false
123+
onFund()
124124
},
125-
title = {
126-
BodyMB(text = stringResource(R.string.lightning__no_funds__title))
127-
},
128-
text = {
129-
BodyM(text = stringResource(R.string.lightning__no_funds__description))
130-
},
131-
shape = MaterialTheme.shapes.small,
125+
onDismiss = { showNoFundsAlert = false },
132126
)
133127
}
134128
}

app/src/main/java/to/bitkit/ui/screens/wallets/activity/AllActivityScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fun AllActivityScreen(
7070
onTagClick = { app.showSheet(Sheet.ActivityTagSelector) },
7171
onDateRangeClick = { app.showSheet(Sheet.ActivityDateRangeSelector) },
7272
onActivityItemClick = onActivityItemClick,
73-
onEmptyActivityRowClick = { app.showSheet(Sheet.Receive) },
73+
onEmptyActivityRowClick = { app.showSheet(Sheet.Receive()) },
7474
)
7575
}
7676

app/src/main/java/to/bitkit/ui/screens/wallets/receive/ReceiveQrScreen.kt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ import androidx.compose.foundation.layout.Box
1010
import androidx.compose.foundation.layout.Column
1111
import androidx.compose.foundation.layout.PaddingValues
1212
import androidx.compose.foundation.layout.Row
13-
import androidx.compose.foundation.layout.Spacer
1413
import androidx.compose.foundation.layout.fillMaxHeight
1514
import androidx.compose.foundation.layout.fillMaxSize
1615
import androidx.compose.foundation.layout.fillMaxWidth
17-
import androidx.compose.foundation.layout.height
1816
import androidx.compose.foundation.layout.navigationBarsPadding
1917
import androidx.compose.foundation.layout.padding
2018
import androidx.compose.foundation.layout.size
@@ -45,6 +43,7 @@ import androidx.compose.ui.platform.LocalHapticFeedback
4543
import androidx.compose.ui.platform.testTag
4644
import androidx.compose.ui.res.painterResource
4745
import androidx.compose.ui.res.stringResource
46+
import androidx.compose.ui.text.style.TextOverflow
4847
import androidx.compose.ui.tooling.preview.Devices.NEXUS_5
4948
import androidx.compose.ui.tooling.preview.Preview
5049
import androidx.compose.ui.unit.dp
@@ -56,7 +55,6 @@ import kotlinx.coroutines.launch
5655
import org.lightningdevkit.ldknode.ChannelDetails
5756
import to.bitkit.R
5857
import to.bitkit.ext.setClipboardText
59-
import to.bitkit.ext.truncate
6058
import to.bitkit.models.NodeLifecycleState
6159
import to.bitkit.repositories.LightningState
6260
import to.bitkit.repositories.WalletState
@@ -199,7 +197,7 @@ fun ReceiveQrScreen(
199197
) {
200198
SheetTopBar(stringResource(R.string.wallet__receive_bitcoin))
201199
Column {
202-
Spacer(Modifier.height(16.dp))
200+
VerticalSpacer(16.dp)
203201

204202
// Tab row
205203
CustomTabRowWithSpacing(
@@ -221,7 +219,7 @@ fun ReceiveQrScreen(
221219
modifier = Modifier.padding(horizontal = 16.dp)
222220
)
223221

224-
Spacer(Modifier.height(24.dp))
222+
VerticalSpacer(24.dp)
225223

226224
// Content area (QR or Details) with LazyRow
227225
LazyRow(
@@ -268,6 +266,7 @@ fun ReceiveQrScreen(
268266
walletState.bip21,
269267
walletState.onchainAddress,
270268
)
269+
271270
else -> invoice
272271
}
273272

@@ -289,7 +288,7 @@ fun ReceiveQrScreen(
289288
}
290289
}
291290

292-
Spacer(Modifier.height(24.dp))
291+
VerticalSpacer(24.dp)
293292

294293
AnimatedVisibility(visible = lightningState.nodeLifecycleState.isRunning()) {
295294
val showCjitButton = showingCjitOnboarding && selectedTab == ReceiveTab.SPENDING
@@ -332,7 +331,7 @@ fun ReceiveQrScreen(
332331
)
333332
}
334333

335-
Spacer(Modifier.height(16.dp))
334+
VerticalSpacer(16.dp)
336335
}
337336
}
338337
}
@@ -366,7 +365,7 @@ private fun ReceiveQrView(
366365
modifier = Modifier.weight(1f, fill = false)
367366
)
368367

369-
Spacer(modifier = Modifier.height(16.dp))
368+
VerticalSpacer(16.dp)
370369
Row(
371370
horizontalArrangement = Arrangement.spacedBy(16.dp),
372371
verticalAlignment = Alignment.Top,
@@ -434,7 +433,7 @@ private fun ReceiveQrView(
434433
modifier = Modifier.weight(1f)
435434
)
436435
}
437-
Spacer(modifier = Modifier.height(16.dp))
436+
VerticalSpacer(16.dp)
438437
}
439438
}
440439

@@ -577,12 +576,14 @@ private fun CopyAddressCard(
577576
.padding(24.dp)
578577
) {
579578
Caption13Up(text = title, color = Colors.White64)
580-
Spacer(modifier = Modifier.height(16.dp))
579+
VerticalSpacer(16.dp)
581580
BodyS(
582-
text = (body ?: address).truncate(32).uppercase(),
581+
text = (body ?: address).uppercase(),
582+
maxLines = 1,
583+
overflow = TextOverflow.MiddleEllipsis,
583584
modifier = testTag?.let { Modifier.testTag(it) } ?: Modifier
584585
)
585-
Spacer(modifier = Modifier.height(16.dp))
586+
VerticalSpacer(16.dp)
586587
Row(
587588
horizontalArrangement = Arrangement.spacedBy(16.dp)
588589
) {
@@ -862,7 +863,8 @@ private fun PreviewDetailsMode() {
862863
tab = ReceiveTab.AUTO,
863864
walletState = WalletState(
864865
onchainAddress = "bcrt1qfserxgtuesul4m9zva56wzk849yf9l8rk4qy0l",
865-
bolt11 = "lnbcrt500u1pn7umn7pp5x0s9lt9fwrff6rp70pz3guwnjgw97sjuv79...",
866+
bolt11 = "lnbcrt500u1pn7umn7pp5x0s9lt9fwrff6rp70pz3guwnjgw97sjuv79vhx9n2ps8q6tcdehhxapqd9h8vmmfv" +
867+
"djjqen0wgsyqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxqcrqvpsxq"
866868
),
867869
cjitInvoice = null,
868870
onClickEditInvoice = {},

0 commit comments

Comments
 (0)