Rebased with master
This commit is contained in:
@@ -20,7 +20,7 @@ kapt {
|
||||
correctErrorTypes true
|
||||
}
|
||||
|
||||
def VERSION_NAME = "2.1.2"
|
||||
def VERSION_NAME = "2.1.3"
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
|
||||
@@ -588,6 +588,9 @@ abstract class BaseActivity : AppCompatActivity(), Toolbar.OnMenuItemClickListen
|
||||
PreferenceManager.setObjectPreference(Constants.PROVIDER_CONFIG_DATA, it)
|
||||
if (it.uxCamRecordConfig?.enabled.orFalse()) {
|
||||
onProviderConfigured(ProviderEnum.UXCAM.value)
|
||||
} else {
|
||||
// I had to do this :|
|
||||
UxcamUtil.instance.stopSessionAndUploadData()
|
||||
}
|
||||
}
|
||||
if (isRegisteredUser()) configurationVM.fetchProviderConfig()
|
||||
|
||||
@@ -8,11 +8,17 @@ import androidx.cardview.widget.CardView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.navi.analytics.uxcam.UxcamUtil
|
||||
import com.navi.common.sharedpref.PreferenceManager
|
||||
import com.naviapp.BuildConfig
|
||||
import com.naviapp.R
|
||||
import com.naviapp.dashboard.listeners.HomeActionListener
|
||||
import com.naviapp.databinding.CardViewAmcBinding
|
||||
import com.naviapp.manager.UserManager
|
||||
import com.naviapp.models.AmcCardStatus
|
||||
import com.naviapp.models.response.DashboardLoanWidgetConfig
|
||||
import com.naviapp.utils.USER_EXTERNAL_ID
|
||||
import com.naviapp.utils.isUXCamEnabled
|
||||
|
||||
class AmcCardView(context: Context, attrs: AttributeSet? = null) : CardView(context, attrs) {
|
||||
|
||||
@@ -48,6 +54,20 @@ class AmcCardView(context: Context, attrs: AttributeSet? = null) : CardView(cont
|
||||
binding.widgetBody = dashboardLoanWidgetConfig?.widgetBody
|
||||
dashboardLoanWidgetConfig?.widgetBody?.ctaData?.let { cta ->
|
||||
binding.root.setOnClickListener {
|
||||
//TODO Should be controlled from backend, temporary fix
|
||||
try {
|
||||
if (isUXCamEnabled().not()) {
|
||||
val uxCamUtil = UxcamUtil.instance
|
||||
uxCamUtil.init(BuildConfig.UXCAM_KEY)
|
||||
val externalUserId = PreferenceManager.getStringPreference(USER_EXTERNAL_ID)
|
||||
if (externalUserId.isNullOrBlank().not())
|
||||
uxCamUtil.setCustomerId(externalUserId.orEmpty())
|
||||
val name = UserManager.getName()
|
||||
val phone = UserManager.getPhoneNumber()
|
||||
UxcamUtil.instance.setUserProperty(name = name, phoneNumber = phone)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
}
|
||||
listener.onGeneralCardClick(
|
||||
cta,
|
||||
dashboardLoanWidgetConfig
|
||||
|
||||
@@ -71,6 +71,14 @@ class UxcamUtil private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
fun stopSessionAndUploadData() {
|
||||
try {
|
||||
UXCam.stopSessionAndUploadData()
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
val instance: UxcamUtil by lazy { Holder.INSTANCE }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user