TP-61085 | AMC transaction level support (#10620)
Co-authored-by: Sayed Owais Ali <sayed.owais@navi.com>
This commit is contained in:
@@ -54,13 +54,13 @@ abstract class AmcBaseActivity : BaseActivity() {
|
||||
overridePendingTransition(CommonR.anim.parallax_slide_in_right, CommonR.anim.parallax_slide_out_left)
|
||||
}
|
||||
|
||||
protected fun openHelpInfo(helpBottomSheetData: HelpBottomSheetData?) {
|
||||
protected fun openHelpInfo(helpBottomSheetData: HelpBottomSheetData?, bundle: Bundle? = null) {
|
||||
sendEvent(
|
||||
AmcAnalytics.AMC_BTN_HELP,
|
||||
hashMapOf(Pair(AmcAnalytics.SUB_SCREEN_NAME, getCurrentFragmentScreenName()))
|
||||
)
|
||||
if (FirebaseRemoteConfigHelper.getBoolean(FirebaseRemoteConfigHelper.UST_IN_AMC_ENABLED)) {
|
||||
openSupportScreen(helpBottomSheetData)
|
||||
openSupportScreen(helpBottomSheetData, bundle)
|
||||
} else {
|
||||
openHelpBottomSheet(helpBottomSheetData)
|
||||
}
|
||||
@@ -98,7 +98,7 @@ abstract class AmcBaseActivity : BaseActivity() {
|
||||
AmcAnalytics.sendEvent(eventName, attributes, screenName, isNeededForFirebase = isNeededForFirebase)
|
||||
}
|
||||
|
||||
private fun openSupportScreen(helpBottomSheetData: HelpBottomSheetData?) {
|
||||
private fun openSupportScreen(helpBottomSheetData: HelpBottomSheetData?, bundle: Bundle? = null) {
|
||||
val configID =
|
||||
helpBottomSheetData?.helpOptions?.firstOrNull()?.cta?.parameters?.firstOrNull { it.key == CHAT_BOT_SCREEN_NAME }?.value
|
||||
DeepLinkManager.getDeepLinkListener()?.navigateTo(
|
||||
@@ -108,7 +108,7 @@ abstract class AmcBaseActivity : BaseActivity() {
|
||||
key = DeeplinkConstants.PRODUCT_HELP_SCREEN_NAME, value = configID
|
||||
)
|
||||
)
|
||||
), bundle = null, finish = false
|
||||
), bundle = bundle, finish = false
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -112,11 +112,11 @@ abstract class AmcBaseFragment : BaseFragment() {
|
||||
|
||||
open fun setContainerView(viewStub: ViewStub) {}
|
||||
|
||||
fun setHeaderProperties(header: Header?) {
|
||||
fun setHeaderProperties(header: Header?,bundle: Bundle? = null) {
|
||||
header?.let {
|
||||
binding.headerView.visibility = View.VISIBLE
|
||||
headerData = header
|
||||
binding.headerView.setProperties(header, headerInteractionListener)
|
||||
binding.headerView.setProperties(header, headerInteractionListener, bundle)
|
||||
} ?: run {
|
||||
binding.headerView.visibility = View.GONE
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ class OrderStatusFragment : AmcBaseFragment(), FooterInteractionListener, BackLi
|
||||
private val paymentVM: PaymentManager by activityViewModels()
|
||||
private val paymentSharedVM: PaymentSharedVM by activityViewModels()
|
||||
private var apiPollScheduler: ApiPollScheduler? = null
|
||||
private val bundle = Bundle()
|
||||
override val screenName: String
|
||||
get() = ORDER_STATUS_SCREEN
|
||||
private var learnMoreBottomSheetData: AmcCommonBottomSheetData? = null
|
||||
@@ -134,6 +135,8 @@ class OrderStatusFragment : AmcBaseFragment(), FooterInteractionListener, BackLi
|
||||
showLoader()
|
||||
val orderId = arguments?.getString(Constant.ORDER_ID).orEmpty()
|
||||
val dataSource = arguments?.getString(Constant.DATA_SOURCE).orEmpty()
|
||||
bundle.putString(Constant.ORDER_ID, orderId)
|
||||
bundle.putString(Constant.DATA_SOURCE, dataSource)
|
||||
viewModel.sourceScreen = buyFlowVM.provideLatestGreenScreen()
|
||||
viewModel.fetchScreenData(orderId, dataSource, extraParams)
|
||||
if (forceRefresh.not()) viewModel.fetchCSATResponse(dataSource, orderId)
|
||||
@@ -149,7 +152,7 @@ class OrderStatusFragment : AmcBaseFragment(), FooterInteractionListener, BackLi
|
||||
viewModel.orderStatusScreenData.observe(viewLifecycleOwner) {
|
||||
hideLoader()
|
||||
it?.let { it ->
|
||||
setHeaderProperties(it.header)
|
||||
setHeaderProperties(it.header,bundle)
|
||||
hideDivider()
|
||||
binding.apply {
|
||||
it.content?.let {
|
||||
|
||||
@@ -314,8 +314,8 @@ class FundBuyActivity : BasePaymentActivity(),
|
||||
}
|
||||
}
|
||||
|
||||
override fun onHelpClick(helpBottomSheetData: HelpBottomSheetData?) {
|
||||
openHelpInfo(helpBottomSheetData)
|
||||
override fun onHelpClick(helpBottomSheetData: HelpBottomSheetData?, bundle: Bundle?) {
|
||||
openHelpInfo(helpBottomSheetData, bundle)
|
||||
}
|
||||
|
||||
override fun getCurrentFragmentScreenName(): String {
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.navi.common.model.HelpBottomSheetData
|
||||
import com.navi.common.network.models.GenericErrorResponse
|
||||
import com.navi.common.ui.dialog.BaseDialogFragment
|
||||
import com.navi.common.utils.getDateWithSuffix
|
||||
import com.navi.common.utils.getDateWithoutSuffix
|
||||
import com.navi.common.utils.getWeekDaysFirstLetters
|
||||
import com.navi.design.calendar.adapter.NaviCalendarViewAdapter
|
||||
import com.navi.design.calendar.model.WeekDayData
|
||||
@@ -65,7 +64,7 @@ class SipCalendarFragment() :
|
||||
safelyDismissDialog()
|
||||
}
|
||||
|
||||
override fun onHelpClick(helpBottomSheetData: HelpBottomSheetData?) {
|
||||
override fun onHelpClick(helpBottomSheetData: HelpBottomSheetData?, bundle: Bundle?) {
|
||||
headerInteractionListener?.onHelpClick(helpBottomSheetData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import androidx.databinding.DataBindingUtil
|
||||
import com.navi.amc.R
|
||||
import com.navi.amc.common.activity.AmcBaseActivity
|
||||
import com.navi.amc.common.fragment.AmcBaseFragment
|
||||
import com.navi.amc.common.fragment.StatusFragment
|
||||
import com.navi.amc.common.listener.BackListener
|
||||
import com.navi.amc.databinding.KycActivityAmcBinding
|
||||
import com.navi.amc.digio.AadhaarVerificationData
|
||||
@@ -37,7 +36,6 @@ import com.navi.base.model.ActionData
|
||||
import com.navi.common.firebasedb.FirebaseStatusType
|
||||
import com.navi.common.listeners.FragmentInterchangeListener
|
||||
import com.navi.common.listeners.HeaderInteractionListener
|
||||
import com.navi.common.model.Header
|
||||
import com.navi.common.model.HelpBottomSheetData
|
||||
import com.navi.common.model.ModuleNameV2
|
||||
import com.navi.common.network.models.GenericErrorResponse
|
||||
@@ -139,8 +137,8 @@ class KycActivity :
|
||||
actionData?.url?.let { navigateToNextScreen(actionData) } ?: run { onBackPressed() }
|
||||
}
|
||||
|
||||
override fun onHelpClick(helpBottomSheetData: HelpBottomSheetData?) {
|
||||
openHelpInfo(helpBottomSheetData)
|
||||
override fun onHelpClick(helpBottomSheetData: HelpBottomSheetData?, bundle: Bundle?) {
|
||||
openHelpInfo(helpBottomSheetData,bundle)
|
||||
}
|
||||
|
||||
override fun onTopPressed(actionData: ActionData?, exitBottomSheetData: GenericErrorResponse?) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.navi.base.deeplink.DeepLinkManager
|
||||
import com.navi.base.model.ActionData
|
||||
import com.navi.base.model.BottomSheetData
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.base.model.LineItem
|
||||
import com.navi.base.sharedpref.CommonPrefConstants
|
||||
import com.navi.base.sharedpref.PreferenceManager
|
||||
import com.navi.base.utils.isNotNull
|
||||
@@ -426,10 +427,17 @@ class SupportScreenActivity :
|
||||
}
|
||||
|
||||
private fun moveToNextScreen(actionData: ActionData) {
|
||||
val parameters = actionData.parameters?.toMutableList()
|
||||
val metaData: HashMap<String?, String?> = HashMap()
|
||||
metaData["order_id"] = intent.extras?.getString(ORDER_ID)
|
||||
metaData["data_source"] = intent.extras?.getString(DATA_SOURCE)
|
||||
if (metaData.isNotEmpty()) {
|
||||
parameters?.add(LineItem(key = "meta_data", metaData = metaData))
|
||||
}
|
||||
DeepLinkManager.getDeepLinkListener()
|
||||
?.navigateTo(
|
||||
this@SupportScreenActivity,
|
||||
ctaData = CtaData(url = actionData.url, parameters = actionData.parameters),
|
||||
ctaData = CtaData(url = actionData.url, parameters = parameters),
|
||||
bundle = null,
|
||||
finish = false,
|
||||
needsResult = true
|
||||
@@ -551,5 +559,7 @@ class SupportScreenActivity :
|
||||
const val CHAT_WITH_US_ACTION_DATA = "CHAT_WITH_US_ACTION_DATA"
|
||||
const val SEARCH_BAR_HINT = "SEARCH_BAR_HINT"
|
||||
const val SEARCH_THRESHOLD_LIMIT = "SEARCH_THRESHOLD_LIMIT"
|
||||
const val ORDER_ID = "orderId"
|
||||
const val DATA_SOURCE = "dataSource"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package com.navi.common.customview
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -32,7 +33,8 @@ class HeaderView(context: Context, attrs: AttributeSet?) : ConstraintLayout(cont
|
||||
|
||||
fun setProperties(
|
||||
header: Header?,
|
||||
headerInteractionListener: HeaderInteractionListener? = null
|
||||
headerInteractionListener: HeaderInteractionListener? = null,
|
||||
bundle: Bundle? = null
|
||||
) {
|
||||
binding.data = header
|
||||
binding.divider.visibility = View.VISIBLE
|
||||
@@ -44,7 +46,7 @@ class HeaderView(context: Context, attrs: AttributeSet?) : ConstraintLayout(cont
|
||||
header?.help?.helpBottomSheet?.let { helpBottomSheet ->
|
||||
binding.helpTv.visibility = View.VISIBLE
|
||||
binding.helpTv.setOnClickListener {
|
||||
headerInteractionListener?.onHelpClick(helpBottomSheet)
|
||||
headerInteractionListener?.onHelpClick(helpBottomSheet, bundle)
|
||||
}
|
||||
}
|
||||
header?.bgColor?.let { setHeaderBackground(it) }
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
package com.navi.common.listeners
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.annotation.StyleRes
|
||||
import com.navi.base.model.ActionData
|
||||
import com.navi.common.model.Header
|
||||
@@ -45,7 +46,7 @@ interface HeaderInteractionListener {
|
||||
|
||||
fun onClick(actionData: ActionData?) {}
|
||||
|
||||
fun onHelpClick(helpBottomSheetData: HelpBottomSheetData?) {}
|
||||
fun onHelpClick(helpBottomSheetData: HelpBottomSheetData?, bundle: Bundle? = null) {}
|
||||
|
||||
fun showHeader() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user