diff --git a/app/build.gradle b/app/build.gradle index 7587001..204dae1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -113,6 +113,8 @@ dependencies { } implementation 'com.google.guava:guava:32.1.2-android' playImplementation 'com.google.android.play:app-update-ktx:2.1.0' + playImplementation "com.android.billingclient:billing:6.1.0" + playImplementation "com.android.billingclient:billing-ktx:6.1.0" } if (getProps("APPCENTER_TOKEN") != "") { diff --git a/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment.kt b/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment.kt index 32456c6..925daf9 100644 --- a/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment.kt +++ b/app/src/main/java/io/nekohasekai/sfa/ui/main/SettingsFragment.kt @@ -103,6 +103,11 @@ class SettingsFragment : Fragment() { binding.openDebugButton.setOnClickListener { startActivity(Intent(requireContext(), DebugActivity::class.java)) } + binding.startSponserButton.setOnClickListener { + Vendor.startSponsor(requireActivity()) { + activity.launchCustomTab("https://sekai.icu/sponsor/") + } + } lifecycleScope.launch(Dispatchers.IO) { reloadSettings() } diff --git a/app/src/main/java/io/nekohasekai/sfa/vendor/VendorInterface.kt b/app/src/main/java/io/nekohasekai/sfa/vendor/VendorInterface.kt index e8a6f07..b7c5189 100644 --- a/app/src/main/java/io/nekohasekai/sfa/vendor/VendorInterface.kt +++ b/app/src/main/java/io/nekohasekai/sfa/vendor/VendorInterface.kt @@ -5,5 +5,5 @@ import android.app.Activity interface VendorInterface { fun checkUpdateAvailable(): Boolean fun checkUpdate(activity: Activity, byUser: Boolean) - + fun startSponsor(activity: Activity, fallback: () -> Unit) } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 29a8652..4c00786 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -348,6 +348,53 @@ + + + + + + + + + + + + +