Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
Expand Down Expand Up @@ -236,6 +235,7 @@ fun ReceiveQrScreen(
tab = tab,
walletState = walletState,
cjitInvoice = cjitInvoice,
onClickEditInvoice = onClickEditInvoice,
modifier = Modifier.weight(1f)
)
}
Expand Down Expand Up @@ -458,6 +458,7 @@ private fun ReceiveDetailsView(
tab: ReceiveTab,
walletState: MainUiState,
cjitInvoice: String?,
onClickEditInvoice: () -> Unit,
modifier: Modifier = Modifier,
) {
Card(
Expand All @@ -477,6 +478,7 @@ private fun ReceiveDetailsView(
),
body = walletState.onchainAddress,
type = CopyAddressType.ONCHAIN,
onClickEditInvoice = onClickEditInvoice,
testTag = "ReceiveOnchainAddress",
)
}
Expand All @@ -493,6 +495,7 @@ private fun ReceiveDetailsView(
),
body = walletState.onchainAddress,
type = CopyAddressType.ONCHAIN,
onClickEditInvoice = onClickEditInvoice,
testTag = "ReceiveOnchainAddress",
)
}
Expand All @@ -501,6 +504,7 @@ private fun ReceiveDetailsView(
title = stringResource(R.string.wallet__receive_lightning_invoice),
address = cjitInvoice ?: walletState.bolt11,
type = CopyAddressType.LIGHTNING,
onClickEditInvoice = onClickEditInvoice,
testTag = "ReceiveLightningAddress",
)
}
Expand All @@ -512,6 +516,7 @@ private fun ReceiveDetailsView(
title = stringResource(R.string.wallet__receive_lightning_invoice),
address = cjitInvoice ?: walletState.bolt11,
type = CopyAddressType.LIGHTNING,
onClickEditInvoice = onClickEditInvoice,
testTag = "ReceiveLightningAddress",
)
}
Expand All @@ -529,6 +534,7 @@ private fun CopyAddressCard(
title: String,
address: String,
type: CopyAddressType,
onClickEditInvoice: () -> Unit,
body: String? = null,
testTag: String? = null,
) {
Expand All @@ -542,14 +548,7 @@ private fun CopyAddressCard(
.fillMaxWidth()
.padding(24.dp)
) {
Row {
Caption13Up(text = title, color = Colors.White64)

Spacer(modifier = Modifier.width(3.dp))

val iconRes = if (type == CopyAddressType.ONCHAIN) R.drawable.ic_bitcoin else R.drawable.ic_lightning_alt
Icon(painter = painterResource(iconRes), contentDescription = null, tint = Colors.White64)
}
Caption13Up(text = title, color = Colors.White64)
Spacer(modifier = Modifier.height(16.dp))
BodyS(
text = (body ?: address).truncate(32).uppercase(),
Expand All @@ -559,28 +558,48 @@ private fun CopyAddressCard(
Row(
horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
PrimaryButton(
text = stringResource(R.string.common__edit),
size = ButtonSize.Small,
onClick = onClickEditInvoice,
fullWidth = false,
color = Colors.White10,
icon = {
Icon(
painter = painterResource(R.drawable.ic_pencil_simple),
contentDescription = null,
tint = if (type == CopyAddressType.ONCHAIN) Colors.Brand else Colors.Purple,
modifier = Modifier.size(18.dp)
)
},
modifier = Modifier
.weight(1f)
.testTag("SpecifyInvoiceButton")
)
Tooltip(
text = stringResource(R.string.wallet__receive_copied),
tooltipState = tooltipState,
) {
PrimaryButton(
text = stringResource(R.string.common__copy),
size = ButtonSize.Small,
onClick = {
context.setClipboardText(address)
coroutineScope.launch { tooltipState.show() }
},
fullWidth = false,
color = Colors.White10,
icon = {
Icon(
painter = painterResource(R.drawable.ic_copy),
contentDescription = null,
tint = if (type == CopyAddressType.ONCHAIN) Colors.Brand else Colors.Purple,
modifier = Modifier.size(18.dp)
)
},
)
Box(modifier = Modifier.weight(1f)) {
PrimaryButton(
text = stringResource(R.string.common__copy),
size = ButtonSize.Small,
onClick = {
context.setClipboardText(address)
coroutineScope.launch { tooltipState.show() }
},
fullWidth = false,
color = Colors.White10,
icon = {
Icon(
painter = painterResource(R.drawable.ic_copy),
contentDescription = null,
tint = if (type == CopyAddressType.ONCHAIN) Colors.Brand else Colors.Purple,
modifier = Modifier.size(18.dp)
)
},
)
}
}
PrimaryButton(
text = stringResource(R.string.common__share),
Expand Down Expand Up @@ -810,6 +829,7 @@ private fun PreviewDetailsMode() {
bolt11 = "lnbcrt500u1pn7umn7pp5x0s9lt9fwrff6rp70pz3guwnjgw97sjuv79...",
),
cjitInvoice = null,
onClickEditInvoice = {},
modifier = Modifier.weight(1f)
)
}
Expand Down
23 changes: 11 additions & 12 deletions app/src/main/res/drawable/ic_share.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="32"
android:viewportHeight="32">
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
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"
android:strokeAlpha="0.2"
android:fillColor="#FFFFFF"
android:fillAlpha="0.2"/>
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"
android:fillColor="#FF4400"
android:fillType="evenOdd"/>
<path
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"
android:fillColor="#FFFFFF"
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"
android:fillColor="#FF4400"
android:fillType="evenOdd"/>
<path
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"
android:fillColor="#FFFFFF"
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"
android:fillColor="#FF4400"
android:fillType="evenOdd"/>
</vector>
Loading