TP-78568 | Pre-approved property city collection changes (#12433)
This commit is contained in:
@@ -18,12 +18,35 @@
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:paddingTop="@dimen/dp_24"
|
||||
android:paddingTop="@dimen/dp_16"
|
||||
android:paddingEnd="@dimen/dp_16"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scroll_rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:background="@drawable/bg_white_rounded_10"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:paddingEnd="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toTopOf="@id/footer_view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/search_widget">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/form_content_rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:paddingBottom="@dimen/dp_50"
|
||||
android:visibility="gone" />
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/search_content_rv"
|
||||
android:layout_width="match_parent"
|
||||
@@ -33,6 +56,7 @@
|
||||
android:paddingTop="@dimen/dp_4"
|
||||
android:paddingEnd="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_8"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/footer_view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -52,10 +76,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
package com.navi.naviwidgets.utils
|
||||
|
||||
import android.animation.Animator
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
@@ -15,6 +16,8 @@ import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Build
|
||||
import android.os.CountDownTimer
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.text.InputFilter
|
||||
import android.text.Spanned
|
||||
import android.util.TypedValue
|
||||
@@ -22,6 +25,8 @@ import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.EditText
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
@@ -1199,3 +1204,22 @@ fun LinearLayout.setItemsData(items: List<CardItems>?) {
|
||||
addView(binding?.root)
|
||||
}
|
||||
}
|
||||
|
||||
fun EditText.openKeyboard(context: Context, delay: Long = 100) {
|
||||
try {
|
||||
Handler(Looper.getMainLooper())
|
||||
.postDelayed(
|
||||
{
|
||||
requestFocus()
|
||||
setSelection(length())
|
||||
(context.getSystemService(Activity.INPUT_METHOD_SERVICE) as? InputMethodManager)
|
||||
?.apply {
|
||||
showSoftInput(this@openKeyboard, InputMethodManager.SHOW_IMPLICIT)
|
||||
}
|
||||
},
|
||||
delay
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
e.log()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.navi.naviwidgets.databinding.ViewLabeledTextInputBinding
|
||||
import com.navi.naviwidgets.extensions.setMaxCharLength
|
||||
import com.navi.naviwidgets.utils.EMPTY
|
||||
import com.navi.naviwidgets.utils.NaviWidgetIconUtils
|
||||
import com.navi.naviwidgets.utils.openKeyboard
|
||||
import com.navi.naviwidgets.validations.BaseInputValidation
|
||||
import com.navi.naviwidgets.widgets.TextInputUtil
|
||||
import com.navi.naviwidgets.widgets.labeledinputsearch.InputSearchClickAction
|
||||
@@ -123,6 +124,7 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||
widgetModel.inputData = it
|
||||
widgetBinding.plainTextInput.setText(it)
|
||||
}
|
||||
widgetBinding.crossIv.isVisible = true
|
||||
}
|
||||
?: run {
|
||||
widgetModel.inputData = null
|
||||
@@ -142,6 +144,11 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||
}
|
||||
}
|
||||
|
||||
fun enableTyping() {
|
||||
widgetBinding.plainTextInput.requestFocus()
|
||||
widgetBinding.plainTextInput.openKeyboard(context)
|
||||
}
|
||||
|
||||
private fun updateSearchIcon(iconCode: String?) {
|
||||
if (iconCode.isNullOrEmpty().not()) {
|
||||
val icon = NaviWidgetIconUtils.getIconResourceId(iconCode.orEmpty())
|
||||
@@ -212,7 +219,10 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||
fun showCrossIcon(show: Boolean) {
|
||||
widgetBinding.crossIv.isVisible =
|
||||
show && shouldShowCrossIcon && widgetModel.inputData.isNotNullAndNotEmpty()
|
||||
widgetBinding.crossIv.setOnClickListener { setText(EMPTY, false) }
|
||||
widgetBinding.crossIv.setOnClickListener {
|
||||
setText(EMPTY, false)
|
||||
widgetBinding.crossIv.isVisible = false
|
||||
}
|
||||
widgetBinding.plainTextInput.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ abstract class HomeLoanBaseActivity : BaseActivity(), Navigator {
|
||||
|
||||
override fun navigateTo(ctaData: CtaData?, finish: Boolean) {
|
||||
analyticsEventTracker.onHLCtaClicked(ctaData)
|
||||
val path = (ctaData?.url ?: "").split("/")
|
||||
val path = (ctaData?.url)?.split("/") ?: emptyList()
|
||||
if (path.isNotEmpty()) {
|
||||
addCtaParamsToQueryMap(ctaData?.parameters?.toMutableList())
|
||||
if (screenNameForNavigation == path.getOrNull(1)) {
|
||||
|
||||
@@ -72,6 +72,7 @@ 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.OTHER
|
||||
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
|
||||
@@ -243,7 +244,7 @@ class HomeLoanFormScreenFragment :
|
||||
}
|
||||
|
||||
private fun enableNextCtaForCitySelection(widgetId: String) {
|
||||
if (selectedCity.isNotEmpty()) {
|
||||
if (selectedCity.isNotEmpty() && selectedCity != OTHER) {
|
||||
binding.footerView.enableNextCta(true)
|
||||
citySelectionMap.clear()
|
||||
citySelectionMap[widgetId] = selectedCity
|
||||
@@ -1057,6 +1058,7 @@ class HomeLoanFormScreenFragment :
|
||||
is NaviBenefitsItemClick -> {
|
||||
selectedCity = naviClickAction.itemDescription ?: EMPTY
|
||||
enableNextCtaForCitySelection(widgetId ?: CITY_WIDGET_ID)
|
||||
moveToNextScreen(naviClickAction.ctaData)
|
||||
}
|
||||
is TileOptionClickAction -> {
|
||||
latestPropertyTypeSelected = naviClickAction.selectedOptionId
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -24,6 +24,7 @@ import com.navi.base.model.CtaData
|
||||
import com.navi.base.model.NaviClickAction
|
||||
import com.navi.base.model.ValueWidgetClickAction
|
||||
import com.navi.base.utils.isNotNullAndNotEmpty
|
||||
import com.navi.hl.common.adapter.HLFormScreenAdapter
|
||||
import com.navi.hl.common.adapter.PagerLoadingAdapter
|
||||
import com.navi.hl.common.ui.activity.HomeLoanBaseActivity
|
||||
import com.navi.hl.common.ui.fragment.HomeLoanBaseFragment
|
||||
@@ -33,9 +34,9 @@ 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.NaviHLAnalytics
|
||||
import com.navi.hl.utils.NaviHLAnalytics.Companion.PRE_APPROVED_CITY_SELECTION_ACTION
|
||||
import com.navi.hl.utils.observeNonNull
|
||||
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.HLFooterListener
|
||||
@@ -45,6 +46,7 @@ import com.navi.homeloan.databinding.FragmentHomeLoanFormSearchBinding
|
||||
import com.navi.naviwidgets.adapters.BasePagingRVAdapter
|
||||
import com.navi.naviwidgets.callbacks.WidgetCallback
|
||||
import com.navi.naviwidgets.models.NaviBaseAdapterModel
|
||||
import com.navi.naviwidgets.models.NaviWidget
|
||||
import com.navi.naviwidgets.viewholder.ViewHolderFactoryImpl
|
||||
import com.navi.naviwidgets.widgets.labeledinputsearch.InputSearchClickAction
|
||||
import com.navi.naviwidgets.widgets.labeledinputsearch.LabeledTextInputSearchWidgetModel
|
||||
@@ -58,6 +60,8 @@ class HomeLoanFormSearchFragment :
|
||||
private val analyticsEventTracker = NaviHLAnalytics.naviHLAnalytics.HomeLoanFormScreen()
|
||||
private val viewModel by viewModels<HomeLoanFormSearchFragmentVM>()
|
||||
private var listener: HLTopNavigationHeaderInterface? = null
|
||||
private var screenWidgets: List<NaviWidget> = listOf()
|
||||
private var formAdapter: HLFormScreenAdapter<NaviBaseAdapterModel>? = null
|
||||
private val sharedFormSearchVM by lazy {
|
||||
ViewModelProvider(requireActivity()).get(SharedFormSearchVM::class.java)
|
||||
}
|
||||
@@ -182,12 +186,12 @@ class HomeLoanFormSearchFragment :
|
||||
viewModel.cityUnServiceableResponse.observeNonNull(viewLifecycleOwner) {
|
||||
hideLoader()
|
||||
it?.let {
|
||||
analyticsEventTracker.onUnServiceableCityBsShown(
|
||||
queryMap[ACTION],
|
||||
analyticsEventTracker.onPreApprovedCitySelection(
|
||||
PRE_APPROVED_CITY_SELECTION_ACTION,
|
||||
viewModel.selectedItemValue
|
||||
)
|
||||
val bottomSheet = HLCommonBottomSheet.getInstance(it)
|
||||
safelyShowBottomSheet(bottomSheet, HLCommonBottomSheet.TAG)
|
||||
binding.footerView.enableNextCta(false)
|
||||
binding.formContentRv.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,10 +203,21 @@ class HomeLoanFormSearchFragment :
|
||||
}
|
||||
|
||||
private fun processFormContent(formContent: HomeLoanFormScreenContent) {
|
||||
formContent.widgets
|
||||
?.filterNot { it.widgetId == Constants.CITY_INPUT_WIDGET }
|
||||
.let { screenWidgets = it.orEmpty() }
|
||||
formAdapter = HLFormScreenAdapter(screenWidgets, this)
|
||||
binding.formContentRv.layoutManager = LinearLayoutManager(requireContext())
|
||||
binding.formContentRv.adapter = formAdapter
|
||||
formContent.widgets?.filterIsInstance<LabeledTextInputSearchWidgetModel>()?.first()?.let {
|
||||
it.enableOnlyClick = true
|
||||
binding.searchWidget.updateData(it, 0, this@HomeLoanFormSearchFragment)
|
||||
if (it.widgetData?.inputTextSearchItemData?.savedText.isNotNullAndNotEmpty()) {
|
||||
binding.searchWidget.shouldShowCrossIcon = true
|
||||
binding.searchWidget.showCrossIcon(true)
|
||||
binding.searchContentRv.visibility = View.GONE
|
||||
}
|
||||
if (it.widgetData?.inputTextSearchItemData?.savedText.isNullOrEmpty()) {
|
||||
binding.searchContentRv.visibility = View.GONE
|
||||
}
|
||||
lifecycleScope.launch {
|
||||
@@ -236,6 +251,8 @@ class HomeLoanFormSearchFragment :
|
||||
binding.searchContentRv.visibility = View.GONE
|
||||
}
|
||||
is InputSearchClickAction -> {
|
||||
binding.formContentRv.visibility = View.GONE
|
||||
binding.footerView.enableNextCta(true)
|
||||
analyticsEventTracker.onFormWidgetClick(
|
||||
queryMap[ACTION],
|
||||
naviClickAction.widgetId,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -119,6 +119,7 @@ class HomeLoanSearchFragment : HomeLoanBaseFragment(), WidgetCallback, BackListe
|
||||
val searchApiUrl = searchApiDetails?.url?.trimStart('/')
|
||||
searchType = searchApiDetails?.searchType ?: TYPE_PROPERTY_SEARCH
|
||||
val data = sharedFormSearchVM.inputSearchWidgetModel
|
||||
data?.enableOnlyClick = false
|
||||
if (data is LabeledTextInputSearchWidgetModel) {
|
||||
NaviTrackEvent.startScreen(
|
||||
screenName.plus(NaviHLAnalytics.POST_FIX_LANDED),
|
||||
@@ -158,6 +159,7 @@ class HomeLoanSearchFragment : HomeLoanBaseFragment(), WidgetCallback, BackListe
|
||||
}
|
||||
}
|
||||
}
|
||||
binding.searchWidget.enableTyping()
|
||||
}
|
||||
|
||||
private fun showScreenLoader() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2022-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2022-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -134,4 +134,6 @@ object Constants {
|
||||
const val FS_LOTTIE = "FS_LOTTIE"
|
||||
const val CIRCULAR_LOADER = "CIRCULAR_LOADER"
|
||||
const val CTA_REDIRECTION_ENABLED = "CTA_REDIRECTION_ENABLED"
|
||||
const val CITY_INPUT_WIDGET = "city"
|
||||
const val OTHER = "Other"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2023 by Navi Technologies Limited
|
||||
* * Copyright © 2023-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -8,8 +8,7 @@
|
||||
package com.navi.hl.utils
|
||||
|
||||
enum class HlAction {
|
||||
PERSONAL_DETAILS,
|
||||
EMPLOYMENT_DETAILS,
|
||||
PROPERTY_CITY,
|
||||
PROPERTY_DETAILS
|
||||
PROPERTY_DETAILS,
|
||||
UNSERVICEABLE_PROPERTY_CITY
|
||||
}
|
||||
|
||||
@@ -150,6 +150,13 @@ class NaviHLAnalytics private constructor() {
|
||||
bodyMap
|
||||
)
|
||||
}
|
||||
|
||||
fun onPreApprovedCitySelection(action: String?, city: String?) {
|
||||
NaviTrackEvent.trackEventOnClickStream(
|
||||
PRE_FIX_NEW_HL.plus(action).plus("_City_Selected"),
|
||||
mapOf(Pair("city", city.orEmpty()))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
inner class HomeLoanLoader {
|
||||
@@ -469,6 +476,7 @@ class NaviHLAnalytics private constructor() {
|
||||
const val PRE_FIX_NEW_HL = "New_HL_"
|
||||
const val UNDERSCORE_LOADER_PAGE = "_Loader_Page"
|
||||
const val POST_FIX_APPLICANTS_LANDED = "_Applicants_Landed"
|
||||
const val PRE_APPROVED_CITY_SELECTION_ACTION = "Pre_Approved"
|
||||
const val YES = "yes"
|
||||
const val NO = "no"
|
||||
val naviHLAnalytics: NaviHLAnalytics by lazy { Holder.INSTANCE }
|
||||
|
||||
Reference in New Issue
Block a user