From 16d19222ccd384797eb171664880268a092373df Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Thu, 13 Aug 2026 22:19:54 +0200 Subject: [PATCH] Offer github sponsors where there is no pro to sell Pro and foss both hide the ad removal row, which leaves their settings section with no way to give anything back - and foss deliberately links nothing google, so the play listing was never an option there. A new settings row opens https://github.com/sponsors/opendocument-app, gated on !Features.withAds so it appears in pro and foss and not in lite, whose one money row should stay the purchase that also drops the ads. FUNDING.yml names the sponsor account too; the store links stay. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_0148fw92sgxkTduWzBW2mD74 --- .github/FUNDING.yml | 2 +- .../droid/ui/activity/LandingFragment.kt | 19 +++++++++++++++++++ .../droid/ui/activity/MainActivity.kt | 9 +++++++++ .../droid/ui/widget/LandingItem.kt | 1 + app/src/main/res/drawable/ic_favorite.xml | 10 ++++++++++ app/src/main/res/values/strings.xml | 1 + 6 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/ic_favorite.xml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index ba24b4ebcd1f..4d52ecfeebb0 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,6 +1,6 @@ # These are supported funding model platforms -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +github: opendocument-app patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username diff --git a/app/src/main/java/app/opendocument/droid/ui/activity/LandingFragment.kt b/app/src/main/java/app/opendocument/droid/ui/activity/LandingFragment.kt index cd61e1dac2a1..b5ef4b09e541 100644 --- a/app/src/main/java/app/opendocument/droid/ui/activity/LandingFragment.kt +++ b/app/src/main/java/app/opendocument/droid/ui/activity/LandingFragment.kt @@ -14,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView import app.opendocument.droid.R import app.opendocument.droid.background.RecentDocumentList import app.opendocument.droid.nonfree.AnalyticsConstants +import app.opendocument.droid.nonfree.Features import app.opendocument.droid.ui.SnackbarHelper import app.opendocument.droid.ui.widget.LandingAdapter import app.opendocument.droid.ui.widget.LandingItem @@ -186,6 +187,18 @@ class LandingFragment : Fragment(), LandingAdapter.Listener { ) } + // the way to give something back where there is no pro left to sell. not offered in + // lite, whose one money row should stay the purchase that also drops the ads + if (!Features.withAds) { + items.add( + LandingItem.Action( + LandingItem.ACTION_SPONSOR, + R.string.landing_sponsor, + R.drawable.ic_favorite, + ) + ) + } + // the way back into the consent form, which the ump sdk requires an app to offer for // as long as it holds a decision that can be withdrawn. asked the same way as the ad // removal, and for the same reason: only the activity has been told @@ -308,6 +321,12 @@ class LandingFragment : Fragment(), LandingAdapter.Listener { mainActivity.buyAdRemoval() } + LandingItem.ACTION_SPONSOR -> { + mainActivity.analyticsManager.report("settings_sponsor") + + mainActivity.openSponsorPage() + } + LandingItem.ACTION_PRIVACY_OPTIONS -> { mainActivity.analyticsManager.report("settings_privacy_options") diff --git a/app/src/main/java/app/opendocument/droid/ui/activity/MainActivity.kt b/app/src/main/java/app/opendocument/droid/ui/activity/MainActivity.kt index 5156776e6986..ac9771164a51 100644 --- a/app/src/main/java/app/opendocument/droid/ui/activity/MainActivity.kt +++ b/app/src/main/java/app/opendocument/droid/ui/activity/MainActivity.kt @@ -670,6 +670,15 @@ class MainActivity : AppCompatActivity() { ) } + /** What [buyAdRemoval] is for a build with no ad removal to sell. */ + fun openSponsorPage() { + analyticsManager.report(AnalyticsConstants.EVENT_ADD_TO_CART) + + startActivity( + Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/sponsors/opendocument-app")) + ) + } + private fun leaveFullscreen() { if (!fullscreen) { return diff --git a/app/src/main/java/app/opendocument/droid/ui/widget/LandingItem.kt b/app/src/main/java/app/opendocument/droid/ui/widget/LandingItem.kt index a57245684dd6..9a83309b28a7 100644 --- a/app/src/main/java/app/opendocument/droid/ui/widget/LandingItem.kt +++ b/app/src/main/java/app/opendocument/droid/ui/widget/LandingItem.kt @@ -61,6 +61,7 @@ sealed class LandingItem { companion object { const val ACTION_REMOVE_ADS: Int = 1 const val ACTION_PRIVACY_OPTIONS: Int = 2 + const val ACTION_SPONSOR: Int = 3 const val SETTING_CATCH_ALL: Int = 1 const val SETTING_PAGINATION: Int = 2 diff --git a/app/src/main/res/drawable/ic_favorite.xml b/app/src/main/res/drawable/ic_favorite.xml new file mode 100644 index 000000000000..5c6837cce53f --- /dev/null +++ b/app/src/main/res/drawable/ic_favorite.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 080be51434e0..93ef094f6524 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -59,6 +59,7 @@ Show page borders Keep the side margins of a printed page instead of filling the screen. Offer to open any file + Support us on GitHub Removed from recent Undo Open a file