mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-21 13:19:02 +00:00
Fix sub gifting flow
This commit is contained in:
parent
53f29c601e
commit
74e936b649
3 changed files with 8 additions and 9 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -66,3 +66,4 @@ captures
|
|||
fastlane/metadata/android/*/changelogs/
|
||||
/Habitica/amazon
|
||||
/fastlane/Fastfile.bkp
|
||||
/fastlane/Fastfile
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ android {
|
|||
buildConfigField "String", "STORE", "\"google\""
|
||||
multiDexEnabled true
|
||||
|
||||
versionCode 2051
|
||||
versionCode 2053
|
||||
versionName "1.7"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ class GiftIAPActivity: BaseActivity() {
|
|||
|
||||
private fun selectSubscription(sku: Sku) {
|
||||
for (thisSku in skus) {
|
||||
buttonForSku(sku)?.setIsPurchased(false)
|
||||
buttonForSku(thisSku)?.setIsPurchased(false)
|
||||
}
|
||||
this.selectedSubscriptionSku = sku
|
||||
val subscriptionOptionButton = buttonForSku(this.selectedSubscriptionSku)
|
||||
|
|
@ -243,20 +243,18 @@ class GiftIAPActivity: BaseActivity() {
|
|||
@Subscribe
|
||||
public fun onConsumablePurchased(event: ConsumablePurchasedEvent) {
|
||||
consumePurchase(event.purchase)
|
||||
displayConfirmationDialog()
|
||||
finish()
|
||||
runOnUiThread {
|
||||
displayConfirmationDialog()
|
||||
}
|
||||
}
|
||||
|
||||
private fun displayConfirmationDialog() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
AlertDialog.Builder(this, android.R.style.Theme_Material_Dialog_Alert)
|
||||
} else {
|
||||
AlertDialog.Builder(this)
|
||||
}
|
||||
AlertDialog.Builder(this)
|
||||
.setTitle(R.string.gift_confirmation_title)
|
||||
.setMessage(if (remoteConfigManager.enableGiftOneGetOne()) R.string.gift_confirmation_text_g1g1 else R.string.gift_confirmation_text)
|
||||
.setPositiveButton(android.R.string.ok) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
finish()
|
||||
}
|
||||
.show()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue