Browse Source

working on stepone

PankajBranch
Hemant Khadase 2 years ago
parent
commit
8f38a32a8e
6 changed files with 74 additions and 59 deletions
  1. +5
    -2
      app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepOneBajajFDFragment.kt
  2. +23
    -0
      app/src/main/java/com/nivesh/production/bajajfd/util/Constants.kt
  3. +2
    -2
      app/src/main/res/drawable/svg_rs.xml
  4. +40
    -54
      app/src/main/res/layout/fragment_bajajfd_step_one.xml
  5. +1
    -1
      app/src/main/res/values/colors.xml
  6. +3
    -0
      app/src/main/res/values/dimens.xml

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

@ -17,6 +17,7 @@ import com.nivesh.production.bajajfd.databinding.FragmentBajajfdStepOneBinding
import com.nivesh.production.bajajfd.interfaces.BajajFDInterface
import com.nivesh.production.bajajfd.model.GetRatesRequest
import com.nivesh.production.bajajfd.ui.activity.BajajFdMainActivity
import com.nivesh.production.bajajfd.util.Constants.Companion.showDialogValidation
import com.nivesh.production.bajajfd.util.Resource
import com.nivesh.production.bajajfd.viewModel.StepOneBajajFDViewModel
@ -70,7 +71,7 @@ class StepOneBajajFDFragment : Fragment() {
)
binding.tvInterestPayout.setAdapter(adapter)
binding.tvInterestPayout.setOnItemClickListener { parent, view, position, id ->
binding.tvFrequency.text = binding.tvInterestPayout.text
}
// Tenure
@ -97,7 +98,6 @@ class StepOneBajajFDFragment : Fragment() {
binding.tvROI.text = ""
binding.tvFrequency.text = ""
binding.tvMaturityAmount.text = ""
// Next Button
@ -112,10 +112,13 @@ class StepOneBajajFDFragment : Fragment() {
private fun validation(): Boolean {
if (binding.edtAmount.text?.isEmpty()!!){
return false
showDialogValidation(activity, "")
}else if (binding.tvInterestPayout.text.isEmpty()){
return false
showDialogValidation(activity, "")
}else if (binding.tvTenure.text.isEmpty()){
return false
showDialogValidation(activity, "")
}else{
return true
}


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

@ -1,5 +1,7 @@
package com.nivesh.production.bajajfd.util
import android.app.Activity
import android.app.AlertDialog
import android.content.Context
import android.net.ConnectivityManager
import android.net.ConnectivityManager.TYPE_ETHERNET
@ -104,5 +106,26 @@ class Constants() {
return match.matches()
}
fun showDialogValidation(activity: Activity?, message: CharSequence?) {
val builder = AlertDialog.Builder(activity)
builder.setMessage(message)
builder.setPositiveButton("OK") { dialogInterface, i ->
dialogInterface.dismiss()
}
builder.show()
}
fun showDialogWithTwoButtons(activity: Activity?, message: CharSequence?) {
val builder = AlertDialog.Builder(activity)
builder.setMessage(message)
builder.setPositiveButton("OK") { dialogInterface, i ->
dialogInterface.dismiss()
}
builder.setNegativeButton("Cancel") { dialogInterface, i ->
dialogInterface.dismiss()
}
builder.show()
}
}
}

+ 2
- 2
app/src/main/res/drawable/svg_rs.xml View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:width="24dp"
android:height="24dp"
android:viewportWidth="18"
android:viewportHeight="18">


+ 40
- 54
app/src/main/res/layout/fragment_bajajfd_step_one.xml View File

@ -12,9 +12,8 @@
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_5sdp"
android:layout_marginRight="@dimen/_5sdp"
android:fillViewport="true"
android:padding="@dimen/margin_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -50,6 +49,7 @@
android:id="@+id/logo"
android:layout_width="@dimen/margin_150"
android:layout_height="18dp"
android:layout_marginStart="@dimen/margin_5"
android:layout_marginTop="@dimen/_2sdp"
android:contentDescription="@string/content_description"
android:src="@drawable/bajaj_logo"
@ -65,6 +65,7 @@
style="@style/regularStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_5"
android:text="@string/schemeRating"
android:textColor="@color/light_text"
app:layout_constraintEnd_toEndOf="parent"
@ -77,13 +78,12 @@
android:id="@+id/tlDepositAmount"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_2sdp"
android:layout_height="@dimen/margin_53"
android:layout_margin="5dp"
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">
app:layout_constraintTop_toBottomOf="@+id/tvFdRating">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtAmount"
@ -91,33 +91,23 @@
android:layout_height="wrap_content"
android:drawableStart="@drawable/svg_rs"
android:inputType="number"
android:maxLength="12" />
android:maxLength="12"
android:textColorHint="@color/light_text"
android:textSize="@dimen/text_size_14"
tool:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/tvDepositLabel"
style="@style/regularStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_2sdp"
android:text="@string/select_interest_payout"
android:textColor="@color/text_default"
android:textSize="@dimen/text_size_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tlDepositAmount"
app:layout_constraintVertical_bias="0.02" />
<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:background="@null"
android:layout_height="@dimen/margin_53"
android:layout_margin="@dimen/margin_5"
android:hint="@string/select_interest_payout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvDepositLabel">
app:layout_constraintTop_toBottomOf="@+id/tlDepositAmount">
<AutoCompleteTextView
android:id="@+id/tvInterestPayout"
@ -125,33 +115,22 @@
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="" />
android:textColorHint="#757575"
android:textSize="@dimen/text_size_14"
tool:ignore="DuplicateSpeakableTextCheck,LabelFor,TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/tvInvestmentTenure"
style="@style/regularStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_2sdp"
android:text="@string/select_interest_tenure"
android:textColor="@color/text_default"
android:textSize="@dimen/text_size_12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spInterestPayout"
app:layout_constraintVertical_bias="0.02" />
<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="wrap_content"
android:layout_height="@dimen/margin_53"
android:layout_margin="@dimen/margin_5"
android:hint="@string/select_interest_tenure"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvInvestmentTenure">
app:layout_constraintTop_toBottomOf="@+id/spInterestPayout">
<AutoCompleteTextView
android:id="@+id/tvTenure"
@ -159,9 +138,10 @@
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="" />
android:textColorHint="@color/light_text"
android:textSize="@dimen/text_size_14"
tool:ignore="LabelFor,TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
@ -169,10 +149,11 @@
style="@style/regularStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_5"
android:layout_marginTop="@dimen/margin_15"
android:text="@string/upto_0.25"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="@+id/swSeniorCitizen"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/spInterestTenure"
@ -182,7 +163,8 @@
android:id="@+id/swSeniorCitizen"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_3"
android:layout_marginStart="@dimen/margin_5"
android:layout_marginEnd="@dimen/margin_5"
android:text="@string/upto_0.25_next"
android:textColor="@color/black"
android:textSize="@dimen/text_size_12"
@ -201,10 +183,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey_bg"
android:padding="@dimen/_2sdp"
android:paddingTop="@dimen/margin_3"
android:paddingBottom="@dimen/margin_3"
android:paddingStart="@dimen/margin_15"
android:paddingEnd="@dimen/margin_1"
android:text="@string/maturity_instructions"
android:textColor="@color/text_color_dark"
android:textSize="@dimen/text_size_12"/>
android:textSize="@dimen/text_size_12" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayoutThree"
@ -222,16 +207,16 @@
android:id="@+id/rbAutoCredit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:buttonTint="@color/black"
android:checked="true"
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:buttonTint="@color/black"
android:text="@string/additional_detail_two"
android:textSize="@dimen/text_size_12" />
@ -280,8 +265,8 @@
android:id="@+id/rbDeductTax"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:buttonTint="@color/black"
android:checked="true"
android:orientation="horizontal"
android:text="@string/deduct_tds"
android:textSize="@dimen/text_size_12"
@ -291,9 +276,9 @@
<TextView
android:id="@+id/tvSubmitLabel"
style="@style/regularStyle"
android:padding="@dimen/_1sdp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/_1sdp"
android:text="@string/nonDeductTDS"
android:textColor="@color/text_color_dark"
android:textSize="@dimen/text_size_12"
@ -429,7 +414,8 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardViewTwo" />
app:layout_constraintTop_toBottomOf="@+id/cardViewTwo"
tool:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>


+ 1
- 1
app/src/main/res/values/colors.xml View File

@ -1190,7 +1190,7 @@
<color name="step_text_color">#323131</color>
<color name="bg_image">#F0EBEF</color>
<color name="red_title">#E9161E</color>
<color name="light_text">#A2A2A2</color>
<color name="light_text">#757575</color>
<color name="grey_bg">#D9D9D9</color>
<color name="grey_text_bg">#E2DEDE</color>
<color name="text_color_dark">#0B0B0B</color>


+ 3
- 0
app/src/main/res/values/dimens.xml View File

@ -53,7 +53,10 @@
<dimen name="margin_40">40dp</dimen>
<dimen name="margin_44">44dp</dimen>
<dimen name="margin_45">45dp</dimen>
<dimen name="margin_48">48dp</dimen>
<dimen name="margin_50">50dp</dimen>
<dimen name="margin_53">53dp</dimen>
<dimen name="margin_55">55dp</dimen>
<dimen name="margin_60">60dp</dimen>
<dimen name="margin_70">72dp</dimen>


Loading…
Cancel
Save

Powered by TurnKey Linux.