|
|
@ -18,7 +18,7 @@ import android.widget.RadioButton |
|
|
|
import android.widget.TextView |
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
import androidx.fragment.app.Fragment |
|
|
|
import androidx.lifecycle.ViewModelProvider |
|
|
|
import androidx.fragment.app.activityViewModels |
|
|
|
import androidx.recyclerview.widget.GridLayoutManager |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import androidx.recyclerview.widget.RecyclerView |
|
|
@ -72,10 +72,9 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
|
|
|
|
|
private lateinit var rbBank: RadioButton |
|
|
|
private lateinit var rbPaymentMode: RadioButton |
|
|
|
private lateinit var observerViewModel: MyObseravble |
|
|
|
private var amountEntered:String="0" |
|
|
|
|
|
|
|
|
|
|
|
private val observerViewModel: MyObseravble by activityViewModels() |
|
|
|
|
|
|
|
private var cal = Calendar.getInstance() |
|
|
|
|
|
|
@ -101,17 +100,6 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
|
stateObject = DataObject() |
|
|
|
rbPaymentMode = RadioButton(activity as BajajFdMainActivity) |
|
|
|
|
|
|
|
observerViewModel = activity?.run { |
|
|
|
ViewModelProvider(this)[MyObseravble::class.java] |
|
|
|
|
|
|
|
} ?: throw Exception("Invalid Activity") |
|
|
|
|
|
|
|
|
|
|
|
observerViewModel.data.observe(viewLifecycleOwner) { |
|
|
|
amountEntered = observerViewModel.data.value.toString() |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Personal Details |
|
|
|
binding.edtMobileNumber.filters = arrayOf<InputFilter>(LengthFilter(10)) |
|
|
|
binding.edtPANNumber.filters = arrayOf<InputFilter>(LengthFilter(10)) |
|
|
@ -1228,7 +1216,7 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
|
200 -> { |
|
|
|
if (getCodeResponse.Response.GetCodesList.isNotEmpty()) { |
|
|
|
listOfPayMode = getCodeResponse.Response.GetCodesList |
|
|
|
setUpRecyclerViewPaymentMode(listOfPayMode) |
|
|
|
setUpRecyclerViewPaymentMode(listOfPayMode as MutableList<GetCodes>) |
|
|
|
} |
|
|
|
} |
|
|
|
// 650 -> refreshToken() |
|
|
@ -1257,15 +1245,54 @@ class StepTwoBajajFDFragment : Fragment() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private fun setUpRecyclerViewPaymentMode(listOfPayMode: List<GetCodes>) { |
|
|
|
private fun setUpRecyclerViewPaymentMode(listOfPayMode: MutableList<GetCodes>) { |
|
|
|
|
|
|
|
var tempList= mutableListOf<GetCodes>() |
|
|
|
|
|
|
|
observerViewModel.data.observe(viewLifecycleOwner) { |
|
|
|
var amountEntered:String = observerViewModel.data.value.toString() |
|
|
|
|
|
|
|
if( amountEntered.toDouble()>100000.0) |
|
|
|
{ |
|
|
|
|
|
|
|
val myCollection = mutableListOf<GetCodes>() |
|
|
|
val iterator = myCollection.iterator() |
|
|
|
while(iterator.hasNext()){ |
|
|
|
val item = iterator.next() |
|
|
|
if(item.Value == "UPI"){ |
|
|
|
iterator.remove() |
|
|
|
}else |
|
|
|
{ |
|
|
|
tempList=myCollection |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}else{ |
|
|
|
|
|
|
|
tempList=listOfPayMode |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.rvPaymentMode.layoutManager = |
|
|
|
GridLayoutManager(activity as BajajFdMainActivity, 2) |
|
|
|
paymentModeAdapter = PaymentModeAdapter( |
|
|
|
tempList, |
|
|
|
amountEntered |
|
|
|
|
|
|
|
) |
|
|
|
binding.rvPaymentMode.adapter = paymentModeAdapter |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binding.rvPaymentMode.layoutManager = |
|
|
|
GridLayoutManager(activity as BajajFdMainActivity, 2) |
|
|
|
paymentModeAdapter = PaymentModeAdapter( |
|
|
|
listOfPayMode, |
|
|
|
amountEntered |
|
|
|
) |
|
|
|
binding.rvPaymentMode.adapter = paymentModeAdapter |
|
|
|
} |
|
|
|
|
|
|
|
private fun genderApi() { |
|
|
|