TP-48946 } HL Navi One (#9307)
Co-authored-by: Neil Mehta <neil.mehta@navi.com> Co-authored-by: Hitesh <hitesh.kumar@navi.com> Co-authored-by: Abhinav Gupta <abhinav.g@navi.com> Co-authored-by: Shivam Goyal <shivam.goyal@navi.com> Co-authored-by: Ankit Yadav <ankit.yadav@navi.com>
This commit is contained in:
@@ -8,8 +8,12 @@
|
||||
package com.navi.homeloan.common.customview
|
||||
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.ViewStub
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.base.utils.EMPTY
|
||||
import com.navi.common.ui.fragment.BaseBottomSheet
|
||||
@@ -19,8 +23,9 @@ import com.navi.homeloan.common.listeners.HLFooterListener
|
||||
import com.navi.homeloan.common.models.HomeLoanGenericBottomSheetData
|
||||
import com.navi.homeloan.common.utils.NaviHLAnalytics
|
||||
import com.navi.homeloan.databinding.BottomSheetHlCommonBinding
|
||||
import com.navi.naviwidgets.callbacks.WidgetCallback
|
||||
|
||||
class HLCommonBottomSheet : BaseBottomSheet(), HLFooterListener {
|
||||
class HLCommonBottomSheet : BaseBottomSheet(), HLFooterListener, WidgetCallback {
|
||||
|
||||
private lateinit var binding: BottomSheetHlCommonBinding
|
||||
private val analyticsEventTracker = NaviHLAnalytics.naviHLAnalytics.HomeLoanCommonBottomSheet()
|
||||
@@ -29,6 +34,14 @@ class HLCommonBottomSheet : BaseBottomSheet(), HLFooterListener {
|
||||
private var backCtaBodyMap: HashMap<String, String>? = null
|
||||
private var bottomSheetType: String = EMPTY
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setStyle(
|
||||
DialogFragment.STYLE_NORMAL,
|
||||
R.style.DialogStyleAdjustResizeInput
|
||||
)
|
||||
}
|
||||
|
||||
override fun setContainerView(viewStub: ViewStub) {
|
||||
viewStub.layoutResource = R.layout.bottom_sheet_hl_common
|
||||
binding = DataBindingUtil.getBinding(viewStub.inflate())!!
|
||||
@@ -40,9 +53,45 @@ class HLCommonBottomSheet : BaseBottomSheet(), HLFooterListener {
|
||||
analyticsEventTracker.onBottomSheetLanded(it.analyticsEventProperties)
|
||||
binding.footerView.setFooterInteractionListener(this)
|
||||
binding.data = it
|
||||
it.inputTextWidget?.let { inputTextWidget ->
|
||||
bottomSheetType = INPUT_TYPE_BOTTOM_SHEET
|
||||
binding.labeledTextInput.isVisible = true
|
||||
binding.footerView.enableContinueCta(false)
|
||||
initInputTextWatcher()
|
||||
binding.labeledTextInput.updateData(inputTextWidget, this)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun initInputTextWatcher() {
|
||||
binding.labeledTextInput.addTextWatcher(
|
||||
object : TextWatcher {
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
s?.let { inputText ->
|
||||
if (inputText.toString().isNotEmpty()) {
|
||||
val validText =
|
||||
binding.labeledTextInput.getUserInputPostValidation() ?: ""
|
||||
binding.footerView.enableContinueCta(validText.isNotEmpty())
|
||||
} else {
|
||||
binding.footerView.enableContinueCta(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun beforeTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
count: Int,
|
||||
after: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun setCommonBottomSheetListener(listener: HLCommonBottomSheetListener) {
|
||||
this.listener = listener
|
||||
}
|
||||
@@ -62,6 +111,7 @@ class HLCommonBottomSheet : BaseBottomSheet(), HLFooterListener {
|
||||
companion object {
|
||||
const val TAG = "HL_COMMON_BOTTOM_SHEET"
|
||||
const val ARG_DATA = "hlBottomSheetInfo"
|
||||
const val INPUT_TYPE_BOTTOM_SHEET = "INPUT_TYPE_BOTTOM_SHEET"
|
||||
|
||||
fun getInstance(bottomSheetData: HomeLoanGenericBottomSheetData) =
|
||||
HLCommonBottomSheet().apply {
|
||||
@@ -74,8 +124,16 @@ class HLCommonBottomSheet : BaseBottomSheet(), HLFooterListener {
|
||||
get() = EMPTY
|
||||
|
||||
override fun onFooterCtaClick(ctaData: CtaData?) {
|
||||
safelyDismissDialog()
|
||||
listener?.onBsCtaClick(ctaData, bottomSheetType)
|
||||
if (bottomSheetType == INPUT_TYPE_BOTTOM_SHEET) {
|
||||
val inputDate = binding.labeledTextInput.getUserInputPostValidation() ?: ""
|
||||
if (inputDate.isNotEmpty()) {
|
||||
safelyDismissDialog()
|
||||
listener?.onBsCtaClick(ctaData, bottomSheetType, inputDate)
|
||||
}
|
||||
} else {
|
||||
safelyDismissDialog()
|
||||
listener?.onBsCtaClick(ctaData, bottomSheetType)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFooterNextCtaClick(ctaData: CtaData?) {
|
||||
|
||||
@@ -10,7 +10,7 @@ package com.navi.homeloan.common.listeners
|
||||
import com.navi.base.model.CtaData
|
||||
|
||||
interface HLCommonBottomSheetListener {
|
||||
fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String) {}
|
||||
fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String = "") {}
|
||||
|
||||
fun onBsBottomCtaClick(ctaData: CtaData?) {}
|
||||
|
||||
|
||||
@@ -17,5 +17,6 @@ data class CommunicationAddressScreenResponse(
|
||||
)
|
||||
|
||||
data class CommunicationAddressScreenContent(
|
||||
@SerializedName("widgets") val widgets: List<NaviWidget>? = null
|
||||
@SerializedName("widgets") val widgets: List<NaviWidget>? = null,
|
||||
@SerializedName("enterEmailBottomSheet") val enterEmailBottomSheet: HomeLoanGenericBottomSheetData? = null
|
||||
)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.navi.homeloan.common.models
|
||||
|
||||
data class HLPanVerificationStatusFromAP (
|
||||
val panVerificationResultReceived: Boolean
|
||||
)
|
||||
@@ -28,5 +28,7 @@ data class HomeLoanFormScreenContent(
|
||||
var panRequiredBottomSheet: HomeLoanGenericBottomSheetData? = null,
|
||||
@SerializedName("toastMessage") val toastMessage: String? = null,
|
||||
@SerializedName("interestRate") val interestRate: Double? = null,
|
||||
@SerializedName("keyValueTextField") val keyValueTextField: KeyValueTextFieldData? = null
|
||||
@SerializedName("keyValueTextField") val keyValueTextField: KeyValueTextFieldData? = null,
|
||||
@SerializedName("isPanVerified") val isPanVerified: Boolean? = false,
|
||||
@SerializedName("panVerificationPendingBottomSheet") val panVerificationPendingBottomSheet: HomeLoanGenericBottomSheetData? = null,
|
||||
)
|
||||
|
||||
@@ -11,6 +11,8 @@ import android.os.Parcelable
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.navi.base.model.AnalyticsEvent
|
||||
import com.navi.naviwidgets.models.response.TextFieldData
|
||||
import com.navi.naviwidgets.widgets.labledtextinput.LabeledTextInputWidgetModelV2
|
||||
import com.navi.naviwidgets.widgets.labledtextinput.TextInputWidgetData
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@@ -21,5 +23,6 @@ data class HomeLoanGenericBottomSheetData(
|
||||
@SerializedName("footer") val footer: HLFooter? = null,
|
||||
@SerializedName("infoList") val infoList: ArrayList<TextFieldData>? = null,
|
||||
@SerializedName("listItemMargin") val listItemMargin: Int? = null,
|
||||
@SerializedName("analyticsEventProperties") val analyticsEventProperties: AnalyticsEvent? = null
|
||||
@SerializedName("analyticsEventProperties") val analyticsEventProperties: AnalyticsEvent? = null,
|
||||
@SerializedName("inputTextWidget") val inputTextWidget: LabeledTextInputWidgetModelV2? = null
|
||||
) : Parcelable
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.homeloan.common.models
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.navi.base.model.CtaData
|
||||
|
||||
data class HomeLoanPanVerificationResponse(
|
||||
@SerializedName("isPanVerified") val isPanVerified: Boolean? = null,
|
||||
@SerializedName("cta") val cta: CtaData? = null
|
||||
)
|
||||
@@ -18,30 +18,32 @@ import com.navi.naviwidgets.R as WidgetsR
|
||||
@Keep
|
||||
object HLIconUtils {
|
||||
|
||||
const val ICON_HL_HAMBURGER = "ICON_HL_HAMBURGER"
|
||||
private const val ICON_HL_HAMBURGER = "ICON_HL_HAMBURGER"
|
||||
const val ICON_ARROW_LEFT_BLUE = "ICON_ARROW_LEFT_BLUE"
|
||||
const val ICON_ARROW_CROSS_BLUE = "ICON_ARROW_CROSS_BLUE"
|
||||
private const val ICON_ARROW_CROSS_BLUE = "ICON_ARROW_CROSS_BLUE"
|
||||
const val ICON_RED_BORDER_ALERT = "ICON_RED_BORDER_ALERT"
|
||||
const val ICON_BLUE_BORDER_ALERT = "ICON_BLUE_BORDER_ALERT"
|
||||
const val ICON_SMALL_YELLOW_BULB = "ICON_SMALL_YELLOW_BULB"
|
||||
const val ICON_INFO_SIMPLE = "ICON_INFO_SIMPLE"
|
||||
const val ICON_HL_SMALL_RED_WHITE_BG_RIGHT_ARROW = "ICON_HL_SMALL_RED_WHITE_BG_RIGHT_ARROW"
|
||||
const val OUTLINED_INFO_ICON_BLACK = "OUTLINED_INFO_ICON_BLACK"
|
||||
const val INVALID_CITY_ICON = "INVALID_CITY_ICON"
|
||||
private const val ICON_BLUE_BORDER_ALERT = "ICON_BLUE_BORDER_ALERT"
|
||||
private const val ICON_SMALL_YELLOW_BULB = "ICON_SMALL_YELLOW_BULB"
|
||||
private const val ICON_INFO_SIMPLE = "ICON_INFO_SIMPLE"
|
||||
private const val ICON_HL_SMALL_RED_WHITE_BG_RIGHT_ARROW = "ICON_HL_SMALL_RED_WHITE_BG_RIGHT_ARROW"
|
||||
private const val OUTLINED_INFO_ICON_BLACK = "OUTLINED_INFO_ICON_BLACK"
|
||||
private const val INVALID_CITY_ICON = "INVALID_CITY_ICON"
|
||||
const val ICON_LARGE_PURPLE_ALERT_WITH_DOG = "ICON_LARGE_PURPLE_ALERT_WITH_DOG"
|
||||
const val ICON_HL_GREY_LOCK = "ICON_HL_GREY_LOCK"
|
||||
private const val ICON_HL_GREY_LOCK = "ICON_HL_GREY_LOCK"
|
||||
private const val ICON_HL_HELP_FAQ = "ICON_HL_HELP_FAQ"
|
||||
private const val ICON_HL_HELP_CHAT = "ICON_HL_HELP_CHAT"
|
||||
private const val ICON_HL_HELP_EMAIL = "ICON_HL_HELP_EMAIL"
|
||||
private const val ICON_HL_HELP_CALL = "ICON_HL_HELP_CALL"
|
||||
private const val ICON_RED_BORDER_DOWNLOAD = "ICON_RED_BORDER_DOWNLOAD"
|
||||
private const val ICON_HL_RED_TICK_SMALL = "ICON_HL_RED_TICK_SMALL"
|
||||
private const val ICON_ARROW_DOWN_RED = "ICON_ARROW_DOWN_RED"
|
||||
private const val RED_TICK_MARK_24 = "RED_TICK_MARK_24"
|
||||
const val ICON_ARROW_DOWN_RED = "ICON_ARROW_DOWN_RED"
|
||||
const val ICON_GREY_DARK_INFO = "ICON_GREY_DARK_INFO"
|
||||
const val ICON_HL_INFO_FILLED_SIMPLE = "ICON_HL_INFO_FILLED_SIMPLE"
|
||||
const val ICON_HL_ERROR_INFO_RED = "ICON_HL_ERROR_INFO_RED"
|
||||
const val OUTLINED_INFO_ICON_BLACK_LARGE = "OUTLINED_INFO_ICON_BLACK_LARGE"
|
||||
private const val ICON_GREY_DARK_INFO = "ICON_GREY_DARK_INFO"
|
||||
private const val ICON_HL_INFO_FILLED_SIMPLE = "ICON_HL_INFO_FILLED_SIMPLE"
|
||||
private const val ICON_HL_ERROR_INFO_RED = "ICON_HL_ERROR_INFO_RED"
|
||||
private const val OUTLINED_INFO_ICON_BLACK_LARGE = "OUTLINED_INFO_ICON_BLACK_LARGE"
|
||||
private const val ICON_HL_IMAGE_LARGE = "ICON_HL_IMAGE_LARGE"
|
||||
private const val ICON_HL_PAN_IN_HAND = "ICON_HL_PAN_IN_HAND"
|
||||
const val ICON_CALL = "CALL"
|
||||
const val ICON_SEND_EMAIL = "SEND_EMAIL"
|
||||
const val ICON_CHAT = "CHAT"
|
||||
@@ -73,6 +75,7 @@ object HLIconUtils {
|
||||
ICON_HL_HELP_FAQ -> WidgetsR.drawable.ic_hl_help_faq_svg
|
||||
ICON_HL_HELP_CHAT -> WidgetsR.drawable.ic_hl_help_chat_svg
|
||||
ICON_HL_HELP_EMAIL -> WidgetsR.drawable.ic_hl_help_email_svg
|
||||
ICON_HL_IMAGE_LARGE -> R.drawable.ic_email_large
|
||||
ICON_HL_HELP_CALL -> WidgetsR.drawable.ic_hl_help_call
|
||||
ICON_RED_BORDER_DOWNLOAD -> WidgetsR.drawable.ic_red_border_download_svg
|
||||
ICON_HL_RED_TICK_SMALL -> WidgetsR.drawable.ic_red_tick_small
|
||||
@@ -81,6 +84,7 @@ object HLIconUtils {
|
||||
ICON_HL_INFO_FILLED_SIMPLE -> WidgetsR.drawable.ic_info_dark
|
||||
ICON_HL_ERROR_INFO_RED -> R.drawable.ic_hl_error_info_red
|
||||
OUTLINED_INFO_ICON_BLACK_LARGE -> R.drawable.ic_hl_info_icon_black_32
|
||||
ICON_HL_PAN_IN_HAND -> R.drawable.ic_pan_card_in_hand
|
||||
RED_TICK_MARK_24 -> R.drawable.ic_red_alert
|
||||
ICON_CALL -> CommonR.drawable.ic_call_menu
|
||||
ICON_SEND_EMAIL -> CommonR.drawable.ic_email_menu
|
||||
|
||||
14
navi-hl/src/main/res/drawable/ic_email_large.xml
Normal file
14
navi-hl/src/main/res/drawable/ic_email_large.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M4,5C3.452,5 3,5.452 3,6V18C3,18.548 3.452,19 4,19H20C20.548,19 21,18.548 21,18V6C21,5.452 20.548,5 20,5H4ZM1,6C1,4.348 2.348,3 4,3H20C21.652,3 23,4.348 23,6V18C23,19.652 21.652,21 20,21H4C2.348,21 1,19.652 1,18V6Z"
|
||||
android:fillColor="#1F002A"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M1.181,5.427C1.498,4.974 2.121,4.864 2.573,5.181L12,11.779L21.427,5.181C21.879,4.864 22.503,4.974 22.819,5.427C23.136,5.879 23.026,6.503 22.573,6.819L12.573,13.819C12.229,14.06 11.771,14.06 11.427,13.819L1.427,6.819C0.974,6.503 0.864,5.879 1.181,5.427Z"
|
||||
android:fillColor="#1F002A"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
131
navi-hl/src/main/res/drawable/ic_pan_card_in_hand.xml
Normal file
131
navi-hl/src/main/res/drawable/ic_pan_card_in_hand.xml
Normal file
@@ -0,0 +1,131 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="72dp"
|
||||
android:height="72dp"
|
||||
android:viewportWidth="72"
|
||||
android:viewportHeight="72">
|
||||
<path
|
||||
android:pathData="M36,36m-32,0a32,32 0,1 1,64 0a32,32 0,1 1,-64 0"
|
||||
android:fillColor="#F2F7FC"/>
|
||||
<path
|
||||
android:pathData="M36,36m-32,0a32,32 0,1 1,64 0a32,32 0,1 1,-64 0"
|
||||
android:fillColor="#F2F7FC"/>
|
||||
<path
|
||||
android:pathData="M17.654,22.923L26.169,20.561C28.958,19.789 31.983,20.42 34.127,22.363C35.118,23.258 36.024,24.291 36.87,25.416L23.087,26.34C23.087,26.34 18.983,26.502 17.192,24.633C16.663,24.083 16.928,23.156 17.654,22.923Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="0.095197"
|
||||
android:fillColor="#FFA180"
|
||||
android:strokeColor="#491057"
|
||||
android:strokeLineCap="round"/>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M36,36m-32,0a32,32 0,1 1,64 0a32,32 0,1 1,-64 0"/>
|
||||
<path
|
||||
android:pathData="M59.738,59.208C55.39,56.091 50.299,54.349 50.299,54.349C48.801,54.814 47.352,54.86 46.28,54.786C45.469,54.733 44.676,54.547 43.903,54.293C42.698,53.894 40.758,53.538 39.464,53.327C38.636,53.189 37.786,53.344 37.053,53.757C32.854,56.116 30.706,56.077 29.638,55.615C28.972,55.326 28.601,54.617 28.697,53.898C29.261,49.632 34.662,48.782 34.662,48.782L43.019,46.444L37.501,25.931L31.337,27.99L28.383,21.965L40.699,19.733C41.672,19.549 41.968,19.824 42.782,20.392C45.948,22.596 48.995,25.219 51.435,29.958C53.977,34.643 56.621,38.578 59.354,41.885L67.999,45.841C67.854,51.497 65.633,56.193 59.745,59.208H59.738Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="0.095197"
|
||||
android:fillColor="#FFA180"
|
||||
android:strokeColor="#491057"
|
||||
android:strokeLineCap="round"/>
|
||||
</group>
|
||||
<path
|
||||
android:pathData="M24.472,25.324C24.472,25.324 30.618,37.302 30.889,37.263C31.161,37.224 39.81,34.181 39.81,34.181L31.404,23.438L24.469,25.324H24.472Z"
|
||||
android:fillColor="#E57461"/>
|
||||
<path
|
||||
android:pathData="M21.569,23.477L29.263,19.133C31.78,17.712 34.872,17.596 37.421,18.964C38.599,19.595 39.727,20.378 40.82,21.266L27.665,25.48C27.665,25.48 23.72,26.626 21.53,25.243C20.885,24.834 20.917,23.875 21.566,23.473L21.569,23.477Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="0.095197"
|
||||
android:fillColor="#FFA180"
|
||||
android:strokeColor="#491057"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M52.31,53.446C50.215,54.726 47.934,54.885 46.383,54.797"
|
||||
android:strokeWidth="0.0705163"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#231F20"/>
|
||||
<path
|
||||
android:pathData="M42.906,28.378C42.906,28.378 45.215,34.527 46.128,39.361C47.041,44.195 42.719,45.658 42.719,45.658L42.906,28.378Z"
|
||||
android:fillColor="#E57461"/>
|
||||
<path
|
||||
android:pathData="M44.824,47.893L44.768,27.211C44.768,26.456 44.154,25.846 43.4,25.85L5.927,25.949C5.55,25.949 4.69,26.492 4.69,26.492L4.566,27.324L4.623,47.999C4.623,48.754 5.236,49.363 5.991,49.36L41.94,49.265L43.541,49.462L44.161,49.06C44.56,48.82 44.828,48.387 44.824,47.89V47.893Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="0.0705163"
|
||||
android:fillColor="#491057"
|
||||
android:strokeColor="#491057"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M42.84,26.213L5.364,26.312C4.611,26.313 4.002,26.926 4.004,27.68L4.058,48.366C4.06,49.119 4.672,49.728 5.426,49.726L42.902,49.628C43.655,49.626 44.264,49.014 44.263,48.26L44.208,27.574C44.206,26.821 43.594,26.211 42.84,26.213Z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startX="4.003"
|
||||
android:startY="37.968"
|
||||
android:endX="107"
|
||||
android:endY="64"
|
||||
android:type="linear">
|
||||
<item android:offset="0" android:color="#FFEFB3FE"/>
|
||||
<item android:offset="0.266" android:color="#FFB8B9F2"/>
|
||||
<item android:offset="0.41" android:color="#FF94BCF5"/>
|
||||
<item android:offset="0.67" android:color="#FF79BEF7"/>
|
||||
<item android:offset="0.85" android:color="#FF6AC0F9"/>
|
||||
<item android:offset="1" android:color="#FF64C0F9"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:pathData="M41.531,28.882H29.004V31.188H41.531V28.882Z"
|
||||
android:strokeWidth="0.0705163"
|
||||
android:fillColor="#ffffff"
|
||||
android:fillAlpha="0.5"
|
||||
android:strokeColor="#491057"/>
|
||||
<path
|
||||
android:pathData="M18.43,28.882H5.902V31.188H18.43V28.882Z"
|
||||
android:strokeWidth="0.0705163"
|
||||
android:fillColor="#ffffff"
|
||||
android:fillAlpha="0.5"
|
||||
android:strokeColor="#491057"/>
|
||||
<path
|
||||
android:pathData="M23.715,32.422C25.033,32.422 26.102,31.353 26.102,30.035C26.102,28.717 25.033,27.648 23.715,27.648C22.397,27.648 21.328,28.717 21.328,30.035C21.328,31.353 22.397,32.422 23.715,32.422Z"
|
||||
android:strokeWidth="0.0705163"
|
||||
android:fillColor="#ffffff"
|
||||
android:fillAlpha="0.5"
|
||||
android:strokeColor="#491057"/>
|
||||
<path
|
||||
android:pathData="M6.465,38.575H17.892"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="0.334952"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#231F20"
|
||||
android:strokeLineCap="square"/>
|
||||
<path
|
||||
android:pathData="M6.465,40.782H21.418"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="0.334952"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#231F20"
|
||||
android:strokeLineCap="square"/>
|
||||
<path
|
||||
android:pathData="M37.498,41.804C38.507,41.804 39.325,40.986 39.325,39.978C39.325,38.969 38.507,38.151 37.498,38.151C36.489,38.151 35.672,38.969 35.672,39.978C35.672,40.986 36.489,41.804 37.498,41.804Z"
|
||||
android:strokeAlpha="0.53"
|
||||
android:fillColor="#3C0050"
|
||||
android:fillAlpha="0.53"/>
|
||||
<path
|
||||
android:pathData="M40.989,46.564H34.012V46.159C34.012,44.23 35.574,42.668 37.502,42.668C39.431,42.668 40.993,44.23 40.993,46.159V46.564H40.989Z"
|
||||
android:strokeAlpha="0.53"
|
||||
android:fillColor="#3C0050"
|
||||
android:fillAlpha="0.53"/>
|
||||
<path
|
||||
android:pathData="M42.84,26.213L5.364,26.312C4.611,26.313 4.002,26.926 4.004,27.68L4.058,48.366C4.06,49.119 4.672,49.728 5.426,49.726L42.902,49.628C43.655,49.626 44.264,49.014 44.263,48.26L44.208,27.574C44.206,26.821 43.594,26.211 42.84,26.213Z"
|
||||
android:strokeWidth="0.0705163"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#491057"/>
|
||||
<path
|
||||
android:pathData="M41.49,25.532C40.736,26.386 35.503,25.755 32.062,25.91C29.996,26.001 28.085,24.891 27.694,22.856C27.545,22.077 28.057,21.326 28.836,21.182L40.7,19.736C40.7,19.736 42.579,24.302 41.49,25.532Z"
|
||||
android:fillColor="#FFA180"/>
|
||||
<path
|
||||
android:pathData="M41.49,25.532C40.736,26.386 35.503,25.755 32.062,25.91C29.996,26.001 28.085,24.891 27.694,22.856C27.545,22.077 28.057,21.326 28.836,21.182L40.7,19.736"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="0.095197"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#21002A"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
@@ -64,6 +64,18 @@
|
||||
tools:text="Applicant"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.navi.naviwidgets.widgets.labledtextinput.ui.LabeledTextInputWidgetV2
|
||||
android:id="@+id/labeledTextInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/sub_title_tv"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/info_ll"
|
||||
android:layout_width="match_parent"
|
||||
@@ -74,7 +86,7 @@
|
||||
android:visibility="@{(data.infoList == null || data.infoList.isEmpty())? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/sub_title_tv"
|
||||
app:layout_constraintTop_toBottomOf="@id/labeledTextInput"
|
||||
app:setBulletPoints="@{data.infoList}"
|
||||
app:textBottomMargin="@{data.listItemMargin != null ? data.listItemMargin : 3}" />
|
||||
|
||||
|
||||
@@ -400,7 +400,7 @@ class HomeLoanEmiPlanFragment :
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String) {
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
moveToNextScreen(ctaData)
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ class HomeLoanLandingPageFragment :
|
||||
openBottomSheet(ctaData)
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String) {
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
navigateTo(ctaData, false)
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@ interface RetrofitService {
|
||||
@QueryMap queryMap: HashMap<String, String>
|
||||
): Response<GenericResponse<HomeLoanFormScreenResponse>>
|
||||
|
||||
@GET("/home-loan/customers/me/journey/pan-verification-status")
|
||||
suspend fun fetchPanVerificationStatus(
|
||||
@QueryMap queryMap: HashMap<String, String>
|
||||
): Response<GenericResponse<HomeLoanPanVerificationResponse>>
|
||||
|
||||
@GET("/status/ui-status")
|
||||
suspend fun getRedirectPageStatus(): Response<GenericResponse<RedirectPageStatus>>
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ object ApiErrorTagType {
|
||||
const val HL_GET_LANDING_PAGE_ERROR = "HL_GET_LANDING_PAGE_ERROR"
|
||||
const val HL_GET_INTRO_RESPONSE_ERROR = "HL_GET_INTRO_RESPONSE_ERROR"
|
||||
const val HL_INTRO_PATCH_API_ERROR = "HL_INTRO_PATCH_API_ERROR"
|
||||
const val HL_PAN_VERIFICATION_RESPONSE_ERROR = "HL_PAN_VERIFICATION_RESPONSE_ERROR"
|
||||
|
||||
@StringDef(NO_INTERNET_ERROR)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
package com.navi.hl.steps.activity
|
||||
|
||||
import android.content.Intent
|
||||
import com.navi.design.R as DesignR
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
@@ -61,6 +62,8 @@ import com.navi.hl.steps.helper.HomeLoanSelfieCaptureHelper
|
||||
import com.navi.hl.steps.viewmodel.HomeLoanSelfieVerificationSharedVM
|
||||
import com.navi.hl.steps.viewmodel.HomeLoanStepsActivityVM
|
||||
import com.navi.hl.steps.viewmodel.PermissionVM
|
||||
import com.navi.hl.steps.viewmodel.SharedFormSearchVM
|
||||
import com.navi.hl.utils.Constants
|
||||
import com.navi.hl.utils.Constants.ACTION
|
||||
import com.navi.hl.utils.Constants.HL_PERMISSION_REQUEST_CODE
|
||||
import com.navi.hl.utils.Constants.KEY_OPEN_SIDE_TRACKER
|
||||
@@ -125,9 +128,9 @@ class HomeLoanStepsActivity :
|
||||
private var header: HLHeader? = null
|
||||
private lateinit var toggle: ActionBarDrawerToggle
|
||||
private val viewModel by viewModels<HomeLoanStepsActivityVM>()
|
||||
private val permissionSharedVM by lazy { ViewModelProvider(this).get(PermissionVM::class.java) }
|
||||
private val permissionSharedVM by lazy { ViewModelProvider(this)[PermissionVM::class.java] }
|
||||
private val selfieSharedVM by lazy {
|
||||
ViewModelProvider(this).get(HomeLoanSelfieVerificationSharedVM::class.java)
|
||||
ViewModelProvider(this)[HomeLoanSelfieVerificationSharedVM::class.java]
|
||||
}
|
||||
private val selfieVerificationHelper by lazy { HomeLoanSelfieCaptureHelper() }
|
||||
private val headerAdapter =
|
||||
@@ -140,6 +143,7 @@ class HomeLoanStepsActivity :
|
||||
private var digioResponseListener: DigioResponseListener? = null
|
||||
private var scrollListener: RecyclerView.OnScrollListener? = null
|
||||
private var isHamburgerVisible = false
|
||||
private val sharedFormSearchVM by lazy { ViewModelProvider(this)[SharedFormSearchVM::class.java] }
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -179,6 +183,14 @@ class HomeLoanStepsActivity :
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (resultCode == RESULT_OK && requestCode == Constants.PAN_VERIFICATION_REQUEST_CODE) {
|
||||
sharedFormSearchVM.setPanVerificationStatusResult(true)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initScrollListener() {
|
||||
scrollListener =
|
||||
object : RecyclerView.OnScrollListener() {
|
||||
@@ -553,7 +565,7 @@ class HomeLoanStepsActivity :
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String) {
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
ctaData?.let { navigateTo(it) }
|
||||
}
|
||||
|
||||
|
||||
@@ -401,7 +401,7 @@ class HomeLoanCloseLoansFragment :
|
||||
HomeLoanCloseLoansFragment().apply { this.arguments = arguments }
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String) {
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
ctaData?.let {
|
||||
savedBsCtaData = it
|
||||
showLoader()
|
||||
|
||||
@@ -21,16 +21,20 @@ import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.base.model.NaviClickAction
|
||||
import com.navi.base.model.NaviWidgetInfoClick
|
||||
import com.navi.base.utils.isNotNull
|
||||
import com.navi.hl.common.ui.fragment.HomeLoanBaseFragment
|
||||
import com.navi.hl.network.util.ApiErrorTagType
|
||||
import com.navi.hl.steps.viewmodel.HomeLoanCommunicationAddressFragmentVM
|
||||
import com.navi.hl.utils.Constants
|
||||
import com.navi.hl.utils.Constants.ADDRESS_REFERENCE_ID
|
||||
import com.navi.hl.utils.Constants.PERSONAL_EMAIL
|
||||
import com.navi.hl.utils.Constants.REFERENCE_ID
|
||||
import com.navi.hl.utils.NaviHLAnalytics
|
||||
import com.navi.hl.utils.observeNullable
|
||||
import com.navi.homeloan.common.customview.HLCommonBottomSheet
|
||||
import com.navi.homeloan.common.customview.HLTopNavigationHeaderInterface
|
||||
import com.navi.homeloan.common.listeners.BackListener
|
||||
import com.navi.homeloan.common.listeners.HLCommonBottomSheetListener
|
||||
import com.navi.homeloan.common.listeners.HLFooterListener
|
||||
import com.navi.homeloan.databinding.FragmentHomeLoanCommunicationAddressBinding
|
||||
import com.navi.naviwidgets.adapters.NaviAdapter
|
||||
@@ -41,7 +45,8 @@ import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class HomeLoanCommunicationAddressFragment :
|
||||
HomeLoanBaseFragment(), WidgetCallback, BackListener, HLFooterListener {
|
||||
HomeLoanBaseFragment(), WidgetCallback, BackListener, HLFooterListener,
|
||||
HLCommonBottomSheetListener {
|
||||
|
||||
private lateinit var binding: FragmentHomeLoanCommunicationAddressBinding
|
||||
private val viewModel by viewModels<HomeLoanCommunicationAddressFragmentVM>()
|
||||
@@ -155,8 +160,9 @@ class HomeLoanCommunicationAddressFragment :
|
||||
is CtaData -> {
|
||||
moveToNextScreen(naviClickAction)
|
||||
}
|
||||
|
||||
is NaviWidgetInfoClick -> {
|
||||
viewModel.selectedReferenceId = naviClickAction.widgetId
|
||||
viewModel.selectedReferenceId = naviClickAction.widgetId ?: ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,13 +192,29 @@ class HomeLoanCommunicationAddressFragment :
|
||||
|
||||
override fun onFooterNextCtaClick(ctaData: CtaData?) {
|
||||
footerNextCtaData = ctaData
|
||||
binding.response?.content?.enterEmailBottomSheet?.let {
|
||||
if (viewModel.selectedReferenceId.isNotNull()) {
|
||||
val bottomSheet = HLCommonBottomSheet.getInstance(it)
|
||||
safelyShowBottomSheet(bottomSheet, HLCommonBottomSheet.TAG)
|
||||
bottomSheet.setCommonBottomSheetListener(this)
|
||||
}
|
||||
} ?: run {
|
||||
callScreenPatchApi(ctaData)
|
||||
}
|
||||
}
|
||||
|
||||
private fun callScreenPatchApi(ctaData: CtaData?, emailId: String? = null) {
|
||||
viewModel.selectedReferenceId?.let {
|
||||
val bodyMap = hashMapOf(
|
||||
ADDRESS_REFERENCE_ID to it,
|
||||
REFERENCE_ID to queryMap[REFERENCE_ID].orEmpty()
|
||||
)
|
||||
emailId?.let { email ->
|
||||
bodyMap[PERSONAL_EMAIL] = email
|
||||
}
|
||||
viewModel.patchKycAddressDetails(
|
||||
queryMap,
|
||||
hashMapOf(
|
||||
ADDRESS_REFERENCE_ID to it,
|
||||
REFERENCE_ID to queryMap[REFERENCE_ID].orEmpty()
|
||||
),
|
||||
bodyMap,
|
||||
ctaData
|
||||
)
|
||||
}
|
||||
@@ -202,5 +224,11 @@ class HomeLoanCommunicationAddressFragment :
|
||||
moveToNextScreen(ctaData)
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
if (bottomSheetType == HLCommonBottomSheet.INPUT_TYPE_BOTTOM_SHEET) {
|
||||
callScreenPatchApi(footerNextCtaData, inputTextData)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLifeCycle(): Lifecycle = lifecycle
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ class HomeLoanESignVerificationFragment :
|
||||
loanDetailsListener?.setLoanDetails(loanDetailsBottomSheetData)
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String) {
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
if (bottomSheetType == E_SIGN_API_ERROR) {
|
||||
showLoader()
|
||||
viewModel.digioStatusUpdate(
|
||||
|
||||
@@ -70,6 +70,8 @@ import com.navi.hl.utils.Constants.FLAT
|
||||
import com.navi.hl.utils.Constants.HIDE
|
||||
import com.navi.hl.utils.Constants.ID_PROPERTY_ID
|
||||
import com.navi.hl.utils.Constants.NOT_DECIDED
|
||||
import com.navi.hl.utils.Constants.PAN_VERIFICATION_BOTTOM_SHEET
|
||||
import com.navi.hl.utils.Constants.PAN_VERIFICATION_REQUEST_CODE
|
||||
import com.navi.hl.utils.Constants.PIN_CODE_WIDGET_ID
|
||||
import com.navi.hl.utils.Constants.POLLING_TIMEOUT
|
||||
import com.navi.hl.utils.Constants.PROPERTY_NAME
|
||||
@@ -101,6 +103,7 @@ import com.navi.naviwidgets.callbacks.WidgetCallback
|
||||
import com.navi.naviwidgets.models.NaviBaseAdapterModel
|
||||
import com.navi.naviwidgets.models.NaviWidget
|
||||
import com.navi.naviwidgets.models.response.ProductBenefitsGridWidget
|
||||
import com.navi.naviwidgets.utils.toCtaData
|
||||
import com.navi.naviwidgets.widgets.bottomsheetselector.LabeledOptionSelectorListWidgetModel
|
||||
import com.navi.naviwidgets.widgets.bottomsheetselector.OptionSelectAction
|
||||
import com.navi.naviwidgets.widgets.bottomsheetselector.ui.LabeledOptionSelectorListWidget
|
||||
@@ -114,6 +117,7 @@ import com.navi.naviwidgets.widgets.tileoptionselector.TileOptionClickAction
|
||||
import com.navi.naviwidgets.widgets.tileoptionselector.WidgetAction
|
||||
import com.navi.naviwidgets.widgets.tileoptionselector.WidgetActionType
|
||||
import com.navi.naviwidgets.widgets.tileoptionselector.WidgetClickHint
|
||||
import com.naviapp.common.navigator.NaviDeepLinkNavigator
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -137,9 +141,8 @@ class HomeLoanFormScreenFragment :
|
||||
private var pinCodeWidget: LabeledTextInputWidgetV2? = null
|
||||
private var relationWidget: LabeledOptionSelectorListWidget? = null
|
||||
private val knowMoreEventTracker = NaviHLAnalytics.naviHLAnalytics.HomeLoanBase()
|
||||
private var ctaAfterUserDataUpload: CtaData? = null
|
||||
private val sharedFormSearchVM by lazy {
|
||||
ViewModelProvider(requireActivity()).get(SharedFormSearchVM::class.java)
|
||||
ViewModelProvider(requireActivity())[SharedFormSearchVM::class.java]
|
||||
}
|
||||
private val userDataViewModel by viewModels<UserDataViewModel>()
|
||||
private val permissionsManager by lazy { PermissionsManager(requireActivity()) }
|
||||
@@ -167,15 +170,12 @@ class HomeLoanFormScreenFragment :
|
||||
viewModel,
|
||||
listOf(
|
||||
Pair(screenGetApiRetryListener, ApiErrorTagType.HL_FORM_SCREEN_GET_RESPONSE_ERROR),
|
||||
Pair(
|
||||
screenPatchApiRetryListener,
|
||||
ApiErrorTagType.HL_FORM_SCREEN_PATCH_RESPONSE_ERROR
|
||||
)
|
||||
Pair(screenPatchApiRetryListener, ApiErrorTagType.HL_FORM_SCREEN_PATCH_RESPONSE_ERROR),
|
||||
Pair(panVerificationStatusApiRetryListener, ApiErrorTagType.HL_PAN_VERIFICATION_RESPONSE_ERROR)
|
||||
),
|
||||
dialogOnBackPressed = { activity?.onBackPressed() }
|
||||
)
|
||||
initObservers()
|
||||
initUserDataObserver()
|
||||
initUI()
|
||||
fetchFormScreenResponse()
|
||||
return binding.root
|
||||
@@ -187,61 +187,8 @@ class HomeLoanFormScreenFragment :
|
||||
private val screenPatchApiRetryListener: View.OnClickListener =
|
||||
View.OnClickListener { _ -> onFooterNextCtaClick(null) }
|
||||
|
||||
private fun callScreenAfterUserDataUpload() {
|
||||
hideLoader()
|
||||
apiPollScheduler?.stopApiPoll()
|
||||
deInitializeAsyncListeners()
|
||||
viewModel.deInit()
|
||||
ctaAfterUserDataUpload?.let { moveToNextScreen(it) } ?: run { showApiErrorBottomSheet() }
|
||||
}
|
||||
|
||||
private fun showApiErrorBottomSheet() {
|
||||
userDataViewModel.deInit()
|
||||
binding.response?.content?.apiErrorBottomSheetData?.let {
|
||||
val bottomSheet = HLCommonBottomSheet.getInstance(it)
|
||||
safelyShowBottomSheet(bottomSheet, HLCommonBottomSheet.TAG)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initUserDataObserver() {
|
||||
viewModel.apiPollStatus.observeNullable(viewLifecycleOwner) {
|
||||
it?.let {
|
||||
if (it == FirebaseStatusType.SUCCESS || it == FirebaseStatusType.FAILURE) {
|
||||
callScreenAfterUserDataUpload()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
userDataViewModel.deviceDataSentStatus.observeNonNull(viewLifecycleOwner) { deviceDataSent
|
||||
->
|
||||
if (deviceDataSent) {
|
||||
userDataViewModel.userDataSentStatus.observeNonNull(viewLifecycleOwner) {
|
||||
userDataUploadCallbackResponse ->
|
||||
if (userDataUploadCallbackResponse.ingestionStatusList == null) {
|
||||
hideLoader()
|
||||
showApiErrorBottomSheet()
|
||||
} else {
|
||||
userDataUploadCallbackResponse.uploadDataAsyncResponse?.let {
|
||||
val requestId = it.requestId.orEmpty()
|
||||
val notificationPath = it.notificationPath.orEmpty()
|
||||
val type = it.requestType.orEmpty()
|
||||
if (
|
||||
requestId.isNotEmpty() &&
|
||||
notificationPath.isNotEmpty() &&
|
||||
type.isNotEmpty()
|
||||
) {
|
||||
firebaseInit(requestId, notificationPath, type)
|
||||
apiPollInit(requestId, it.requestConfig)
|
||||
} else {
|
||||
callScreenAfterUserDataUpload()
|
||||
}
|
||||
}
|
||||
?: callScreenAfterUserDataUpload()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private val panVerificationStatusApiRetryListener: View.OnClickListener =
|
||||
View.OnClickListener { _ -> viewModel.fetchPanVerificationStatus(queryMap) }
|
||||
|
||||
private fun fetchFormScreenResponse() {
|
||||
listener?.hideTrackerHeader()
|
||||
@@ -300,6 +247,22 @@ class HomeLoanFormScreenFragment :
|
||||
|
||||
private fun initObservers() {
|
||||
sharedFormSearchVM.setSelectedSearchItem(null)
|
||||
sharedFormSearchVM.panVerificationStatusFromAP.observeNonNull(viewLifecycleOwner) {
|
||||
if(it.panVerificationResultReceived) {
|
||||
viewModel.fetchPanVerificationStatus(queryMap)
|
||||
}
|
||||
|
||||
}
|
||||
viewModel.panVerificationResponse.observeNullable(viewLifecycleOwner) {
|
||||
it?.let { panVerificationResponse ->
|
||||
if(panVerificationResponse.isPanVerified == true) {
|
||||
moveToNextScreenAndStartUserDataUpload(panVerificationResponse.cta)
|
||||
} else {
|
||||
showPanVerificationBottomSheet()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.formGetResponse.observeNullable(viewLifecycleOwner) { response ->
|
||||
binding.response = response
|
||||
response?.let {
|
||||
@@ -354,14 +317,14 @@ class HomeLoanFormScreenFragment :
|
||||
apiPollInit(requestId, response.requestConfig)
|
||||
} else if (response?.cta.isNotNull()) {
|
||||
if (isPropertyDetailScreen()) {
|
||||
initiateUserDataUploadProcess(response?.cta)
|
||||
checkUserPanVerificationStatus(response?.cta)
|
||||
} else {
|
||||
hideLoader()
|
||||
moveToNextScreen(response?.cta)
|
||||
}
|
||||
} else {
|
||||
if (isPropertyDetailScreen()) {
|
||||
initiateUserDataUploadProcess(viewModel.formGetResponse.value?.footer?.nextCta)
|
||||
checkUserPanVerificationStatus(viewModel.formGetResponse.value?.footer?.nextCta)
|
||||
} else {
|
||||
hideLoader()
|
||||
checkCtaAndMoveToNextScreen()
|
||||
@@ -415,25 +378,47 @@ class HomeLoanFormScreenFragment :
|
||||
}
|
||||
}
|
||||
|
||||
private fun initiateUserDataUploadProcess(cta: CtaData?) {
|
||||
private fun showPanVerificationBottomSheet() {
|
||||
binding.response?.content?.panVerificationPendingBottomSheet?.let { bottomSheetData ->
|
||||
val bottomSheet = HLCommonBottomSheet.getInstance(bottomSheetData)
|
||||
bottomSheet.setBottomSheetType(PAN_VERIFICATION_BOTTOM_SHEET)
|
||||
safelyShowBottomSheet(bottomSheet, HLCommonBottomSheet.TAG)
|
||||
bottomSheet.setCommonBottomSheetListener(this)
|
||||
}
|
||||
}
|
||||
|
||||
private fun moveToNextScreenAndStartUserDataUpload(cta: CtaData?) {
|
||||
checkPermissionAndStartUserDataUpload()
|
||||
moveToNextScreen(cta)
|
||||
}
|
||||
|
||||
private fun checkUserPanVerificationStatus(cta: CtaData?) {
|
||||
hideLoader()
|
||||
if (binding.response?.content?.isPanVerified == true) {
|
||||
moveToNextScreenAndStartUserDataUpload(cta)
|
||||
} else {
|
||||
showPanVerificationBottomSheet()
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkPermissionAndStartUserDataUpload() {
|
||||
val readSmsPermissionAllowed = permissionsManager.hasPermission(Manifest.permission.READ_SMS)
|
||||
val readContactsPermissionAllowed = permissionsManager.hasPermission(Manifest.permission.READ_CONTACTS)
|
||||
val coarseLocationPermissionAllowed = permissionsManager.hasPermission(Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||
ctaAfterUserDataUpload = cta
|
||||
if (readSmsPermissionAllowed || readContactsPermissionAllowed || coarseLocationPermissionAllowed) {
|
||||
sendUserData(readSmsPermissionAllowed, readContactsPermissionAllowed, coarseLocationPermissionAllowed)
|
||||
context?.let { context ->
|
||||
sendDeviceData(getScreenRefreshRate(context, this.activity?.windowManager))
|
||||
}
|
||||
} else {
|
||||
hideLoader()
|
||||
moveToNextScreen(cta)
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendDeviceData(verticalScanRate: String?) {
|
||||
val deviceDetails = getDeviceDetails(verticalScanRate)
|
||||
userDataViewModel.sendDeviceDetails(deviceDetails)
|
||||
userDataViewModel.sendDeviceDetails(
|
||||
deviceDetail = deviceDetails,
|
||||
isOpLifecycleBound = false
|
||||
)
|
||||
}
|
||||
|
||||
private fun sendUserData(
|
||||
@@ -445,7 +430,8 @@ class HomeLoanFormScreenFragment :
|
||||
uploadSms = readSmsPermissionAllowed,
|
||||
uploadContacts = readContactsPermissionAllowed,
|
||||
uploadAppUsedInfo = true,
|
||||
Constants.BUSINESS_VERTICAL_HL
|
||||
businessVertical = Constants.BUSINESS_VERTICAL_HL,
|
||||
isOpLifecycleBound = false
|
||||
)
|
||||
if (coarseLocationPermissionAllowed) {
|
||||
sendLocation(locationPermissionData = PermissionRequestData())
|
||||
@@ -627,11 +613,7 @@ class HomeLoanFormScreenFragment :
|
||||
|
||||
private val onPollingEnd = {
|
||||
hideLoader()
|
||||
if (isPropertyDetailScreen()) {
|
||||
callScreenAfterUserDataUpload()
|
||||
} else {
|
||||
handleTimeOutError(ApiErrorTagType.PAN_DETAILS_UPLOAD)
|
||||
}
|
||||
handleTimeOutError(ApiErrorTagType.PAN_DETAILS_UPLOAD)
|
||||
logDownTimeEvent()
|
||||
}
|
||||
|
||||
@@ -652,7 +634,7 @@ class HomeLoanFormScreenFragment :
|
||||
?: ApiPollScheduler.API_POLL_RETRY_COUNT,
|
||||
doOnTimeout = onPollingEnd
|
||||
) {
|
||||
viewModel.fetchAsyncRequestData(requestId, isPropertyDetailScreen())
|
||||
viewModel.fetchAsyncRequestData(requestId)
|
||||
}
|
||||
apiPollScheduler?.scheduleApiPoll()
|
||||
}
|
||||
@@ -857,6 +839,21 @@ class HomeLoanFormScreenFragment :
|
||||
moveToNextScreen(ctaData)
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
if (bottomSheetType == PAN_VERIFICATION_BOTTOM_SHEET) {
|
||||
ctaData?.let {
|
||||
NaviDeepLinkNavigator.navigate(
|
||||
activity = activity,
|
||||
ctaData = it,
|
||||
needsResult = true,
|
||||
requestCode = PAN_VERIFICATION_REQUEST_CODE
|
||||
)
|
||||
}
|
||||
} else {
|
||||
moveToNextScreen(ctaData)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFooterKnowMoreInfoClicked(bottomSheetData: HomeLoanGenericBottomSheetData?) {
|
||||
bottomSheetData?.let {
|
||||
knowMoreEventTracker.onKnowMoreClicked()
|
||||
|
||||
@@ -362,7 +362,7 @@ class HomeLoanFormScreenFragmentV2 :
|
||||
viewModel.patchFormScreenDetails(queryMap, bodyMap, ctaData)
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String) {
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
if (bottomSheetType != OFFER_DEGRADATION_BS || ctaData?.url.isNotNullAndNotEmpty()) {
|
||||
showLoader()
|
||||
viewModel.patchFormScreenDetails(queryMap, bodyMap, ctaData)
|
||||
|
||||
@@ -387,7 +387,7 @@ class HomeLoanWidgetizedInfoFragment :
|
||||
loanDetailsListener?.setLoanDetails(loanDetailsBottomSheetData)
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String) {
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
moveToNextScreen(ctaData)
|
||||
}
|
||||
|
||||
|
||||
@@ -27,4 +27,7 @@ class HomeLoanFormScreenRepository : ResponseCallback() {
|
||||
|
||||
suspend fun fetchCityAndState(pinCode: String) =
|
||||
apiResponseCallback(retrofitService().fetchCityAndState(pinCode))
|
||||
|
||||
suspend fun fetchPanVerificationStatus(queryMap: HashMap<String, String>) =
|
||||
apiResponseCallback(retrofitService().fetchPanVerificationStatus(queryMap))
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.navi.hl.utils.Constants.ID_PURCHASE_TYPE
|
||||
import com.navi.hl.utils.Constants.ID_RESALE_PROPERTY
|
||||
import com.navi.homeloan.common.models.HomeLoanFormPatchResponse
|
||||
import com.navi.homeloan.common.models.HomeLoanFormScreenResponse
|
||||
import com.navi.homeloan.common.models.HomeLoanPanVerificationResponse
|
||||
import com.navi.homeloan.common.models.PinCodeData
|
||||
import com.navi.homeloan.common.models.RedirectPageStatus
|
||||
import com.navi.naviwidgets.models.NaviWidget
|
||||
@@ -44,6 +45,10 @@ class HomeLoanFormScreenFragmentVM(
|
||||
val formGetResponse: LiveData<HomeLoanFormScreenResponse?>
|
||||
get() = _formGetResponse
|
||||
|
||||
private val _panVerificationResponse = MutableLiveData<HomeLoanPanVerificationResponse?>()
|
||||
val panVerificationResponse: LiveData<HomeLoanPanVerificationResponse?>
|
||||
get() = _panVerificationResponse
|
||||
|
||||
private val _formPatchResponse = MutableLiveData<HomeLoanFormPatchResponse?>()
|
||||
val formPatchResponse: LiveData<HomeLoanFormPatchResponse?>
|
||||
get() = _formPatchResponse
|
||||
@@ -69,10 +74,6 @@ class HomeLoanFormScreenFragmentVM(
|
||||
val invalidPinCode: LiveData<GenericErrorResponse?>
|
||||
get() = _invalidPinCode
|
||||
|
||||
private val _apiPollStatus = MutableLiveData<String?>()
|
||||
val apiPollStatus: LiveData<String?>
|
||||
get() = _apiPollStatus
|
||||
|
||||
fun fetchFormScreenResponse(queryMap: HashMap<String, String>) =
|
||||
viewModelScope.launch {
|
||||
val response = repository.fetchFormScreenResponse(queryMap)
|
||||
@@ -88,6 +89,21 @@ class HomeLoanFormScreenFragmentVM(
|
||||
}
|
||||
}
|
||||
|
||||
fun fetchPanVerificationStatus(queryMap: HashMap<String, String>) {
|
||||
viewModelScope.launch {
|
||||
val response = repository.fetchPanVerificationStatus(queryMap)
|
||||
if (response.error == null && response.errors.isNullOrEmpty()) {
|
||||
_panVerificationResponse.value = response.data
|
||||
} else {
|
||||
setErrorData(
|
||||
errors = response.errors,
|
||||
error = response.error,
|
||||
tag = ApiErrorTagType.HL_PAN_VERIFICATION_RESPONSE_ERROR
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun patchFormScreenDetails(
|
||||
queryMap: HashMap<String, String>,
|
||||
bodyMap: HashMap<String, String>,
|
||||
@@ -118,20 +134,16 @@ class HomeLoanFormScreenFragmentVM(
|
||||
}
|
||||
}
|
||||
|
||||
fun fetchAsyncRequestData(requestId: String, isUserDataUploadAsync: Boolean) =
|
||||
fun fetchAsyncRequestData(requestId: String) =
|
||||
coroutineScope.launch {
|
||||
val response = repository.fetchAsyncRequestData(requestId)
|
||||
if (response.error == null && response.errors.isNullOrEmpty()) {
|
||||
if (isUserDataUploadAsync) {
|
||||
_apiPollStatus.value = response.data?.status.orEmpty()
|
||||
} else {
|
||||
if (TextUtils.equals(response.data?.status, FirebaseStatusType.FAILURE)) {
|
||||
checkUiStatus(response.errors, response.warning)
|
||||
return@launch
|
||||
}
|
||||
if (TextUtils.equals(response.data?.status, FirebaseStatusType.FAILURE)) {
|
||||
checkUiStatus(response.errors, response.warning)
|
||||
return@launch
|
||||
}
|
||||
} else {
|
||||
if (!isUserDataUploadAsync) _genericPollingError.value = true
|
||||
_genericPollingError.value = true
|
||||
setErrorData(response.errors, response.error)
|
||||
}
|
||||
}
|
||||
@@ -172,7 +184,7 @@ class HomeLoanFormScreenFragmentVM(
|
||||
}
|
||||
if (
|
||||
widget.widgetId == ID_PROPERTY_TYPE &&
|
||||
widget is LabeledOptionSelectorTileWidgetModel
|
||||
widget is LabeledOptionSelectorTileWidgetModel
|
||||
) {
|
||||
widget.widgetData?.tileSelectorData?.items?.let { tileSelectorItems ->
|
||||
for (item in tileSelectorItems) {
|
||||
@@ -196,7 +208,7 @@ class HomeLoanFormScreenFragmentVM(
|
||||
}
|
||||
if (
|
||||
widget.widgetId == ID_PURCHASE_TYPE &&
|
||||
widget is LabeledOptionSelectorListWidgetModel
|
||||
widget is LabeledOptionSelectorListWidgetModel
|
||||
) {
|
||||
widget.widgetData?.listSelectorData?.items?.let { listSelectorItems ->
|
||||
for (item in listSelectorItems) {
|
||||
@@ -227,7 +239,7 @@ class HomeLoanFormScreenFragmentVM(
|
||||
for (widget in it) {
|
||||
if (
|
||||
widget.widgetId == ID_PROPERTY_ID &&
|
||||
widget is LabeledOptionSelectorListWidgetModel
|
||||
widget is LabeledOptionSelectorListWidgetModel
|
||||
) {
|
||||
return widget.widgetData?.listSelectorData?.listTitle
|
||||
}
|
||||
@@ -236,7 +248,4 @@ class HomeLoanFormScreenFragmentVM(
|
||||
return null
|
||||
}
|
||||
|
||||
fun deInit() {
|
||||
_apiPollStatus.value = null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.navi.common.viewmodel.BaseVM
|
||||
import com.navi.homeloan.common.models.HLNavigationHeader
|
||||
import com.navi.homeloan.common.models.HLPanVerificationStatusFromAP
|
||||
import com.navi.homeloan.common.models.HLTowerSelectionData
|
||||
import com.navi.homeloan.common.models.InputSearchRow
|
||||
import com.navi.naviwidgets.widgets.labeledinputsearch.LabeledTextInputSearchWidgetModel
|
||||
@@ -33,6 +34,14 @@ class SharedFormSearchVM : BaseVM() {
|
||||
val towerAdditionalData: LiveData<HLTowerSelectionData>
|
||||
get() = _towerAdditionalData
|
||||
|
||||
private val _panVerificationStatusFromAP = MutableLiveData<HLPanVerificationStatusFromAP>()
|
||||
val panVerificationStatusFromAP: LiveData<HLPanVerificationStatusFromAP>
|
||||
get() = _panVerificationStatusFromAP
|
||||
|
||||
fun setPanVerificationStatusResult(status: Boolean) {
|
||||
_panVerificationStatusFromAP.value = HLPanVerificationStatusFromAP(status)
|
||||
}
|
||||
|
||||
fun setSelectedSearchItem(selectedItem: InputSearchRow? = null) {
|
||||
_selectedItem.value = selectedItem
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class HomeLoanIntroActivity :
|
||||
const val NEW_HL_SCREEN_ACTIVITY = "New_HL_Screen_Activity"
|
||||
}
|
||||
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String) {
|
||||
override fun onBsCtaClick(ctaData: CtaData?, bottomSheetType: String, inputTextData: String) {
|
||||
ctaData?.let { navigateTo(it) }
|
||||
}
|
||||
|
||||
|
||||
@@ -120,4 +120,7 @@ object Constants {
|
||||
const val SHOULD_REFRESH_SCREEN = "SHOULD_REFRESH_SCREEN"
|
||||
const val CO_APPLICANT_SEND_OTP = "CO_APPLICANT_SEND_OTP"
|
||||
const val CO_APPLICANT_PERSONAL_DETAILS = "CO_APPLICANT_PERSONAL_DETAILS"
|
||||
const val PERSONAL_EMAIL = "personalEmail"
|
||||
const val PAN_VERIFICATION_REQUEST_CODE = 1002
|
||||
const val PAN_VERIFICATION_BOTTOM_SHEET = "PAN_VERIFICATION_BOTTOM_SHEET"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user