|
|
|
|
@ -21,11 +21,10 @@ import androidx.viewpager.widget.ViewPager |
|
|
|
|
import com.android.billingclient.api.* |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.databinding.FragmentSubscriptionBinding |
|
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
|
import net.pokeranalytics.android.util.CrashLogging |
|
|
|
|
import net.pokeranalytics.android.ui.extensions.px |
|
|
|
|
import net.pokeranalytics.android.ui.fragment.components.BaseFragment |
|
|
|
|
import net.pokeranalytics.android.ui.fragment.components.ScreenSlidePageFragment |
|
|
|
|
import net.pokeranalytics.android.util.CrashLogging |
|
|
|
|
import net.pokeranalytics.android.util.Preferences |
|
|
|
|
import net.pokeranalytics.android.util.billing.AppGuard |
|
|
|
|
import net.pokeranalytics.android.util.billing.IAPProducts |
|
|
|
|
@ -68,8 +67,6 @@ class SubscriptionFragment : BaseFragment(), SkuDetailsResponseListener, Purchas |
|
|
|
|
_binding = null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) { |
|
|
|
|
super.onCreate(savedInstanceState) |
|
|
|
|
|
|
|
|
|
@ -162,7 +159,7 @@ class SubscriptionFragment : BaseFragment(), SkuDetailsResponseListener, Purchas |
|
|
|
|
this.selectedProduct?.let { |
|
|
|
|
AppGuard.initiatePurchase(this.requireActivity(), it) |
|
|
|
|
} ?: run { |
|
|
|
|
throw PAIllegalStateException("Attempt to initiate purchase while no product has been chosen") |
|
|
|
|
Toast.makeText(requireContext(), R.string.product_unavailable, Toast.LENGTH_LONG).show() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|