Skip to content

Commit fffa684

Browse files
authored
Merge pull request #519 from synonymdev/feat/new-share-icon
feat: new share icon
2 parents 56d1b4a + 5fea2b5 commit fffa684

File tree

3 files changed

+58
-40
lines changed

3 files changed

+58
-40
lines changed

.idea/codeStyles/Project.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.height
1818
import androidx.compose.foundation.layout.navigationBarsPadding
1919
import androidx.compose.foundation.layout.padding
2020
import androidx.compose.foundation.layout.size
21-
import androidx.compose.foundation.layout.width
2221
import androidx.compose.foundation.lazy.LazyRow
2322
import androidx.compose.foundation.lazy.itemsIndexed
2423
import androidx.compose.foundation.lazy.rememberLazyListState
@@ -236,6 +235,7 @@ fun ReceiveQrScreen(
236235
tab = tab,
237236
walletState = walletState,
238237
cjitInvoice = cjitInvoice,
238+
onClickEditInvoice = onClickEditInvoice,
239239
modifier = Modifier.weight(1f)
240240
)
241241
}
@@ -458,6 +458,7 @@ private fun ReceiveDetailsView(
458458
tab: ReceiveTab,
459459
walletState: MainUiState,
460460
cjitInvoice: String?,
461+
onClickEditInvoice: () -> Unit,
461462
modifier: Modifier = Modifier,
462463
) {
463464
Card(
@@ -477,6 +478,7 @@ private fun ReceiveDetailsView(
477478
),
478479
body = walletState.onchainAddress,
479480
type = CopyAddressType.ONCHAIN,
481+
onClickEditInvoice = onClickEditInvoice,
480482
testTag = "ReceiveOnchainAddress",
481483
)
482484
}
@@ -493,6 +495,7 @@ private fun ReceiveDetailsView(
493495
),
494496
body = walletState.onchainAddress,
495497
type = CopyAddressType.ONCHAIN,
498+
onClickEditInvoice = onClickEditInvoice,
496499
testTag = "ReceiveOnchainAddress",
497500
)
498501
}
@@ -501,6 +504,7 @@ private fun ReceiveDetailsView(
501504
title = stringResource(R.string.wallet__receive_lightning_invoice),
502505
address = cjitInvoice ?: walletState.bolt11,
503506
type = CopyAddressType.LIGHTNING,
507+
onClickEditInvoice = onClickEditInvoice,
504508
testTag = "ReceiveLightningAddress",
505509
)
506510
}
@@ -512,6 +516,7 @@ private fun ReceiveDetailsView(
512516
title = stringResource(R.string.wallet__receive_lightning_invoice),
513517
address = cjitInvoice ?: walletState.bolt11,
514518
type = CopyAddressType.LIGHTNING,
519+
onClickEditInvoice = onClickEditInvoice,
515520
testTag = "ReceiveLightningAddress",
516521
)
517522
}
@@ -529,6 +534,7 @@ private fun CopyAddressCard(
529534
title: String,
530535
address: String,
531536
type: CopyAddressType,
537+
onClickEditInvoice: () -> Unit,
532538
body: String? = null,
533539
testTag: String? = null,
534540
) {
@@ -542,14 +548,7 @@ private fun CopyAddressCard(
542548
.fillMaxWidth()
543549
.padding(24.dp)
544550
) {
545-
Row {
546-
Caption13Up(text = title, color = Colors.White64)
547-
548-
Spacer(modifier = Modifier.width(3.dp))
549-
550-
val iconRes = if (type == CopyAddressType.ONCHAIN) R.drawable.ic_bitcoin else R.drawable.ic_lightning_alt
551-
Icon(painter = painterResource(iconRes), contentDescription = null, tint = Colors.White64)
552-
}
551+
Caption13Up(text = title, color = Colors.White64)
553552
Spacer(modifier = Modifier.height(16.dp))
554553
BodyS(
555554
text = (body ?: address).truncate(32).uppercase(),
@@ -559,28 +558,48 @@ private fun CopyAddressCard(
559558
Row(
560559
horizontalArrangement = Arrangement.spacedBy(16.dp)
561560
) {
561+
PrimaryButton(
562+
text = stringResource(R.string.common__edit),
563+
size = ButtonSize.Small,
564+
onClick = onClickEditInvoice,
565+
fullWidth = false,
566+
color = Colors.White10,
567+
icon = {
568+
Icon(
569+
painter = painterResource(R.drawable.ic_pencil_simple),
570+
contentDescription = null,
571+
tint = if (type == CopyAddressType.ONCHAIN) Colors.Brand else Colors.Purple,
572+
modifier = Modifier.size(18.dp)
573+
)
574+
},
575+
modifier = Modifier
576+
.weight(1f)
577+
.testTag("SpecifyInvoiceButton")
578+
)
562579
Tooltip(
563580
text = stringResource(R.string.wallet__receive_copied),
564581
tooltipState = tooltipState,
565582
) {
566-
PrimaryButton(
567-
text = stringResource(R.string.common__copy),
568-
size = ButtonSize.Small,
569-
onClick = {
570-
context.setClipboardText(address)
571-
coroutineScope.launch { tooltipState.show() }
572-
},
573-
fullWidth = false,
574-
color = Colors.White10,
575-
icon = {
576-
Icon(
577-
painter = painterResource(R.drawable.ic_copy),
578-
contentDescription = null,
579-
tint = if (type == CopyAddressType.ONCHAIN) Colors.Brand else Colors.Purple,
580-
modifier = Modifier.size(18.dp)
581-
)
582-
},
583-
)
583+
Box(modifier = Modifier.weight(1f)) {
584+
PrimaryButton(
585+
text = stringResource(R.string.common__copy),
586+
size = ButtonSize.Small,
587+
onClick = {
588+
context.setClipboardText(address)
589+
coroutineScope.launch { tooltipState.show() }
590+
},
591+
fullWidth = false,
592+
color = Colors.White10,
593+
icon = {
594+
Icon(
595+
painter = painterResource(R.drawable.ic_copy),
596+
contentDescription = null,
597+
tint = if (type == CopyAddressType.ONCHAIN) Colors.Brand else Colors.Purple,
598+
modifier = Modifier.size(18.dp)
599+
)
600+
},
601+
)
602+
}
584603
}
585604
PrimaryButton(
586605
text = stringResource(R.string.common__share),
@@ -810,6 +829,7 @@ private fun PreviewDetailsMode() {
810829
bolt11 = "lnbcrt500u1pn7umn7pp5x0s9lt9fwrff6rp70pz3guwnjgw97sjuv79...",
811830
),
812831
cjitInvoice = null,
832+
onClickEditInvoice = {},
813833
modifier = Modifier.weight(1f)
814834
)
815835
}
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2-
android:width="32dp"
3-
android:height="32dp"
4-
android:viewportWidth="32"
5-
android:viewportHeight="32">
2+
android:width="16dp"
3+
android:height="16dp"
4+
android:viewportWidth="16"
5+
android:viewportHeight="16">
66
<path
7-
android:pathData="M22,29a4,4 0,1 0,0 -8,4 4,0 0,0 0,8M22,11a4,4 0,1 0,0 -8,4 4,0 0,0 0,8"
8-
android:strokeAlpha="0.2"
9-
android:fillColor="#FFFFFF"
10-
android:fillAlpha="0.2"/>
7+
android:pathData="M10.646,3.146C10.842,2.951 11.158,2.951 11.354,3.146L14.354,6.146C14.549,6.342 14.549,6.658 14.354,6.854L11.354,9.854C11.158,10.049 10.842,10.049 10.646,9.854C10.451,9.658 10.451,9.342 10.646,9.146L13.293,6.5L10.646,3.854C10.451,3.658 10.451,3.342 10.646,3.146Z"
8+
android:fillColor="#FF4400"
9+
android:fillType="evenOdd"/>
1110
<path
12-
android:pathData="M8,13a3,3 0,1 0,0 6,3 3,0 0,0 0,-6m-5,3a5,5 0,1 1,10 0,5 5,0 0,1 -10,0M22,22a3,3 0,1 0,0 6,3 3,0 0,0 0,-6m-5,3a5,5 0,1 1,10 0,5 5,0 0,1 -10,0M22,4a3,3 0,1 0,0 6,3 3,0 0,0 0,-6m-5,3a5,5 0,1 1,10 0,5 5,0 0,1 -10,0"
13-
android:fillColor="#FFFFFF"
11+
android:pathData="M2,5C2.276,5 2.5,5.224 2.5,5.5V13H12C12.276,13 12.5,13.224 12.5,13.5C12.5,13.776 12.276,14 12,14H2.5C2.235,14 1.98,13.895 1.793,13.707C1.605,13.52 1.5,13.265 1.5,13V5.5C1.5,5.224 1.724,5 2,5Z"
12+
android:fillColor="#FF4400"
1413
android:fillType="evenOdd"/>
1514
<path
16-
android:pathData="M19.477,8.622a1,1 0,0 1,-0.3 1.382l-7.272,4.675a1,1 0,1 1,-1.082 -1.683l7.272,-4.674a1,1 0,0 1,1.382 0.3M10.523,17.622a1,1 0,0 1,1.382 -0.3l7.271,4.674a1,1 0,1 1,-1.081 1.682l-7.272,-4.674a1,1 0,0 1,-0.3 -1.382"
17-
android:fillColor="#FFFFFF"
15+
android:pathData="M10.5,7C9.28,7 8.095,7.405 7.131,8.152C6.167,8.899 5.478,9.944 5.173,11.125C5.104,11.392 4.831,11.553 4.563,11.484C4.296,11.415 4.135,11.142 4.205,10.875C4.565,9.48 5.379,8.244 6.519,7.361C7.658,6.479 9.058,6 10.5,6H14C14.276,6 14.5,6.224 14.5,6.5C14.5,6.776 14.276,7 14,7H10.5C10.5,7 10.5,7 10.5,7Z"
16+
android:fillColor="#FF4400"
1817
android:fillType="evenOdd"/>
1918
</vector>

0 commit comments

Comments
 (0)