Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2dbdeb4
Update phoenix-shared to new on-the-fly
dpad85 Sep 25, 2024
e4b7f8b
(android) Update the payment screens for liquidity purchases
dpad85 Sep 25, 2024
702c612
Update to lightning-kmp snapshot (wip)
dpad85 Sep 26, 2024
d504268
Add method to get purchases related to an incoming payment
dpad85 Sep 27, 2024
ce3618e
(android) Use lightning-kmp method to determine whether liquidity fee…
dpad85 Sep 27, 2024
b517e68
Fix testnet3 chain in explorer links
dpad85 Sep 27, 2024
f616a95
(android) Simplify liquidity screen
dpad85 Sep 30, 2024
42eba9e
(android) Add links to related payments in liquidity splash
dpad85 Sep 30, 2024
c0eaa5f
(android) Switched help button and clean code
dpad85 Sep 30, 2024
9cbe20c
(android) Normalise splash row height
dpad85 Oct 1, 2024
699af11
(android) Update wording and add translations
dpad85 Oct 1, 2024
3ddc323
(android) Complete Portuguese (BR) translation
dpad85 Oct 1, 2024
bc48b8b
(ios) Fix compilation on the command line
robbiehanson Oct 1, 2024
ef07ee9
(ios) Project now compiles
robbiehanson Oct 1, 2024
d7e7832
Standardizing chain name across codebase via `chain.phoenixName`.
robbiehanson Oct 1, 2024
f9c15c1
(ios) WIP: Updating UI
robbiehanson Oct 1, 2024
a764b4c
(ios) WIP: Updating UI
robbiehanson Oct 1, 2024
58e1d47
(ios) Fixing compiler error post-rebase
robbiehanson Oct 1, 2024
8547442
(ios) WIP: Updating UI
robbiehanson Oct 1, 2024
9fc7789
Fix duplicate fee in CSV export
dpad85 Oct 2, 2024
f03a746
(android) Fix isolated business initialization
dpad85 Oct 3, 2024
e0ad073
Use lightning-kmp v1.8.0
dpad85 Oct 3, 2024
57a6bc5
(android) Resize payment link button in liquidity details
dpad85 Oct 3, 2024
900f860
(android) Added missing translations for new strings
dpad85 Oct 4, 2024
99cf2c7
Fix tests
dpad85 Oct 4, 2024
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
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object Versions {
const val lightningKmp = "1.7.3"
const val lightningKmp = "1.8.0"
const val secp256k1 = "0.14.0"
const val torMobile = "0.2.0"

Expand All @@ -18,7 +18,7 @@ object Versions {
const val lifecycle = "2.6.0"
const val prefs = "1.2.0"
const val datastore = "1.0.0"
const val compose = "1.6.2"
const val compose = "1.6.8"
const val composeCompiler = "1.5.8"
const val navCompose = "2.6.0"
const val accompanist = "0.30.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright 2024 ACINQ SAS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package fr.acinq.phoenix.android.components

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.MaterialTheme
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun BottomSheetDialog(
onDismiss: () -> Unit,
modifier: Modifier = Modifier,
skipPartiallyExpanded: Boolean = true,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
scrimAlpha: Float = 0.2f,
internalPadding: PaddingValues = PaddingValues(top = 0.dp, start = 20.dp, end = 20.dp, bottom = 64.dp),
content: @Composable ColumnScope.() -> Unit,
) {
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded)
ModalBottomSheet(
sheetState = sheetState,
onDismissRequest = {
// executed when user click outside the sheet, and after sheet has been hidden thru state.
onDismiss()
},
modifier = modifier,
containerColor = MaterialTheme.colors.surface,
contentColor = MaterialTheme.colors.onSurface,
scrimColor = MaterialTheme.colors.onBackground.copy(alpha = scrimAlpha),
) {
Column(
horizontalAlignment = horizontalAlignment,
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight()
.verticalScroll(rememberScrollState())
.padding(internalPadding)
) {
content()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,13 @@ fun Button(
}
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun Clickable(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
onLongClick: (() -> Unit)? = null,
textStyle: TextStyle = MaterialTheme.typography.button,
backgroundColor: Color = Color.Unspecified, // transparent by default!
shape: Shape = RectangleShape,
Expand All @@ -360,8 +362,11 @@ fun Clickable(
elevation = 0.dp,
modifier = modifier
.clip(shape)
.clickable(
.combinedClickable(
onClick = onClick,
onLongClick = onLongClick,
onLongClickLabel = null,
onDoubleClick = null,
enabled = enabled,
role = Role.Button,
onClickLabel = clickDescription,
Expand Down Expand Up @@ -422,7 +427,7 @@ fun AddressLinkButton(
}

@Composable
fun TransactionLinkButton(
fun InlineTransactionLink(
modifier: Modifier = Modifier,
txId: TxId,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ fun RowScope.IconPopup(
popupLink: Pair<String, String>? = null,
spaceLeft: Dp? = 8.dp,
spaceRight: Dp? = null,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
) {
var showPopup by remember { mutableStateOf(false) }
spaceLeft?.let { Spacer(Modifier.requiredWidth(it)) }
Expand All @@ -191,7 +191,7 @@ fun RowScope.IconPopup(
padding = PaddingValues(iconPadding),
modifier = modifier.requiredSize(iconSize),
interactionSource = interactionSource,
onClick = { showPopup = true }
onClick = { showPopup = true },
)
if (showPopup) {
PopupDialog(onDismiss = { showPopup = false }, message = popupMessage, button = popupLink?.let { (text, link) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
Expand All @@ -34,7 +33,6 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -105,8 +103,8 @@ fun SplashLayout(
}
Column(
modifier = Modifier
.widthIn(max = 500.dp)
.padding(horizontal = 24.dp),
.widthIn(max = 700.dp)
.padding(horizontal = 6.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
bottomContent()
Expand All @@ -127,27 +125,30 @@ fun SplashLabelRow(
) {
Row {
Row(
modifier = Modifier.weight(1f).alignByBaseline(),
modifier = Modifier
.weight(1f)
.heightIn(min = 22.dp)
.alignByBaseline(),
horizontalArrangement = Arrangement.End
) {
Spacer(modifier = Modifier.weight(1f))
if (helpMessage != null) {
IconPopup(modifier = Modifier.offset(y = (-3).dp), popupMessage = helpMessage, popupLink = helpLink, spaceLeft = 0.dp, spaceRight = 5.dp)
}
Text(
text = label.uppercase(),
style = MaterialTheme.typography.subtitle1.copy(fontSize = 12.sp, textAlign = TextAlign.End),
style = MaterialTheme.typography.subtitle1.copy(fontSize = 12.sp),
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier.weight(1f)
)
if (helpMessage != null) {
IconPopup(modifier = Modifier.offset(y = (-3).dp), popupMessage = helpMessage, popupLink = helpLink, spaceLeft = 4.dp, spaceRight = 0.dp)
}
if (icon != null) {
Spacer(modifier = Modifier.width(4.dp))
Spacer(modifier = Modifier.width(3.dp))
Image(
painter = painterResource(id = icon),
colorFilter = ColorFilter.tint(iconTint),
contentDescription = null,
modifier = Modifier
.size(ButtonDefaults.IconSize)
.size(17.dp)
.offset(y = (-2).dp)
)
}
Expand Down Expand Up @@ -175,7 +176,7 @@ fun SplashClickableContent(
.offset(x = (-8).dp),
shape = RoundedCornerShape(12.dp)
) {
Column(modifier = Modifier.padding(8.dp)) {
Column(modifier = Modifier.padding(horizontal = 8.dp, vertical = 6.dp)) {
content()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import fr.acinq.bitcoin.Satoshi
import fr.acinq.lightning.blockchain.fee.FeeratePerByte
import fr.acinq.lightning.blockchain.fee.FeeratePerKw
import fr.acinq.lightning.channel.ChannelCommand
import fr.acinq.lightning.channel.ChannelFundingResponse
import fr.acinq.lightning.utils.msat
import fr.acinq.lightning.utils.sat
import fr.acinq.phoenix.managers.PeerManager
Expand All @@ -42,7 +43,7 @@ sealed class CpfpState {
data class Executing(val actualFeerate: FeeratePerKw) : CpfpState()
sealed class Complete : CpfpState() {
object Success: Complete()
data class Failed(val failure: ChannelCommand.Commitment.Splice.Response.Failure): Complete()
data class Failed(val failure: ChannelFundingResponse.Failure): Complete()
}
sealed class Error: CpfpState() {
data class Thrown(val e: Throwable): Error()
Expand Down Expand Up @@ -102,11 +103,11 @@ class CpfpViewModel(val peerManager: PeerManager) : ViewModel() {
log.info("failed to execute cpfp splice: assuming no channels")
state = CpfpState.Error.NoChannels
}
is ChannelCommand.Commitment.Splice.Response.Created -> {
is ChannelFundingResponse.Success -> {
log.info("successfully executed cpfp splice: $res")
state = CpfpState.Complete.Success
}
is ChannelCommand.Commitment.Splice.Response.Failure -> {
is ChannelFundingResponse.Failure -> {
log.info("failed to execute cpfp splice: $res")
state = CpfpState.Complete.Failed(res)
}
Expand Down
Loading