Skip to content

Commit

Permalink
Apply spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
VishalNehra committed Jul 14, 2024
1 parent 6df2101 commit 9e8746a
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ class Billing(val context: Context, private var uniqueId: String) :
response.responseCode,
purchases?.size,
)
if (::activity.isInitialized && !activity.isFinishing
&& !activity.isDestroyed) {
if (::activity.isInitialized && !activity.isFinishing &&
!activity.isDestroyed
) {
activity.getString(R.string.operation_failed).let { activity.showToastInCenter(it) }
}
}
Expand Down Expand Up @@ -229,8 +230,9 @@ class Billing(val context: Context, private var uniqueId: String) :
} catch (e: Exception) {
log.warn("failed to update subscription state for trial validation", e)
}
if (::activity.isInitialized && !activity.isFinishing
&& !activity.isDestroyed) {
if (::activity.isInitialized && !activity.isFinishing &&
!activity.isDestroyed
) {
activity.runOnUiThread {
purchaseDialog?.dismiss()
Utils.buildSubscriptionPurchasedDialog(activity).show()
Expand All @@ -245,11 +247,11 @@ class Billing(val context: Context, private var uniqueId: String) :
purchaseToken,
)
activity.getString(R.string.operation_failed).let {
if (::activity.isInitialized && !activity.isFinishing
&& !activity.isDestroyed) {
if (::activity.isInitialized && !activity.isFinishing &&
!activity.isDestroyed
) {
activity.showToastInCenter(it)
}

}
}
}
Expand Down Expand Up @@ -494,8 +496,9 @@ class Billing(val context: Context, private var uniqueId: String) :
val billingFlowParams = BillingFlowParams.newBuilder().setProductDetailsParamsList(
listOf(productDetailsParams)
).build()
if (::activity.isInitialized && !activity.isFinishing
&& !activity.isDestroyed) {
if (::activity.isInitialized && !activity.isFinishing &&
!activity.isDestroyed
) {
activity.let {
billingClient.launchBillingFlow(it, billingFlowParams)
}
Expand Down Expand Up @@ -561,8 +564,9 @@ class Billing(val context: Context, private var uniqueId: String) :
*
*
*/
if (::activity.isInitialized && !activity.isFinishing
&& !activity.isDestroyed) {
if (::activity.isInitialized && !activity.isFinishing &&
!activity.isDestroyed
) {
activity.runOnUiThread {
val dialogBuilder = AlertDialog.Builder(activity, R.style.Custom_Dialog_Dark)
.setTitle(R.string.subscribe)
Expand Down

0 comments on commit 9e8746a

Please sign in to comment.