Skip to content

Commit 73bad57

Browse files
committed
Merge branch 'feat/new-receive-sheet' into feat/send-sheet-redesign
2 parents bd7ffe6 + 805dd54 commit 73bad57

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import androidx.compose.ui.platform.LocalContext
3535
import androidx.compose.ui.platform.LocalDensity
3636
import androidx.compose.ui.platform.testTag
3737
import androidx.compose.ui.res.painterResource
38+
import androidx.compose.ui.res.stringResource
3839
import androidx.compose.ui.tooling.preview.Preview
3940
import androidx.compose.ui.unit.Dp
4041
import androidx.compose.ui.unit.dp
@@ -143,7 +144,7 @@ fun QrCodeImage(
143144
}
144145

145146
if (bitmap == null) {
146-
CaptionB("Generating QR ...", color = Colors.Black)
147+
CaptionB(stringResource(R.string.wallet__receive_qr_generating), color = Colors.Black)
147148
}
148149
}
149150
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ private fun ReceiveQrView(
281281
QrCodeImage(
282282
content = uri,
283283
logoPainter = qrLogoPainter,
284-
tipMessage = androidx.compose.ui.res.stringResource(R.string.wallet__receive_copied),
284+
tipMessage = stringResource(R.string.wallet__receive_copied),
285285
onBitmapGenerated = { bitmap -> qrBitmap = bitmap },
286286
testTag = "QRCode",
287287
modifier = Modifier.weight(1f, fill = false)
@@ -293,7 +293,7 @@ private fun ReceiveQrView(
293293
verticalAlignment = Alignment.Top,
294294
) {
295295
PrimaryButton(
296-
text = androidx.compose.ui.res.stringResource(R.string.common__edit),
296+
text = stringResource(R.string.common__edit),
297297
size = ButtonSize.Small,
298298
onClick = onClickEditInvoice,
299299
fullWidth = false,
@@ -313,11 +313,11 @@ private fun ReceiveQrView(
313313
modifier = Modifier.testTag("SpecifyInvoiceButton")
314314
)
315315
Tooltip(
316-
text = androidx.compose.ui.res.stringResource(R.string.wallet__receive_copied),
316+
text = stringResource(R.string.wallet__receive_copied),
317317
tooltipState = qrButtonTooltipState
318318
) {
319319
PrimaryButton(
320-
text = androidx.compose.ui.res.stringResource(R.string.common__copy),
320+
text = stringResource(R.string.common__copy),
321321
size = ButtonSize.Small,
322322
onClick = {
323323
context.setClipboardText(uri)
@@ -341,7 +341,7 @@ private fun ReceiveQrView(
341341
)
342342
}
343343
PrimaryButton(
344-
text = androidx.compose.ui.res.stringResource(R.string.common__share),
344+
text = stringResource(R.string.common__share),
345345
size = ButtonSize.Small,
346346
onClick = {
347347
qrBitmap?.let { bitmap ->
@@ -377,10 +377,10 @@ fun CjitOnBoardingView(modifier: Modifier = Modifier) {
377377
.padding(32.dp),
378378
horizontalAlignment = Alignment.CenterHorizontally
379379
) {
380-
Display("Receive on <accent>spending balance</accent>".withAccent(accentColor = Colors.Purple))
380+
Display(stringResource(R.string.wallet__receive_onboarding_title).withAccent(accentColor = Colors.Purple))
381381
VerticalSpacer(8.dp)
382382
BodyM(
383-
"Enjoy instant and cheap\ntransactions with friends, family,\nand merchants.",
383+
stringResource(R.string.wallet__receive_onboarding_description),
384384
color = Colors.White64,
385385
modifier = Modifier.fillMaxWidth()
386386
)
@@ -441,15 +441,15 @@ private fun ReceiveDetailsView(
441441
// Show both onchain AND lightning if available
442442
if (onchainAddress.isNotEmpty()) {
443443
CopyAddressCard(
444-
title = androidx.compose.ui.res.stringResource(R.string.wallet__receive_bitcoin_invoice),
444+
title = stringResource(R.string.wallet__receive_bitcoin_invoice),
445445
address = onchainAddress,
446446
type = CopyAddressType.ONCHAIN,
447447
testTag = "ReceiveOnchainAddress",
448448
)
449449
}
450450
if (cjitInvoice != null || bolt11.isNotEmpty()) {
451451
CopyAddressCard(
452-
title = androidx.compose.ui.res.stringResource(R.string.wallet__receive_lightning_invoice),
452+
title = stringResource(R.string.wallet__receive_lightning_invoice),
453453
address = cjitInvoice ?: bolt11,
454454
type = CopyAddressType.LIGHTNING,
455455
testTag = "ReceiveLightningAddress",
@@ -460,7 +460,7 @@ private fun ReceiveDetailsView(
460460
ReceiveTab.SPENDING -> {
461461
if (cjitInvoice != null || bolt11.isNotEmpty()) {
462462
CopyAddressCard(
463-
title = androidx.compose.ui.res.stringResource(R.string.wallet__receive_lightning_invoice),
463+
title = stringResource(R.string.wallet__receive_lightning_invoice),
464464
address = cjitInvoice ?: bolt11,
465465
type = CopyAddressType.LIGHTNING,
466466
testTag = "ReceiveLightningAddress",

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ import androidx.compose.runtime.remember
1111
import androidx.compose.ui.Modifier
1212
import androidx.compose.ui.platform.LocalContext
1313
import androidx.compose.ui.platform.testTag
14+
import androidx.compose.ui.res.stringResource
1415
import androidx.hilt.navigation.compose.hiltViewModel
1516
import androidx.lifecycle.compose.collectAsStateWithLifecycle
1617
import androidx.navigation.compose.NavHost
1718
import androidx.navigation.compose.rememberNavController
1819
import kotlinx.serialization.Serializable
20+
import to.bitkit.R
1921
import to.bitkit.models.Toast
2022
import to.bitkit.repositories.LightningState
2123
import to.bitkit.ui.screens.wallets.send.AddTagScreen
@@ -45,6 +47,9 @@ fun ReceiveSheet(
4547
val cjitEntryDetails = remember { mutableStateOf<CjitEntryDetails?>(null) }
4648
val lightningState: LightningState by wallet.lightningState.collectAsStateWithLifecycle()
4749

50+
val geoBlockedTitle = stringResource(R.string.wallet__receive_geo_blocked_title)
51+
val geoBlockedDescription = stringResource(R.string.wallet__receive_geo_blocked_description)
52+
4853
LaunchedEffect(Unit) {
4954
wallet.resetPreActivityMetadataTagsForCurrentInvoice()
5055
wallet.refreshReceiveState()
@@ -84,8 +89,8 @@ fun ReceiveSheet(
8489
toast(
8590
Toast(
8691
type = Toast.ToastType.ERROR,
87-
title = "Instant Payments Unavailable",
88-
description = "Bitkit does not provide Lightning services in your country, but you can still connect to other nodes.",
92+
title = geoBlockedTitle,
93+
description = geoBlockedDescription,
8994
autoHide = true,
9095
)
9196
)

app/src/main/res/values/strings.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,11 @@
983983
<string name="wallet__receive_cjit_error_msg">Failed to send funds to your spending account.</string>
984984
<string name="wallet__receive_will">You will receive</string>
985985
<string name="wallet__receive_ldk_init">Spending Balance Initializing...</string>
986+
<string name="wallet__receive_onboarding_title">Receive on &lt;accent&gt;spending balance&lt;/accent&gt;</string>
987+
<string name="wallet__receive_onboarding_description">Enjoy instant and cheap\ntransactions with friends, family,\nand merchants.</string>
988+
<string name="wallet__receive_qr_generating">Generating QR ...</string>
989+
<string name="wallet__receive_geo_blocked_title">Instant Payments Unavailable</string>
990+
<string name="wallet__receive_geo_blocked_description">Bitkit does not provide Lightning services in your country, but you can still connect to other nodes.</string>
986991
<string name="wallet__minimum">MINIMUM</string>
987992
<string name="wallet__activity">Activity</string>
988993
<string name="wallet__activity_show_all">Show All Activity</string>

0 commit comments

Comments
 (0)