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