Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new on-the-fly funding #630

Closed
wants to merge 7 commits into from
Closed
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Build
build/
.cxx
.kotlin

# Idea
.idea
Expand All @@ -24,8 +26,6 @@ sdk-dependencies
apk
phoenix-legacy/release
phoenix-legacy/debug
.cxx

# LangTool
.langtool/deepl.authtoken

9 changes: 4 additions & 5 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
object Versions {
const val lightningKmp = "1.7.3"
const val lightningKmp = "1.7.4-SNAPSHOT"
const val secp256k1 = "0.14.0"
const val torMobile = "0.2.0"

const val kotlin = "1.9.22"
const val kotlin = "2.0.10"

const val ktor = "2.3.7"
const val sqlDelight = "2.0.1"
const val ktor = "2.3.12"
const val sqlDelight = "2.0.2"

const val slf4j = "1.7.30"
const val junit = "4.13"
Expand All @@ -19,7 +19,6 @@ object Versions {
const val prefs = "1.2.0"
const val datastore = "1.0.0"
const val compose = "1.6.2"
const val composeCompiler = "1.5.8"
const val navCompose = "2.6.0"
const val accompanist = "0.30.1"
const val composeConstraintLayout = "1.1.0-alpha09"
Expand Down
5 changes: 1 addition & 4 deletions phoenix-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
kotlin("android")
id("com.google.gms.google-services")
id("kotlinx-serialization")
id("org.jetbrains.kotlin.plugin.compose") version Versions.kotlin
}

fun gitCommitHash(): String {
Expand Down Expand Up @@ -71,10 +72,6 @@ android {
dataBinding = true
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.Android.composeCompiler
}

packagingOptions {
resources.merges.add("reference.conf")
}
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 @@ -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 @@ -127,27 +125,29 @@ fun SplashLabelRow(
) {
Row {
Row(
modifier = Modifier.weight(1f).alignByBaseline(),
modifier = Modifier
.weight(1f)
.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 +175,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
Loading