Merge pull request #2414 from medici/APP-1321

Invest Now button on Fund Details in NFO
This commit is contained in:
rahul bhat
2022-02-08 12:25:06 +05:30
committed by GitHub Enterprise
2 changed files with 26 additions and 9 deletions

View File

@@ -74,6 +74,7 @@ class MutualFundActivity : BaseActivity<MutualfundActivityBinding, MutualFundVie
bindViewModel()
init()
initControl()
initListeners()
setDate()
binding.nfo = false
if (!isInId.isNullOrEmpty()) {
@@ -82,6 +83,20 @@ class MutualFundActivity : BaseActivity<MutualfundActivityBinding, MutualFundVie
}
}
private fun initListeners() {
binding.nested.setOnScrollChangeListener(NestedScrollView.OnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
val scrollViewLocationCoordinate = IntArray(2)
binding.nested.getLocationOnScreen(scrollViewLocationCoordinate)
val fundViewLocationCoordinate = IntArray(2)
binding.popularFundsViewCl.getLocationOnScreen(fundViewLocationCoordinate)
if (oldScrollY > scrollY && scrollY < (fundViewLocationCoordinate[1] - scrollViewLocationCoordinate[1])) {
binding.btnInvestNow.visibility = View.VISIBLE
} else if (oldScrollY < scrollY && scrollY > (fundViewLocationCoordinate[1] - scrollViewLocationCoordinate[1])) {
binding.btnInvestNow.visibility = View.GONE
}
})
}
override val screenName: String
get() = AnalyticsConstant.MutualFundActivity
@@ -152,9 +167,9 @@ class MutualFundActivity : BaseActivity<MutualfundActivityBinding, MutualFundVie
private fun closeBottomSheet() {
sheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
binding.btnInvestNow.text = getString(R.string.invest_now)
binding.btnInvestNow.alpha = 0.5f
binding.btnInvestNow.isEnabled = false
//binding.btnInvestNow.text = getString(R.string.invest_now)
//binding.btnInvestNow.alpha = 0.5f
//binding.btnInvestNow.isEnabled = false
showToast("Your request is been submitted")
}
@@ -293,7 +308,9 @@ class MutualFundActivity : BaseActivity<MutualfundActivityBinding, MutualFundVie
when (it.id) {
R.id.btnInvestNow -> {
analyticsEventTracker.onInvestmentNowClick()
if (sharedPreferences.getObject(SharedPreferencesKeys.COMMON_RESPONSE_OBJECT) == null) {
binding.nested.scrollTo(0, binding.btnInvestNow.bottom)
binding.btnInvestNow.visibility = View.GONE
/*if (sharedPreferences.getObject(SharedPreferencesKeys.COMMON_RESPONSE_OBJECT) == null) {
DeepLinkManager.getDeepLinkListener()
?.navigate(
this,
@@ -325,7 +342,7 @@ class MutualFundActivity : BaseActivity<MutualfundActivityBinding, MutualFundVie
navigateTo()
}
}
}
}*/
}
R.id.ivBackArrow -> {
@@ -491,11 +508,11 @@ class MutualFundActivity : BaseActivity<MutualfundActivityBinding, MutualFundVie
it?.let { its ->
if (its.is_nfo == Constant.INACTIVE) {
this.isNfoNotify = true
binding.btnInvestNow.text = getString(R.string.notify_me)
//binding.btnInvestNow.text = getString(R.string.notify_me)
} else {
this.isNfoNotify = false
binding.btnInvestNow.alpha = 0.5f
binding.btnInvestNow.text = getString(R.string.invest_now)
//binding.btnInvestNow.alpha = 0.5f
//binding.btnInvestNow.text = getString(R.string.invest_now)
}
}
})

View File

@@ -1588,9 +1588,9 @@
android:layout_height="@dimen/_48dp"
android:layout_margin="@dimen/_10dp"
android:gravity="center"
android:onClick="@{(v)->mutualfundviewmodel.onClick(v)}"
android:text="@string/invest_now"
android:textAlignment="center"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"