diff --git a/app/build.gradle b/app/build.gradle index 4b6c3d4..411181a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -90,20 +90,20 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.preference:preference:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' - implementation 'com.google.android.material:material:1.1.0-beta01' + implementation 'com.google.android.material:material:1.1.0' implementation 'androidx.legacy:legacy-support-v13:1.0.0' implementation 'com.commonsware.cwac:anddown:0.3.0' - implementation 'com.google.firebase:firebase-core:17.2.1' - implementation 'com.android.billingclient:billing:1.2' + implementation 'com.google.firebase:firebase-core:17.2.3' + implementation 'com.android.billingclient:billing:2.1.0' implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' - implementation "androidx.core:core-ktx:1.1.0" - implementation 'androidx.browser:browser:1.0.0' + implementation "androidx.core:core-ktx:1.2.0" + implementation 'androidx.browser:browser:1.2.0' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" def coroutines_version = "1.3.0-RC2" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" - def lifecycle_version = "2.1.0" + def lifecycle_version = "2.2.0" implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" kapt "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version" implementation 'eu.crydee:syllable-counter:4.0.2' diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/view/activity/SupportActivity.kt b/app/src/main/java/com/wbrawner/simplemarkdown/view/activity/SupportActivity.kt index a373061..282227d 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/view/activity/SupportActivity.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/view/activity/SupportActivity.kt @@ -66,8 +66,8 @@ class SupportActivity : AppCompatActivity(), BillingClientStateListener, Purchas return super.onOptionsItemSelected(item) } - override fun onBillingSetupFinished(responseCode: Int) { - if (responseCode != BillingClient.BillingResponse.OK) { + override fun onBillingSetupFinished(result: BillingResult?) { + if (result?.responseCode != BillingClient.BillingResponseCode.OK) { return } @@ -75,9 +75,9 @@ class SupportActivity : AppCompatActivity(), BillingClientStateListener, Purchas .setSkusList(listOf("support_the_developer", "tip_coffee", "tip_beer")) .setType(BillingClient.SkuType.INAPP) .build() - billingClient.querySkuDetailsAsync(skuDetails) { skuDetailsResponseCode, skuDetailsList -> + billingClient.querySkuDetailsAsync(skuDetails) { skuDetailsResponse, skuDetailsList -> // Process the result. - if (skuDetailsResponseCode != BillingClient.BillingResponse.OK || skuDetailsList.isNullOrEmpty()) { + if (skuDetailsResponse?.responseCode != BillingClient.BillingResponseCode.OK || skuDetailsList.isNullOrEmpty()) { return@querySkuDetailsAsync } @@ -103,9 +103,12 @@ class SupportActivity : AppCompatActivity(), BillingClientStateListener, Purchas billingClient.startConnection(this) } - override fun onPurchasesUpdated(responseCode: Int, purchases: List?) { + override fun onPurchasesUpdated(result: BillingResult?, purchases: MutableList?) { purchases?.forEach { purchase -> - billingClient.consumeAsync(purchase.purchaseToken) { _, _ -> + val consumeParams = ConsumeParams.newBuilder() + .setPurchaseToken(purchase.purchaseToken) + .build() + billingClient.consumeAsync(consumeParams) { _, _ -> Toast.makeText( this@SupportActivity, getString(R.string.support_thank_you), diff --git a/build.gradle b/build.gradle index b8fecd6..7a828b3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.3.61' repositories { jcenter() google() @@ -10,8 +10,8 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' - classpath 'com.google.gms:google-services:4.3.2' + classpath 'com.android.tools.build:gradle:3.6.1' + classpath 'com.google.gms:google-services:4.3.3' classpath 'io.fabric.tools:gradle:1.31.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index cd77515..1da66c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Nov 06 17:12:14 CST 2019 +#Thu Mar 19 08:56:07 CST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip