fixed build error
This commit is contained in:
parent
c628ae9996
commit
3dbaf3726d
|
@ -13,6 +13,7 @@ import nl.komponents.kovenant.ui.failUi
|
|||
import nl.komponents.kovenant.ui.successUi
|
||||
import org.mariotaku.twidere.Constants
|
||||
import org.mariotaku.twidere.constant.IntentConstants.INTENT_PACKAGE_PREFIX
|
||||
import org.mariotaku.twidere.constant.PURCHASE_RESPONSE_NOT_PURCHASED
|
||||
import org.mariotaku.twidere.fragment.ProgressDialogFragment
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
|
@ -137,6 +138,7 @@ class GooglePlayInAppPurchaseActivity : BaseActivity(), BillingProcessor.IBillin
|
|||
val resultCode = when (billingResponse) {
|
||||
BILLING_RESPONSE_RESULT_OK -> Activity.RESULT_OK
|
||||
BILLING_RESPONSE_RESULT_USER_CANCELED -> Activity.RESULT_CANCELED
|
||||
BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED -> PURCHASE_RESPONSE_NOT_PURCHASED
|
||||
else -> billingResponse
|
||||
}
|
||||
return resultCode
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
package org.mariotaku.twidere.constant
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 2017/1/1.
|
||||
*/
|
||||
const val PURCHASE_RESPONSE_NOT_PURCHASED = 1
|
|
@ -7,10 +7,10 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import com.anjlab.android.iab.v3.Constants.BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED
|
||||
import kotlinx.android.synthetic.main.fragment_extra_features_introduction.*
|
||||
import kotlinx.android.synthetic.main.layout_extra_features_introduction.*
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.constant.PURCHASE_RESPONSE_NOT_PURCHASED
|
||||
import org.mariotaku.twidere.fragment.BaseSupportFragment
|
||||
import org.mariotaku.twidere.util.premium.ExtraFeaturesChecker
|
||||
|
||||
|
@ -54,7 +54,7 @@ class ExtraFeaturesIntroductionCardFragment : BaseSupportFragment() {
|
|||
REQUEST_RESTORE_PURCHASE -> {
|
||||
if (requestCode == Activity.RESULT_OK) {
|
||||
activity?.recreate()
|
||||
} else if (resultCode == BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED) {
|
||||
} else if (resultCode == PURCHASE_RESPONSE_NOT_PURCHASED) {
|
||||
Toast.makeText(context, R.string.message_extra_features_not_purchased, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue