From 71397a07774707aa38646368c18be3a8ab8885ba Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Tue, 13 Oct 2026 17:39:15 -0700 Subject: [PATCH] settings: donation links are back, in their own section above About --- .../seb3thehacker/gearslip/ui/AboutLinks.kt | 32 ++++++++++++++++++- .../gearslip/ui/SettingsScreen.kt | 4 +++ 2 files changed, 35 insertions(+), 1 deletion(-) 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 c2ea293..d8d5dbe 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/AboutLinks.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/AboutLinks.kt @@ -15,8 +15,10 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext -/** Where Gearslip lives outside the app: the chat room and the code. */ +/** Where Gearslip lives outside the app: donations, the chat room, and the code. */ internal object GearslipLinks { + const val SPONSORS = "https://github.com/sponsors/Seb3thehacker" + const val LIBERAPAY = "https://liberapay.com/Seb3thehacker" const val MATRIX = "https://matrix.to/#/!mf0_mgBd5KqKpc9FfX_wHp1jFCcwAtPrndIn_oGIyMk?via=matrix.org" const val SOURCE = "https://github.com/Seb3thehacker/gearslip" const val CARS = "$SOURCE/blob/main/CARS.md" @@ -28,6 +30,34 @@ internal object GearslipLinks { } } +/** The two ways to donate, each opening in the browser. */ +@Composable +internal fun DonateRows() { + val context = LocalContext.current + val arrow = @Composable { + Icon( + Icons.AutoMirrored.Filled.KeyboardArrowRight, + contentDescription = null, + tint = MaterialTheme.colorScheme.onSurfaceVariant, + ) + } + SettingsRow( + "GitHub Sponsors", + Modifier.clickable { GearslipLinks.open(context, GearslipLinks.SPONSORS) }, + subtitle = "Give once or monthly", + icon = Icons.Filled.Favorite, + trailing = arrow, + ) + SettingsDivider() + SettingsRow( + "Liberapay", + Modifier.clickable { GearslipLinks.open(context, GearslipLinks.LIBERAPAY) }, + subtitle = "Give weekly or monthly, through a nonprofit", + icon = Icons.Filled.Favorite, + trailing = arrow, + ) +} + /** The About section's links: the chat room, the source code, and credits. */ @Composable internal fun AboutLinkRows() { diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/SettingsScreen.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/SettingsScreen.kt index 202e323..30fe681 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/SettingsScreen.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/SettingsScreen.kt @@ -131,6 +131,10 @@ fun SettingsScreen( ) { UsageStatsRows() } SettingsSection("Updates") { UpdateRow() } CertificateSection() + SettingsSection( + "Support Gearslip", + footer = "Gearslip is free, with no ads and no tracking. Donations keep it going.", + ) { DonateRows() } AboutSection(onOpenWhatsNew, onReplayTutorial, onReplayIntro) Spacer(Modifier.height(16.dp)) }