diff --git a/core/src/main/java/org/openedx/core/data/model/CourseStructureModel.kt b/core/src/main/java/org/openedx/core/data/model/CourseStructureModel.kt index 7afea74a0..1fca6e677 100644 --- a/core/src/main/java/org/openedx/core/data/model/CourseStructureModel.kt +++ b/core/src/main/java/org/openedx/core/data/model/CourseStructureModel.kt @@ -1,6 +1,5 @@ package org.openedx.core.data.model -import android.text.TextUtils import com.google.gson.Gson import com.google.gson.JsonDeserializationContext import com.google.gson.JsonDeserializer @@ -76,7 +75,7 @@ data class CourseStructureModel( productInfo = courseModes?.find { EnrollmentMode.VERIFIED.toString().equals(it.slug, ignoreCase = true) }?.takeIf { - TextUtils.isEmpty(it.androidSku).not() && TextUtils.isEmpty(it.storeSku).not() + it.androidSku.isNullOrEmpty().not() && it.storeSku.isNullOrEmpty().not() }?.run { ProductInfo(courseSku = androidSku!!, storeSku = storeSku!!) } diff --git a/core/src/main/java/org/openedx/core/data/model/EnrolledCourse.kt b/core/src/main/java/org/openedx/core/data/model/EnrolledCourse.kt index 0abb159ff..54aa5e88a 100644 --- a/core/src/main/java/org/openedx/core/data/model/EnrolledCourse.kt +++ b/core/src/main/java/org/openedx/core/data/model/EnrolledCourse.kt @@ -1,6 +1,5 @@ package org.openedx.core.data.model -import android.text.TextUtils import com.google.gson.annotations.SerializedName import org.openedx.core.data.model.room.discovery.EnrolledCourseEntity import org.openedx.core.data.model.room.discovery.ProgressDb @@ -46,7 +45,7 @@ data class EnrolledCourse( productInfo = courseModes?.find { EnrollmentMode.VERIFIED.toString().equals(it.slug, ignoreCase = true) }?.takeIf { - TextUtils.isEmpty(it.androidSku).not() && TextUtils.isEmpty(it.storeSku).not() + it.androidSku.isNullOrEmpty().not() && it.storeSku.isNullOrEmpty().not() }?.run { ProductInfo(courseSku = androidSku!!, storeSku = storeSku!!) } diff --git a/core/src/main/java/org/openedx/core/domain/interactor/IAPInteractor.kt b/core/src/main/java/org/openedx/core/domain/interactor/IAPInteractor.kt index 50ae61372..b1f2e2762 100644 --- a/core/src/main/java/org/openedx/core/domain/interactor/IAPInteractor.kt +++ b/core/src/main/java/org/openedx/core/domain/interactor/IAPInteractor.kt @@ -1,6 +1,5 @@ package org.openedx.core.domain.interactor -import android.text.TextUtils import androidx.fragment.app.FragmentActivity import com.android.billingclient.api.BillingClient.BillingResponseCode import com.android.billingclient.api.ProductDetails @@ -108,7 +107,7 @@ class IAPInteractor( val productDetail = billingProcessor.querySyncDetails(purchase.products.first()).productDetailsList?.firstOrNull() productDetail?.oneTimePurchaseOfferDetails?.takeIf { - TextUtils.isEmpty(purchase.getCourseSku()).not() + purchase.getCourseSku().isNullOrEmpty().not() }?.let { oneTimeProductDetails -> val courseSku = purchase.getCourseSku() ?: return@let val basketId = addToBasket(courseSku) diff --git a/core/src/main/java/org/openedx/core/presentation/dialog/IAPDialogFragment.kt b/core/src/main/java/org/openedx/core/presentation/dialog/IAPDialogFragment.kt index 2de147fac..c18ce07b2 100644 --- a/core/src/main/java/org/openedx/core/presentation/dialog/IAPDialogFragment.kt +++ b/core/src/main/java/org/openedx/core/presentation/dialog/IAPDialogFragment.kt @@ -111,9 +111,9 @@ class IAPDialogFragment : DialogFragment() { } } - iapState is IAPUIState.ProductData && TextUtils.isEmpty( - iapViewModel.purchaseData.formattedPrice - ).not() -> { + iapState is IAPUIState.ProductData && + iapViewModel.purchaseData.formattedPrice.isNullOrEmpty() + .not() -> { OpenEdXButton(modifier = Modifier.fillMaxWidth(), text = stringResource( id = R.string.iap_upgrade_price,