Merge pull request #46 from medici/sk-fix-loan-amount-slider

[435] Fix EMI Schedule
This commit is contained in:
Sandhya Koti
2019-11-28 19:09:10 +05:30
committed by GitHub Enterprise
5 changed files with 64 additions and 28 deletions

View File

@@ -1,7 +1,6 @@
package com.navi.medici.androidCustomerApp.adapters
import android.content.Context
import android.graphics.Typeface
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
@@ -32,22 +31,10 @@ class EmiScheduleAdapter(private val context: Context) :
override fun onBindViewHolder(holder: EmiScheduleViewHolder, position: Int) {
val emiSchedule = emiScheduleList[position]
holder.binding.apply {
when {
position == 0 -> {
emiNoTxt.text = "No."
emiAmountTxt.text = "EMI Amount"
emiDueDateTxt.text = "Due Date"
emiNoTxt.typeface = Typeface.DEFAULT_BOLD
emiAmountTxt.typeface = Typeface.DEFAULT_BOLD
emiDueDateTxt.typeface = Typeface.DEFAULT_BOLD
}
else -> {
emiNoTxt.text = position.toString()
emiAmountTxt.text =
emiSchedule.emi?.symbol.toString() + " " + emiSchedule.emi?.amount.toString()
emiDueDateTxt.text = convertDueDate("2019-11-13T12:23:36.087+0000")
}
}
emiNoTxt.text = (position + 1).toString()
emiAmountTxt.text =
emiSchedule.emi?.symbol.toString() + " " + emiSchedule.emi?.amount.toString()
emiDueDateTxt.text = convertDueDate(emiSchedule.dueDate)
}
}

View File

@@ -1,6 +1,7 @@
package com.navi.medici.androidCustomerApp.models
import java.math.BigDecimal
import com.navi.medici.androidCustomerApp.R
import com.navi.medici.androidCustomerApp.app.NaviApplication
data class Money(
val currency: String?,
@@ -8,5 +9,8 @@ data class Money(
val amount: Double
) {
fun getDisplayAmount(): String = "$symbol $amount"
fun getDisplayAmount(): String = "$symbol ${String.format(
NaviApplication.instance.applicationContext.getString(R.string.price_double_no_prec),
amount
)}"
}

View File

@@ -1,9 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/emi_schedule_recycler_view"
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="true" />
android:layout_marginTop="5dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/emi_no_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.2"
android:paddingLeft="10dp"
android:text="@string/number"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/emi_amount_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:paddingLeft="10dp"
android:text="@string/emi_amount"
android:textAlignment="textStart"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/emi_due_date_txt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.8"
android:paddingLeft="10dp"
android:text="@string/due_date"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/emi_schedule_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="true" />
</LinearLayout>
</layout>

View File

@@ -199,8 +199,7 @@
android:layout_height="wrap_content"
android:layout_below="@id/reason_for_loan_txt"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:entries="@array/reason_list" />
android:layout_marginEnd="16dp" />
</RelativeLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>

View File

@@ -79,10 +79,7 @@
<string name="name_label">Please enter exact name listed on your Pan Card</string>
<string name="your_photo">Your Photo</string>
<string name="upload_failed">Upload Failed, Try again</string>
<string-array name="reason_list">
<item>Home Loan</item>
<item>Person loan</item>
</string-array>
<string name="no_internet"> No Internet</string>
<string name="internet_too_slow"> Internet is slow</string>
<string name="cancelled">Cancelled</string>
@@ -127,5 +124,9 @@
<string name="not_categorized">Not Categorized</string>
<string name="capture">Capture</string>
<string name="retake">Retake</string>
<string name="price_double_no_prec">%.0f</string>
<string name="number">No.</string>
<string name="emi_amount">EMI Amount</string>
<string name="all_field_mandatory">All fields are mandatory</string>
</resources>