From c6d8d8e78704d4e0c0f054b7187e71bd76e63269 Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Wed, 14 Oct 2026 23:36:30 -0700 Subject: [PATCH] support: Buy Me a Coffee first in Settings, the popup, the thank-you page and the repo's Sponsor button; Monero last --- .github/FUNDING.yml | 2 +- .../app/seb3thehacker/gearslip/ui/AboutLinks.kt | 13 +++++++++++-- .../app/seb3thehacker/gearslip/ui/DonatePrompt.kt | 15 ++++++++++++++- .../app/seb3thehacker/gearslip/ui/IntroScreen.kt | 2 +- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index ce04ccb..aa3b79e 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -10,6 +10,6 @@ liberapay: Seb3thehacker issuehunt: # Replace with a single IssueHunt username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry polar: # Replace with a single Polar username -buy_me_a_coffee: # Replace with a single Buy Me a Coffee username +buy_me_a_coffee: seb3thehacker thanks_dev: # Replace with a single thanks.dev username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/AboutLinks.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/AboutLinks.kt index bd9898c..aade45d 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/AboutLinks.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/AboutLinks.kt @@ -35,6 +35,7 @@ import androidx.compose.ui.platform.LocalContext /** Where Gearslip lives outside the app: support, the chat room, and the code. */ internal object GearslipLinks { + const val BUY_ME_A_COFFEE = "https://buymeacoffee.com/seb3thehacker" const val LIBERAPAY = "https://liberapay.com/Seb3thehacker" /** A card payment page for giving once, any amount. Its row stays hidden while this is empty. */ const val PAYMENT_LINK = "" @@ -66,7 +67,7 @@ internal object GearslipLinks { } } -/** The ways to support Gearslip. Liberapay always; card and Monero once they're set up. */ +/** The ways to support Gearslip: Buy Me a Coffee first, Monero last, card once it's set up. */ @Composable internal fun DonateRows() { val context = LocalContext.current @@ -77,6 +78,14 @@ internal fun DonateRows() { tint = MaterialTheme.colorScheme.onSurfaceVariant, ) } + SettingsRow( + "Buy Me a Coffee", + Modifier.clickable { GearslipLinks.open(context, GearslipLinks.BUY_ME_A_COFFEE) }, + subtitle = "Give once or monthly, by card", + icon = Icons.Filled.Favorite, + trailing = arrow, + ) + SettingsDivider() SettingsRow( "Liberapay", Modifier.clickable { GearslipLinks.open(context, GearslipLinks.LIBERAPAY) }, @@ -110,7 +119,7 @@ internal fun DonateRows() { /** The Monero address in full, with ways to pay it from this phone or another device. */ @Composable -private fun MoneroDialog(onDismiss: () -> Unit) { +internal fun MoneroDialog(onDismiss: () -> Unit) { val context = LocalContext.current AlertDialog( onDismissRequest = onDismiss, diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/DonatePrompt.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/DonatePrompt.kt index 25c1c9e..e68cb77 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/DonatePrompt.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/DonatePrompt.kt @@ -14,7 +14,9 @@ import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.dp @@ -85,7 +87,12 @@ object DonatePrompt { internal fun DonateDialog(live: Boolean) { val context = LocalContext.current val waiting by remember { DonatePrompt.pending(context) }.collectAsStateWithLifecycle() + var monero by remember { mutableStateOf(false) } if (!waiting || live) return + if (monero) { + MoneroDialog { DonatePrompt.answer(context, donated = true) } + return + } fun give(url: String) { DonatePrompt.answer(context, donated = true) GearslipLinks.open(context, url) @@ -102,7 +109,10 @@ internal fun DonateDialog(live: Boolean) { }, confirmButton = { Column(Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) { - Button(onClick = { give(GearslipLinks.LIBERAPAY) }, Modifier.fillMaxWidth()) { + Button(onClick = { give(GearslipLinks.BUY_ME_A_COFFEE) }, Modifier.fillMaxWidth()) { + Text("Buy me a coffee") + } + OutlinedButton(onClick = { give(GearslipLinks.LIBERAPAY) }, Modifier.fillMaxWidth()) { Text("Support on Liberapay") } if (GearslipLinks.PAYMENT_LINK.isNotEmpty()) { @@ -110,6 +120,9 @@ internal fun DonateDialog(live: Boolean) { Text("Give once by card") } } + OutlinedButton(onClick = { monero = true }, Modifier.fillMaxWidth()) { + Text("Monero") + } TextButton(onClick = { DonatePrompt.answer(context, donated = false) }, Modifier.fillMaxWidth()) { Text("Not now") } diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/IntroScreen.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/IntroScreen.kt index 2417baf..15f3f8f 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/IntroScreen.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/IntroScreen.kt @@ -228,7 +228,7 @@ fun IntroScreen(onDone: () -> Unit) { "Each note shows which cars work and which still fail, so I know what to fix next.", step, action = "See which cars work" to { GearslipLinks.open(context, GearslipLinks.CARS) }, outlined = true, - secondAction = "Support on Liberapay" to { GearslipLinks.open(context, GearslipLinks.LIBERAPAY) }, + secondAction = "Buy me a coffee" to { GearslipLinks.open(context, GearslipLinks.BUY_ME_A_COFFEE) }, ) { HeartIcon(c.onTertiaryC) } IntroStep.CHAT -> BadgeStep(c, ::cq, ::cqSp, c.primaryC, "Come say hi.", "Gearslip has a chat room on Matrix. Talk with other drivers about cars, apps, and " +