@@ -23,6 +23,8 @@ import com.synonym.bitkitcore.OnchainActivity
2323import com.synonym.bitkitcore.PaymentState
2424import com.synonym.bitkitcore.PaymentType
2525import to.bitkit.R
26+ import to.bitkit.ext.isBoosted
27+ import to.bitkit.ext.isFinished
2628import to.bitkit.ui.theme.AppThemeSurface
2729import to.bitkit.ui.theme.Colors
2830
@@ -43,49 +45,63 @@ fun ActivityIcon(
4345 }
4446 val arrowIcon = painterResource(if (txType == PaymentType .SENT ) R .drawable.ic_sent else R .drawable.ic_received)
4547
46- if (isLightning) {
47- when (status) {
48- PaymentState .FAILED -> {
49- CircularIcon (
50- icon = painterResource(R .drawable.ic_x),
51- iconColor = Colors .Purple ,
52- backgroundColor = Colors .Purple16 ,
53- size = size,
54- modifier = modifier,
55- )
56- }
48+ when {
49+ activity.isBoosted() && ! activity.isFinished() -> {
50+ CircularIcon (
51+ icon = painterResource(R .drawable.ic_timer_alt),
52+ iconColor = Colors .Yellow ,
53+ backgroundColor = Colors .Yellow16 ,
54+ size = size,
55+ modifier = modifier,
56+ )
57+ }
5758
58- PaymentState .PENDING -> {
59- CircularIcon (
60- icon = painterResource(R .drawable.ic_hourglass_simple),
61- iconColor = Colors .Purple ,
62- backgroundColor = Colors .Purple16 ,
63- size = size,
64- modifier = modifier,
65- )
66- }
59+ isLightning -> {
60+ when (status) {
61+ PaymentState .FAILED -> {
62+ CircularIcon (
63+ icon = painterResource(R .drawable.ic_x),
64+ iconColor = Colors .Purple ,
65+ backgroundColor = Colors .Purple16 ,
66+ size = size,
67+ modifier = modifier,
68+ )
69+ }
6770
68- else -> {
69- CircularIcon (
70- icon = arrowIcon,
71- iconColor = Colors .Purple ,
72- backgroundColor = Colors .Purple16 ,
73- size = size,
74- modifier = modifier,
75- )
71+ PaymentState .PENDING -> {
72+ CircularIcon (
73+ icon = painterResource(R .drawable.ic_hourglass_simple),
74+ iconColor = Colors .Purple ,
75+ backgroundColor = Colors .Purple16 ,
76+ size = size,
77+ modifier = modifier,
78+ )
79+ }
80+
81+ else -> {
82+ CircularIcon (
83+ icon = arrowIcon,
84+ iconColor = Colors .Purple ,
85+ backgroundColor = Colors .Purple16 ,
86+ size = size,
87+ modifier = modifier,
88+ )
89+ }
7690 }
7791 }
78- } else {
79- val isTransfer = (activity as ? Activity .Onchain )?.v1?.isTransfer == true
80- val onChainIcon = if (isTransfer) painterResource(R .drawable.ic_transfer) else arrowIcon
81-
82- CircularIcon (
83- icon = onChainIcon,
84- iconColor = Colors .Brand ,
85- backgroundColor = Colors .Brand16 ,
86- size = size,
87- modifier = modifier,
88- )
92+
93+ else -> {
94+ val isTransfer = (activity as ? Activity .Onchain )?.v1?.isTransfer == true
95+ val onChainIcon = if (isTransfer) painterResource(R .drawable.ic_transfer) else arrowIcon
96+
97+ CircularIcon (
98+ icon = onChainIcon,
99+ iconColor = Colors .Brand ,
100+ backgroundColor = Colors .Brand16 ,
101+ size = size,
102+ modifier = modifier,
103+ )
104+ }
89105 }
90106}
91107
@@ -202,6 +218,56 @@ private fun Preview() {
202218 )
203219 )
204220
221+ // Onchain BOOST CPFP
222+ ActivityIcon (
223+ activity = Activity .Onchain (
224+ v1 = OnchainActivity (
225+ id = " test-onchain-1" ,
226+ txType = PaymentType .RECEIVED ,
227+ txId = " abc123" ,
228+ value = 100000uL ,
229+ fee = 500uL ,
230+ feeRate = 8uL ,
231+ address = " bc1..." ,
232+ confirmed = false ,
233+ timestamp = (System .currentTimeMillis() / 1000 ).toULong(),
234+ isBoosted = true ,
235+ isTransfer = false ,
236+ doesExist = true ,
237+ confirmTimestamp = (System .currentTimeMillis() / 1000 ).toULong(),
238+ channelId = null ,
239+ transferTxId = null ,
240+ createdAt = null ,
241+ updatedAt = null ,
242+ )
243+ )
244+ )
245+
246+ // Onchain BOOST RBF
247+ ActivityIcon (
248+ activity = Activity .Onchain (
249+ v1 = OnchainActivity (
250+ id = " test-onchain-1" ,
251+ txType = PaymentType .SENT ,
252+ txId = " abc123" ,
253+ value = 100000uL ,
254+ fee = 500uL ,
255+ feeRate = 8uL ,
256+ address = " bc1..." ,
257+ confirmed = false ,
258+ timestamp = (System .currentTimeMillis() / 1000 ).toULong(),
259+ isBoosted = true ,
260+ isTransfer = false ,
261+ doesExist = true ,
262+ confirmTimestamp = (System .currentTimeMillis() / 1000 ).toULong(),
263+ channelId = null ,
264+ transferTxId = null ,
265+ createdAt = null ,
266+ updatedAt = null ,
267+ )
268+ )
269+ )
270+
205271 // Onchain Transfer
206272 ActivityIcon (
207273 activity = Activity .Onchain (
0 commit comments