NTP-25440 | Bottom sheet old them bug fix (#14447)
Co-authored-by: saksham <saksham>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2024 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -477,8 +477,7 @@ class SipModifyFragment : AmcBaseFragment(), FooterInteractionListener {
|
||||
data?.bottomSheetData?.get(DELETE_SIP_WITH_REASON)?.reasons?.forEach {
|
||||
it.isChecked = false
|
||||
}
|
||||
val bottomSheet =
|
||||
CsatBottomSheet.getInstance(data, enableBlackCtaStyle = true, action = ::onClickCtaData)
|
||||
val bottomSheet = CsatBottomSheet.getInstance(data, action = ::onClickCtaData)
|
||||
safelyShowBottomSheet(bottomSheet, CsatBottomSheet.TAG)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -14,7 +14,6 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.BaseAdapter
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.navi.base.utils.orFalse
|
||||
import com.navi.common.R
|
||||
import com.navi.common.databinding.CheckboxFeebackCommonLayoutBinding
|
||||
import com.navi.design.utils.isValidHexColor
|
||||
@@ -29,17 +28,11 @@ class CsatAdapter(
|
||||
) : BaseAdapter() {
|
||||
private val reasons = arrayListOf<ReasonItem>()
|
||||
private var state: CsatReasonSelectionState? = null
|
||||
private var enableBlackCta: Boolean? = null
|
||||
|
||||
fun setReasons(
|
||||
data: List<ReasonItem>,
|
||||
state: CsatReasonSelectionState?,
|
||||
enableBlackCta: Boolean?
|
||||
) {
|
||||
fun setReasons(data: List<ReasonItem>, state: CsatReasonSelectionState?) {
|
||||
this.reasons.clear()
|
||||
this.reasons.addAll(data)
|
||||
this.state = state
|
||||
this.enableBlackCta = enableBlackCta
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
@@ -71,20 +64,11 @@ class CsatAdapter(
|
||||
viewHolder = view.tag as CheckboxViewHolder
|
||||
}
|
||||
|
||||
if (enableBlackCta == true) {
|
||||
viewHolder.checkbox.buttonDrawable =
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
WidgetsR.drawable.radio_button_tint_selector_black
|
||||
)
|
||||
}
|
||||
viewHolder.checkbox.buttonDrawable =
|
||||
ContextCompat.getDrawable(context, WidgetsR.drawable.radio_button_tint_selector_black)
|
||||
viewHolder.title.setTextFieldData(data.title)
|
||||
if (data.isChecked) {
|
||||
if (enableBlackCta.orFalse()) {
|
||||
view.setBackgroundResource(R.drawable.bg_rounded_white_black_border_4)
|
||||
} else {
|
||||
view.setBackgroundResource(R.drawable.bg_rounded_white_red_border_8)
|
||||
}
|
||||
view.setBackgroundResource(R.drawable.bg_rounded_white_black_border_4)
|
||||
viewHolder.checkbox.isChecked = true
|
||||
state?.selected?.textColor?.let { textColor ->
|
||||
if (isValidHexColor(textColor)) {
|
||||
@@ -97,11 +81,7 @@ class CsatAdapter(
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (enableBlackCta.orFalse()) {
|
||||
view.setBackgroundResource(R.drawable.bg_rounded_white_grey_border_4)
|
||||
} else {
|
||||
view.setBackgroundResource(R.drawable.bg_rounded_white_grey_border_8)
|
||||
}
|
||||
view.setBackgroundResource(R.drawable.bg_rounded_white_grey_border_4)
|
||||
viewHolder.checkbox.isChecked = false
|
||||
state?.unSelected?.textColor?.let { textColor ->
|
||||
if (isValidHexColor(textColor)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2024 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -18,7 +18,6 @@ import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.ContextCompat.getColor
|
||||
import androidx.core.content.ContextCompat.getSystemService
|
||||
import androidx.core.view.isVisible
|
||||
@@ -42,7 +41,6 @@ import com.navi.common.network.ApiConstants.NO_INTERNET
|
||||
import com.navi.common.ui.fragment.BaseBottomSheet
|
||||
import com.navi.common.utils.Constants
|
||||
import com.navi.common.utils.Constants.DATA
|
||||
import com.navi.common.utils.Constants.ENABLE_BLACK_CTA_STYLE
|
||||
import com.navi.common.utils.hideSoftKeyboardOnTouch
|
||||
import com.navi.common.utils.observeNonNull
|
||||
import com.navi.design.R as DesignR
|
||||
@@ -68,7 +66,6 @@ class CsatBottomSheet : BaseBottomSheet(), OthersInputBoxListener {
|
||||
private var npsCompletionListener: CsatCompletionListener? = null
|
||||
private var bottomSheetData: CsatBottomSheetData? = null
|
||||
private var csatWidgetData: CsatWidgetData? = null
|
||||
private var enableBlackCta: Boolean? = null
|
||||
private var screen: String? = null
|
||||
private var selectedRating: Int? = null
|
||||
|
||||
@@ -123,11 +120,6 @@ class CsatBottomSheet : BaseBottomSheet(), OthersInputBoxListener {
|
||||
}
|
||||
|
||||
private fun initUI() {
|
||||
arguments?.getBoolean(ENABLE_BLACK_CTA_STYLE)?.let { enableBlackCtaStyle ->
|
||||
if (enableBlackCtaStyle) {
|
||||
enableBlackCta = true
|
||||
}
|
||||
}
|
||||
arguments?.getParcelable<CsatWidgetData>(DATA)?.let { npsV2WidgetData ->
|
||||
addCountOfPreSelectedItems(npsV2WidgetData)
|
||||
updateLayoutData(npsV2WidgetData)
|
||||
@@ -151,27 +143,18 @@ class CsatBottomSheet : BaseBottomSheet(), OthersInputBoxListener {
|
||||
}
|
||||
context?.let {
|
||||
binding.tryAgainBtn.setText(getString(R.string.try_again))
|
||||
if (enableBlackCta.orFalse()) {
|
||||
binding.tryAgainBtn.background =
|
||||
getNaviDrawable(
|
||||
backgroundColor =
|
||||
getColor(requireContext(), DesignR.color.purple_button_color),
|
||||
radii =
|
||||
CornerRadius(
|
||||
leftTop = dpToPx(4),
|
||||
rightTop = dpToPx(4),
|
||||
leftBottom = dpToPx(4),
|
||||
rightBottom = dpToPx(4)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
binding.tryAgainBtn.background =
|
||||
getNaviDrawable(
|
||||
backgroundColor =
|
||||
ContextCompat.getColor(it, DesignR.color.outrageous_orange),
|
||||
cornerRadius = resources.getDimension(DesignR.dimen.dp_32).toInt()
|
||||
)
|
||||
}
|
||||
binding.tryAgainBtn.background =
|
||||
getNaviDrawable(
|
||||
backgroundColor =
|
||||
getColor(requireContext(), DesignR.color.purple_button_color),
|
||||
radii =
|
||||
CornerRadius(
|
||||
leftTop = dpToPx(4),
|
||||
rightTop = dpToPx(4),
|
||||
leftBottom = dpToPx(4),
|
||||
rightBottom = dpToPx(4)
|
||||
)
|
||||
)
|
||||
}
|
||||
binding.errorLayout.visibility = View.VISIBLE
|
||||
binding.dataLayout.visibility = View.GONE
|
||||
@@ -340,20 +323,17 @@ class CsatBottomSheet : BaseBottomSheet(), OthersInputBoxListener {
|
||||
binding.primaryAbv.layoutParams = layoutParams
|
||||
}
|
||||
}
|
||||
if (enableBlackCta.orFalse()) {
|
||||
binding.primaryAbv.background =
|
||||
getNaviDrawable(
|
||||
backgroundColor =
|
||||
getColor(requireContext(), DesignR.color.purple_button_color),
|
||||
radii =
|
||||
CornerRadius(
|
||||
leftTop = dpToPx(4),
|
||||
rightTop = dpToPx(4),
|
||||
leftBottom = dpToPx(4),
|
||||
rightBottom = dpToPx(4)
|
||||
)
|
||||
)
|
||||
}
|
||||
binding.primaryAbv.background =
|
||||
getNaviDrawable(
|
||||
backgroundColor = getColor(requireContext(), DesignR.color.purple_button_color),
|
||||
radii =
|
||||
CornerRadius(
|
||||
leftTop = dpToPx(4),
|
||||
rightTop = dpToPx(4),
|
||||
leftBottom = dpToPx(4),
|
||||
rightBottom = dpToPx(4)
|
||||
)
|
||||
)
|
||||
|
||||
binding.primaryAbv.setOnClickListener(
|
||||
MultipleClicksHandler {
|
||||
@@ -399,7 +379,7 @@ class CsatBottomSheet : BaseBottomSheet(), OthersInputBoxListener {
|
||||
|
||||
csatAdapter = CsatAdapter(this, requireContext())
|
||||
data.reasons?.let {
|
||||
csatAdapter?.setReasons(it, data.state, enableBlackCta)
|
||||
csatAdapter?.setReasons(it, data.state)
|
||||
binding.gridReasons.visibility = View.VISIBLE
|
||||
binding.gridReasons.adapter = csatAdapter
|
||||
}
|
||||
@@ -547,15 +527,10 @@ class CsatBottomSheet : BaseBottomSheet(), OthersInputBoxListener {
|
||||
|
||||
fun getInstance(
|
||||
npsV2WidgetData: CsatWidgetData? = null,
|
||||
enableBlackCtaStyle: Boolean = false,
|
||||
action: ((CtaData, NetPromoterScoreRequest) -> Unit)? = null
|
||||
): CsatBottomSheet {
|
||||
return CsatBottomSheet().apply {
|
||||
arguments =
|
||||
Bundle().apply {
|
||||
putParcelable(Constants.DATA, npsV2WidgetData)
|
||||
putBoolean(Constants.ENABLE_BLACK_CTA_STYLE, enableBlackCtaStyle)
|
||||
}
|
||||
arguments = Bundle().apply { putParcelable(Constants.DATA, npsV2WidgetData) }
|
||||
this.action = action
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,6 @@ object Constants {
|
||||
const val LOGOUT = "logout"
|
||||
const val GZIP = "gzip"
|
||||
const val ADDITIONAL_PARAMETERS = "ADDITIONAL_PARAMETERS"
|
||||
const val ENABLE_BLACK_CTA_STYLE = "enableBlackCtaStyle"
|
||||
const val PROP_SCREEN_NAME = "screen_name"
|
||||
const val OFFER_IMPROVEMENT_CHANNEL_TYPE = "OFFER_IMPROVEMENT_CHANNEL_TYPE"
|
||||
const val FLOW_FINARKEIN = "FINARKEIN"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2024 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -332,8 +332,7 @@ class DigitalGoldTransactionActivity : BaseActivity(), WidgetCallback, CsatCompl
|
||||
(csatResponse?.content?.firstOrNull() as? CsatWidget)?.widgetData?.let {
|
||||
data ->
|
||||
NaviTrackEvent.trackEvent(GOLD_VAULT_CSAT_BOTTOMSHEET_INIT)
|
||||
csatBottomSheet =
|
||||
CsatBottomSheet.getInstance(data, enableBlackCtaStyle = true)
|
||||
csatBottomSheet = CsatBottomSheet.getInstance(data)
|
||||
csatBottomSheet.setListener(this@DigitalGoldTransactionActivity)
|
||||
if (
|
||||
!(::widgetSupportedBottomSheet.isInitialized &&
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2019-2024 by Navi Technologies Limited
|
||||
* * Copyright © 2019-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -342,8 +342,7 @@ class RewardProductFragment :
|
||||
NaviRRAnalytics.REWARDS_SCREEN_CSAT_INIT_BOTTOMSHEET_VIEW,
|
||||
hashMapOf("elementId" to REWARD_CSAT)
|
||||
)
|
||||
val bottomSheet =
|
||||
CsatBottomSheet.getInstance(data, enableBlackCtaStyle = true)
|
||||
val bottomSheet = CsatBottomSheet.getInstance(data)
|
||||
sharedVM?.setCsatShownOnce(true)
|
||||
bottomSheet.setListener(this@RewardProductFragment)
|
||||
safelyShowBottomSheet(bottomSheet, CsatBottomSheet.TAG)
|
||||
|
||||
Reference in New Issue
Block a user