aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-23 00:38:41 -0700
committerAllan Wang <me@allanwang.ca>2017-07-23 00:38:41 -0700
commit07d6e50e7fba1b3793046c1f180566081bece168 (patch)
tree6e4a6f223687e765f702acb4fc4ed523963535b6
parentbe41e13ea2cec00f448d929278fe5b93f789dffb (diff)
downloadfrost-07d6e50e7fba1b3793046c1f180566081bece168.tar.gz
frost-07d6e50e7fba1b3793046c1f180566081bece168.tar.bz2
frost-07d6e50e7fba1b3793046c1f180566081bece168.zip
Remove remaining async
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt49
-rw-r--r--docs/Changelog.md7
-rw-r--r--gradle.properties2
4 files changed, 21 insertions, 39 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt
index 34dc07de..3971cffa 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt
@@ -68,7 +68,7 @@ class SettingsActivity : KPrefActivity(), FrostBilling by IABSettings() {
}
plainText(R.string.get_pro) {
- descRes = R.string.get_pro
+ descRes = R.string.get_pro_desc
iicon = GoogleMaterial.Icon.gmd_star
onClick = { _, _, _ -> restorePurchases(); true }
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt
index 87a428b6..ab9e37d1 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt
@@ -9,8 +9,6 @@ import com.pitchedapps.frost.BuildConfig
import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.frostAnswers
-import org.jetbrains.anko.doAsync
-import org.jetbrains.anko.uiThread
/**
* Created by Allan Wang on 2017-07-22.
@@ -45,15 +43,11 @@ abstract class IABBinder : FrostBilling {
activity = null
}
- override fun onBillingInitialized() {
- L.d("IAB initialized")
- }
+ override fun onBillingInitialized() = L.d("IAB initialized")
- override fun onPurchaseHistoryRestored() {
- L.d("IAB restored")
- }
+ override fun onPurchaseHistoryRestored() = L.d("IAB restored")
- override fun onProductPurchased(productId: String, details: TransactionDetails) {
+ override fun onProductPurchased(productId: String, details: TransactionDetails?) {
L.d("IAB $productId purchased")
frostAnswers {
logPurchase(PurchaseEvent()
@@ -63,7 +57,7 @@ abstract class IABBinder : FrostBilling {
}
}
- override fun onBillingError(errorCode: Int, error: Throwable) {
+ override fun onBillingError(errorCode: Int, error: Throwable?) {
frostAnswers {
logPurchase(PurchaseEvent()
.putCustomAttribute("result", errorCode.toString())
@@ -95,20 +89,12 @@ abstract class IABBinder : FrostBilling {
class IABSettings : IABBinder() {
- override fun onBillingInitialized() {
- super.onBillingInitialized()
-
- }
-
- override fun onPurchaseHistoryRestored() {
- super.onPurchaseHistoryRestored()
- }
-
- override fun onProductPurchased(productId: String, details: TransactionDetails) {
+ override fun onProductPurchased(productId: String, details: TransactionDetails?) {
super.onProductPurchased(productId, details)
+ activity?.playStorePurchasedSuccessfully(productId)
}
- override fun onBillingError(errorCode: Int, error: Throwable) {
+ override fun onBillingError(errorCode: Int, error: Throwable?) {
super.onBillingError(errorCode, error)
activity?.playStoreGenericError(null)
}
@@ -118,18 +104,14 @@ class IABSettings : IABBinder() {
*/
override fun restorePurchases() {
if (bp == null) return
- doAsync {
- val load = bp!!.loadOwnedPurchasesFromGoogle()
- L.d("IAB settings load from google $load")
- uiThread {
- if (!bp!!.isPurchased(FROST_PRO)) {
- if (Prefs.pro) activity!!.playStoreNoLongerPro()
- else purchasePro()
- } else {
- if (!Prefs.pro) activity!!.playStoreFoundPro()
- else activity!!.purchaseRestored()
- }
- }
+ val load = bp!!.loadOwnedPurchasesFromGoogle()
+ L.d("IAB settings load from google $load")
+ if (!bp!!.isPurchased(FROST_PRO)) {
+ if (Prefs.pro) activity!!.playStoreNoLongerPro()
+ else purchasePro()
+ } else {
+ if (!Prefs.pro) activity!!.playStoreFoundPro()
+ else activity!!.purchaseRestored()
}
}
}
@@ -164,6 +146,5 @@ class IABMain : IABBinder() {
if (!Prefs.pro) activity!!.playStoreFoundPro()
}
onDestroyBilling()
-
}
} \ No newline at end of file
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 2fe02e9a..b762f996 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -1,9 +1,7 @@
# Changelog
## Beta Updates
-* Fix regex bug for some devices
-* Fix notification text
-* Update round icons
+* Allow for multiple result flags in settings to better reload the main view
## v1.4
* Update IAB helper
@@ -15,6 +13,9 @@
* Aggressively filter nonrecent posts in recents mode
* Add download option for full sized images
* Fix rounded icons
+* Fix regex bug for some devices
+* Fix notification text
+* Update round icons
## v1.3
* Create toggle for notifications only from primary account
diff --git a/gradle.properties b/gradle.properties
index 43838fe5..1538b932 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -17,7 +17,7 @@ MIN_SDK=21
TARGET_SDK=26
BUILD_TOOLS=26.0.0
-KAU=3.0
+KAU=8e2fc5f
KOTLIN=1.1.3-2
CRASHLYTICS=2.6.8
DBFLOW=4.0.5