Browse Source

updated UI and Validation

PankajBranch
Hemant Khadase 2 years ago
parent
commit
528cf616ee
8 changed files with 152 additions and 90 deletions
  1. +0
    -2
      app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepFiveBajajFDFragment.kt
  2. +0
    -2
      app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepFourBajajFDFragment.kt
  3. +72
    -13
      app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepOneBajajFDFragment.kt
  4. +0
    -2
      app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepThreeBajajFDFragment.kt
  5. +0
    -2
      app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt
  6. +1
    -1
      app/src/main/java/com/nivesh/production/bajajfd/util/Constants.kt
  7. +68
    -65
      app/src/main/res/layout/fragment_bajajfd_step_one.xml
  8. +11
    -3
      app/src/main/res/values/strings.xml

+ 0
- 2
app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepFiveBajajFDFragment.kt View File

@ -30,9 +30,7 @@ class StepFiveBajajFDFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
stepFourViewModel = ViewModelProvider(this)[StepFiveBajajFDViewModel::class.java].apply {
}
}
override fun onCreateView(


+ 0
- 2
app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepFourBajajFDFragment.kt View File

@ -31,9 +31,7 @@ class StepFourBajajFDFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
stepFourBajajFDViewModel = ViewModelProvider(this)[StepFourBajajFDViewModel::class.java].apply {
}
}
override fun onCreateView(


+ 72
- 13
app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepOneBajajFDFragment.kt View File

@ -2,12 +2,17 @@ package com.nivesh.production.bajajfd.ui.fragment
import GetRatesResponse
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.RadioButton
import androidx.fragment.app.Fragment
import com.google.gson.Gson
import com.nivesh.production.bajajfd.R
import com.nivesh.production.bajajfd.databinding.FragmentBajajfdStepOneBinding
import com.nivesh.production.bajajfd.interfaces.BajajFDInterface
import com.nivesh.production.bajajfd.model.GetRatesRequest
@ -21,6 +26,7 @@ class StepOneBajajFDFragment : Fragment() {
private lateinit var bajajFDInterface: BajajFDInterface
private lateinit var stepOneBajajFDViewModel: StepOneBajajFDViewModel
private lateinit var rgMaturity: RadioButton
companion object {
fun getInstance(fdInterface: BajajFDInterface): StepOneBajajFDFragment {
@ -42,16 +48,59 @@ class StepOneBajajFDFragment : Fragment() {
stepOneBajajFDViewModel = (activity as BajajFdMainActivity).viewModel
// binding.tlDepositAmount
// binding.spInterestPayout
// binding.swSeniorCitizen
// binding.radioGroup
// binding.rbDeductTax
// binding.tvROI
// binding.tvFrequency
// binding.tvMaturityAmount
getRatesApi()
// Amount
binding.edtAmount.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
// Frequency
val adapter = ArrayAdapter(
activity as BajajFdMainActivity,
android.R.layout.simple_spinner_item,
resources.getStringArray(
R.array.interestPayoutList
)
)
binding.tvInterestPayout.setAdapter(adapter)
binding.tvInterestPayout.setOnItemClickListener { parent, view, position, id ->
}
// Tenure
binding.tvTenure.setAdapter(adapter)
binding.tvTenure.setOnItemClickListener { parent, view, position, id ->
// getRatesApi()
}
binding.swSeniorCitizen.setOnCheckedChangeListener { compoundButton, b ->
binding.swSeniorCitizen.isChecked = !b
}
// Maturity Options
binding.radioGroup.setOnCheckedChangeListener { group, checkedId ->
rgMaturity = group.findViewById(checkedId)
Log.e("rgMaturity", "-->"+rgMaturity.text)
}
// TAX Deduct
binding.rbDeductTax.setOnCheckedChangeListener { compoundButton, b ->
binding.rbDeductTax.isChecked = !b
}
binding.tvROI.text = ""
binding.tvFrequency.text = ""
binding.tvMaturityAmount.text = ""
// Next Button
binding.btnNext.setOnClickListener {
if (validation()) {
bajajFDInterface.stepOneApi("stepOneResponse")
@ -60,6 +109,19 @@ class StepOneBajajFDFragment : Fragment() {
return root
}
private fun validation(): Boolean {
if (binding.edtAmount.text?.isEmpty()!!){
return false
}else if (binding.tvInterestPayout.text.isEmpty()){
return false
}else if (binding.tvTenure.text.isEmpty()){
return false
}else{
return true
}
}
private fun getRatesApi() {
val getRatesRequest = GetRatesRequest()
getRatesRequest.fdProvider = ""
@ -92,10 +154,6 @@ class StepOneBajajFDFragment : Fragment() {
}
}
private fun validation(): Boolean {
TODO("Not yet implemented")
}
private fun refreshToken() {
@ -112,4 +170,5 @@ class StepOneBajajFDFragment : Fragment() {
super.onDestroyView()
_binding = null
}
}

+ 0
- 2
app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepThreeBajajFDFragment.kt View File

@ -30,9 +30,7 @@ class StepThreeBajajFDFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
stepThreeBajajFDViewModel = ViewModelProvider(this)[StepThreeBajajFDViewModel::class.java].apply {
}
}
override fun onCreateView(


+ 0
- 2
app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt View File

@ -33,9 +33,7 @@ class StepTwoBajajFDFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
stepTwoBajajFDViewModel = ViewModelProvider(this)[StepTwoBajajFDViewModel::class.java].apply {
}
}
override fun onCreateView(


+ 1
- 1
app/src/main/java/com/nivesh/production/bajajfd/util/Constants.kt View File

@ -15,7 +15,7 @@ import java.util.regex.Pattern
class Constants() {
companion object {
const val BASE_URL ="put your base url here"
const val BASE_URL ="https://www.providential.in/api/"
/**
*Before use this method write following code in model class
app:Application(in activity and model)


+ 68
- 65
app/src/main/res/layout/fragment_bajajfd_step_one.xml View File

@ -65,7 +65,7 @@
style="@style/regularStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ratings: CRISIL AAA/Stable & ICRA AAA/Stable"
android:text="@string/schemeRating"
android:textColor="@color/light_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@ -79,15 +79,16 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_2sdp"
android:hint="Select Investment Amount"
android:hint="@string/investmentAmount"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvFdRating"
app:layout_constraintVertical_bias="0.02">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtAmount"
android:layout_width="match_parent"
android:layout_height="@dimen/margin_45"
android:layout_height="wrap_content"
android:drawableStart="@drawable/svg_rs"
android:inputType="number"
android:maxLength="12" />
@ -108,19 +109,26 @@
app:layout_constraintTop_toBottomOf="@+id/tlDepositAmount"
app:layout_constraintVertical_bias="0.02" />
<Spinner
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/spInterestPayout"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/margin_50"
android:background="@drawable/rounded_corner_with_line"
android:entries="@array/intrest_payout_list"
android:paddingStart="@dimen/margin_10"
android:paddingEnd="0dp"
android:background="@null"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvDepositLabel"
app:layout_constraintVertical_bias="0.02" />
app:layout_constraintTop_toBottomOf="@+id/tvDepositLabel">
<AutoCompleteTextView
android:id="@+id/tvInterestPayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/rounded_corner_with_line"
android:inputType="none"
android:hint="@string/select"
android:labelFor="@+id/spInterestPayout"
android:text="" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/tvInvestmentTenure"
@ -136,24 +144,25 @@
app:layout_constraintTop_toBottomOf="@+id/spInterestPayout"
app:layout_constraintVertical_bias="0.02" />
<TextView
android:id="@+id/tvInterestTenure"
style="@style/regularStyle"
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/spInterestTenure"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="@dimen/margin_45"
android:background="@drawable/rounded_corner_with_line"
android:gravity="center_vertical"
android:hint="@string/tv_select_hint"
android:paddingStart="@dimen/_5sdp"
android:paddingEnd="@dimen/margin_15"
android:text=""
android:textColor="@color/text_default"
android:textColorHint="#757575"
android:textSize="@dimen/text_size_16"
app:drawableRightCompat="@drawable/ic_arrow_down"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvInvestmentTenure" />
app:layout_constraintTop_toBottomOf="@+id/tvInvestmentTenure">
<AutoCompleteTextView
android:id="@+id/tvTenure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/rounded_corner_with_line"
android:inputType="none"
android:hint="@string/select"
android:labelFor="@+id/spInterestTenure"
android:text="" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/tvSwitchLabel"
@ -166,7 +175,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvInterestTenure"
app:layout_constraintTop_toBottomOf="@+id/spInterestTenure"
app:layout_constraintVertical_bias="0.018" />
<androidx.appcompat.widget.SwitchCompat
@ -181,49 +190,46 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/tvSwitchLabel"
app:layout_constraintTop_toBottomOf="@+id/tvInterestTenure"
app:layout_constraintTop_toBottomOf="@+id/spInterestTenure"
app:layout_constraintVertical_bias="0.018" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tvMaturityInstruction"
style="@style/regularStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_bg"
android:padding="@dimen/_2sdp"
android:text="@string/maturity_instructions"
android:textColor="@color/text_color_dark"
android:textSize="@dimen/text_size_12"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayoutThree"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tvMaturityInstruction"
style="@style/regularStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_bg"
android:padding="@dimen/_2sdp"
android:text="@string/maturity_instructions"
android:textColor="@color/text_color_dark"
android:textSize="@dimen/text_size_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.02" />
android:layout_height="match_parent"
android:padding="@dimen/margin_10">
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/_2sdp"
android:paddingEnd="@dimen/_2sdp"
app:layout_constraintTop_toBottomOf="@+id/tvMaturityInstruction">
app:layout_constraintTop_toTopOf="parent">
<RadioButton
android:id="@+id/rbAutoCredit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:buttonTint="@color/black"
android:text="@string/additional_detail_one"
android:textSize="@dimen/text_size_12" />
<RadioButton
android:id="@+id/rbAutoRenew"
android:buttonTint="@color/black"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/additional_detail_two"
@ -233,6 +239,7 @@
android:id="@+id/rbAutoBoth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/black"
android:text="@string/additional_detail_three"
android:textSize="@dimen/text_size_12" />
@ -244,8 +251,7 @@
style="@style/semiBoldStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_10"
android:layout_marginTop="@dimen/margin_15"
android:layout_marginTop="@dimen/margin_10"
android:text="@string/tax_deducted_at_source_tds"
android:textColor="@color/text_color_dark"
app:layout_constraintEnd_toEndOf="parent"
@ -260,9 +266,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/margin_10"
android:padding="@dimen/margin_10"
android:text="Please ensure to upload the Form 15 G / H, when you receive a mail from the
Company for the same"
android:padding="@dimen/_1sdp"
android:text="@string/TDSForm"
android:textColor="@color/text_color_dark"
android:textSize="@dimen/text_size_12"
app:layout_constraintEnd_toEndOf="parent"
@ -275,7 +280,8 @@ Company for the same"
android:id="@+id/rbDeductTax"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_2sdp"
android:checked="true"
android:buttonTint="@color/black"
android:orientation="horizontal"
android:text="@string/deduct_tds"
android:textSize="@dimen/text_size_12"
@ -285,13 +291,10 @@ Company for the same"
<TextView
android:id="@+id/tvSubmitLabel"
style="@style/regularStyle"
android:padding="@dimen/_1sdp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/margin_10"
android:paddingRight="@dimen/margin_10"
android:paddingBottom="@dimen/margin_20"
android:text="In case you are eligible for non deduction of TDS then please submit
15G/H form to Bajaj or Nivesh team"
android:text="@string/nonDeductTDS"
android:textColor="@color/text_color_dark"
android:textSize="@dimen/text_size_12"
app:layout_constraintEnd_toEndOf="parent"
@ -340,7 +343,7 @@ Company for the same"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/margin_10"
android:text="Non- Cumulative ROI:"
android:text="@string/nonCumulativeROI"
android:textColor="@color/text_color_dark"
android:textSize="@dimen/text_size_14" />
@ -350,7 +353,7 @@ Company for the same"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_2"
android:text="7.5 %"
android:text=""
android:textColor="@color/text_color_blue"
android:textSize="@dimen/text_size_14" />
@ -367,7 +370,7 @@ Company for the same"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/margin_10"
android:text="Regular Interest Payment:"
android:text="@string/regularInterestPayment"
android:textColor="@color/text_color_dark"
android:textSize="@dimen/text_size_14" />
@ -377,7 +380,7 @@ Company for the same"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_2"
android:text="Quarterly"
android:text=""
android:textColor="@color/text_color_blue"
android:textSize="@dimen/text_size_14" />
@ -394,7 +397,7 @@ Company for the same"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/margin_10"
android:text="Maturity Amount:"
android:text="@string/maturityAmount"
android:textColor="@color/text_color_dark"
android:textSize="@dimen/text_size_14" />
@ -404,7 +407,7 @@ Company for the same"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_2"
android:text="5XXXXXX"
android:text=""
android:textColor="@color/text_color_blue"
android:textSize="@dimen/text_size_14" />


+ 11
- 3
app/src/main/res/values/strings.xml View File

@ -55,15 +55,23 @@
<string name="guardian_address_optional">Guardian Address <font color='#33000000'>(Optional)</font></string>
<string name="guardian_pinCode_optional">Guardian PinCode <font color='#33000000'>(Optional)</font></string>
<string name="content_description">content description</string>
<string name="select">Select</string>
<string name="schemeRating"><![CDATA[Ratings: CRISIL AAA/Stable & ICRA AAA/Stable]]></string>
<string name="investmentAmount">Select Investment Amount</string>
<string name="TDSForm">Please ensure to upload the Form 15 G / H, when you receive a mail from the Company for the same</string>
<string name="nonDeductTDS">In case you are eligible for non deduction of TDS then please submit 15G/H form to Bajaj or Nivesh team</string>
<string name="nonCumulativeROI">Non- Cumulative ROI:</string>
<string name="regularInterestPayment">Regular Interest Payment:</string>
<string name="maturityAmount">Maturity Amount:</string>
<array name="interestPayoutList">
<string-array name="interestPayoutList">
<item>Interest Payout</item>
<item>On Maturity</item>
<item>Monthly</item>
<item>Quarterly</item>
<item>Half Yearly</item>
<item>Yearly</item>
</array>
</string-array>
<array name="address_type">
<item>Aadhaar Card</item>
@ -90,7 +98,7 @@
<item>Unmarried</item>
</array>
<array name="intrest_payout_list">
<array name="interest_payout_list">
<item>Interest Payout</item>
<item>On Maturity</item>
<item>Monthly</item>


Loading…
Cancel
Save

Powered by TurnKey Linux.