AA-3 | Mukunda | Loan offer accept screen changes
This commit is contained in:
@@ -41,9 +41,12 @@ dependencies {
|
||||
implementation "com.squareup.retrofit2:converter-gson:$version_retrofit"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$version_kotlin_coroutines"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version_kotlin_coroutines"
|
||||
implementation 'com.google.android.material:material:1.0.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
|
||||
implementation 'com.google.android.material:material:1.0.0'
|
||||
implementation 'com.android.support:cardview-v7:29.0.2'
|
||||
implementation 'com.android.support:design:29.0.2'
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".bottomNavigation.BottomNavigationActivity" />
|
||||
|
||||
<activity android:name=".login.LoginActivity" android:noHistory="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -3,11 +3,14 @@ package com.navi.medici.android_customer_app.bottomNavigation
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.navi.medici.android_customer_app.R
|
||||
import com.navi.medici.android_customer_app.bottomNavigation.loanApplication.OfferAcceptFragment
|
||||
import com.navi.medici.android_customer_app.bottomNavigation.myLoans.MyLoansFragment
|
||||
import com.navi.medici.android_customer_app.databinding.ActivityBottomNavigationBinding
|
||||
|
||||
class BottomNavigationActivity : AppCompatActivity() {
|
||||
class BottomNavigationActivity : FragmentActivity() {
|
||||
|
||||
private lateinit var binding: ActivityBottomNavigationBinding
|
||||
|
||||
@@ -16,24 +19,40 @@ class BottomNavigationActivity : AppCompatActivity() {
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_bottom_navigation)
|
||||
|
||||
binding.bottomNavigationView.setOnNavigationItemSelectedListener {
|
||||
when (it.itemId) {
|
||||
R.id.my_loans -> navigateToMyLoans()
|
||||
else -> false
|
||||
}
|
||||
navigateToPage(it.itemId)
|
||||
}
|
||||
binding.bottomNavigationView.selectedItemId = R.id.my_loans
|
||||
binding.bottomNavigationView.selectedItemId = R.id.home
|
||||
}
|
||||
|
||||
private fun navigateToMyLoans(): Boolean {
|
||||
private fun navigateToPage(itemId: Int): Boolean {
|
||||
val fragmentManager = supportFragmentManager.beginTransaction()
|
||||
supportFragmentManager.findFragmentByTag(MyLoansFragment.TAG)?.let { fragment ->
|
||||
fragmentManager.replace(R.id.content_view, fragment, MyLoansFragment.TAG)
|
||||
var tag = getFragmentTag(itemId)
|
||||
supportFragmentManager.findFragmentByTag(tag)?.let { fragment ->
|
||||
fragmentManager.replace(R.id.content_view, fragment, tag)
|
||||
} ?: run {
|
||||
val fragment = MyLoansFragment()
|
||||
fragmentManager.add(R.id.content_view, fragment, MyLoansFragment.TAG)
|
||||
fragmentManager.replace(R.id.content_view, fragment, MyLoansFragment.TAG)
|
||||
var fragment = getFragment(itemId)
|
||||
fragmentManager.add(R.id.content_view, fragment, tag)
|
||||
fragmentManager.replace(R.id.content_view, fragment, tag)
|
||||
}
|
||||
fragmentManager.commit()
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
private fun getFragment(itemId: Int): Fragment {
|
||||
return when (itemId) {
|
||||
R.id.home -> OfferAcceptFragment()
|
||||
R.id.my_loans -> MyLoansFragment()
|
||||
else -> OfferAcceptFragment()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getFragmentTag(itemId: Int): String {
|
||||
return when (itemId) {
|
||||
R.id.home -> MyLoansFragment.TAG
|
||||
R.id.my_loans -> OfferAcceptFragment.TAG
|
||||
else -> MyLoansFragment.TAG
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.navi.medici.android_customer_app.bottomNavigation.loanApplication
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
|
||||
class EmiScheduleFragment : Fragment() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.navi.medici.android_customer_app.loan_application
|
||||
|
||||
import com.google.gson.FieldNamingPolicy
|
||||
import com.google.gson.GsonBuilder
|
||||
import com.navi.medici.android_customer_app.api.RetrofitService
|
||||
import com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models.OfferResponse
|
||||
import com.navi.medici.android_customer_app.loan_application.models.OfferSelected
|
||||
import com.navi.medici.android_customer_app.loan_application.models.OfferAcceptResponse
|
||||
import retrofit2.Response
|
||||
import retrofit2.converter.gson.GsonConverterFactory
|
||||
import retrofit2.http.*
|
||||
|
||||
private const val BASE_URL = "https://887fc4a4-df18-425d-995b-8731830333d8.mock.pstmn.io"
|
||||
private val gsonConverterFactory = GsonConverterFactory.create(GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create())
|
||||
|
||||
|
||||
interface LoanApplicationApi {
|
||||
@POST("offers/accept")
|
||||
suspend fun acceptOffer(
|
||||
@Body offerData: OfferSelected?
|
||||
): Response<OfferAcceptResponse>
|
||||
|
||||
@GET("offers")
|
||||
suspend fun fetchOffer(
|
||||
@Query("person_id") personId: String?
|
||||
): Response<OfferResponse>
|
||||
|
||||
companion object {
|
||||
operator fun invoke(): LoanApplicationApi {
|
||||
return RetrofitService.build(BASE_URL, gsonConverterFactory)
|
||||
.create(LoanApplicationApi::class.java)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.navi.medici.android_customer_app.loan_application
|
||||
|
||||
import com.navi.medici.android_customer_app.api.SafeApiRequest
|
||||
import com.navi.medici.android_customer_app.loan_application.models.OfferSelected
|
||||
|
||||
class LoanApplicationRepository(private val loanApplicationApi: LoanApplicationApi) : SafeApiRequest() {
|
||||
suspend fun offerAccept(offerAcceptInput: OfferSelected?) = suspend { loanApplicationApi.acceptOffer(offerAcceptInput) }.invoke()
|
||||
suspend fun fetchOffer(personId: String?) = suspend { loanApplicationApi.fetchOffer(personId) }.invoke()
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.navi.medici.android_customer_app.bottomNavigation.loanApplication
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.navi.medici.android_customer_app.R
|
||||
import com.navi.medici.android_customer_app.databinding.LoanDetailsFragmentBinding
|
||||
|
||||
class LoanDetailsFragment : Fragment() {
|
||||
|
||||
private lateinit var binding: LoanDetailsFragmentBinding
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
val activity = activity as FragmentActivity
|
||||
|
||||
val viewModel =
|
||||
ViewModelProviders.of(activity).get(OfferAcceptViewModel::class.java)
|
||||
binding = DataBindingUtil.inflate(
|
||||
inflater,
|
||||
R.layout.loan_details_fragment,
|
||||
container,
|
||||
false
|
||||
)
|
||||
|
||||
viewModel.offerSelected.observe(this, Observer { offer ->
|
||||
binding.totalAmount.setText(offer.amount?.symbol.toString() + ":" + offer.amount?.value.toString())
|
||||
})
|
||||
|
||||
return binding.root
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.navi.medici.android_customer_app.bottomNavigation.loanApplication
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.fragment.app.FragmentPagerAdapter
|
||||
|
||||
class LoanDetailsTabAdapter(fm: FragmentManager) :
|
||||
FragmentPagerAdapter(fm, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
|
||||
|
||||
val NUMBER_OF_TABS = 2
|
||||
override fun getItem(position: Int): Fragment {
|
||||
return when (position) {
|
||||
0 -> {
|
||||
LoanDetailsFragment()
|
||||
}
|
||||
else -> {
|
||||
return EmiScheduleFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getCount(): Int {
|
||||
return NUMBER_OF_TABS
|
||||
}
|
||||
|
||||
override fun getPageTitle(position: Int): CharSequence {
|
||||
return when (position) {
|
||||
0 -> "Loan Details"
|
||||
else -> {
|
||||
return "EMI Schedule"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.navi.medici.android_customer_app.bottomNavigation.loanApplication
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.navi.medici.android_customer_app.R
|
||||
import com.navi.medici.android_customer_app.databinding.OfferAcceptFragmentBinding
|
||||
import com.navi.medici.android_customer_app.loan_application.models.TenureDetails
|
||||
import com.navi.medici.android_customer_app.loan_application.models.OfferSelected
|
||||
import com.navi.medici.android_customer_app.preferences.PreferenceManager
|
||||
import com.navi.medici.android_customer_app.preferences.PreferenceNames
|
||||
|
||||
class OfferAcceptFragment : Fragment() {
|
||||
private lateinit var viewModel: OfferAcceptViewModel
|
||||
private lateinit var binding: OfferAcceptFragmentBinding
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
binding = DataBindingUtil.inflate(
|
||||
inflater,
|
||||
R.layout.offer_accept_fragment,
|
||||
container,
|
||||
false
|
||||
)
|
||||
|
||||
val fragmentAdapter = LoanDetailsTabAdapter(requireFragmentManager())
|
||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.loan_details)))
|
||||
binding.tabLayout.addTab(binding.tabLayout.newTab().setText(getString(R.string.emi_schedule)))
|
||||
binding.tabLayout!!.tabGravity = TabLayout.GRAVITY_FILL
|
||||
|
||||
binding.offerAcceptViewpager.adapter = fragmentAdapter
|
||||
binding.tabLayout.setupWithViewPager(binding.offerAcceptViewpager);
|
||||
|
||||
val activity = activity as FragmentActivity
|
||||
// temp. Remove this once data gets is passed through activity
|
||||
viewModel = ViewModelProviders.of(activity).get(OfferAcceptViewModel::class.java)
|
||||
//fetches the existing offers
|
||||
viewModel.fetchOffers()
|
||||
|
||||
binding.acceptOfferBtn.setOnClickListener {
|
||||
if (binding.checkbox.isChecked) {
|
||||
viewModel.onSubmitOfferAccept()
|
||||
} else {
|
||||
Toast.makeText(
|
||||
activity,
|
||||
getString(R.string.accept_loan_details_and_emi),
|
||||
Toast.LENGTH_SHORT
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
viewModel.customerId.observe(this, Observer { customerId ->
|
||||
if (customerId.isNotEmpty()) {
|
||||
PreferenceManager.INSTANCE.setStringPreference(
|
||||
activity,
|
||||
PreferenceNames.CUSTOMER_ID,
|
||||
customerId
|
||||
)
|
||||
}
|
||||
})
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "OFFER_ACCEPT_FRAGMENT"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.navi.medici.android_customer_app.bottomNavigation.loanApplication
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models.OfferAmount
|
||||
import com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models.OfferResponse
|
||||
import com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models.OfferTenure
|
||||
import com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models.response.Amount
|
||||
import com.navi.medici.android_customer_app.loan_application.LoanApplicationApi
|
||||
import com.navi.medici.android_customer_app.loan_application.LoanApplicationRepository
|
||||
import com.navi.medici.android_customer_app.loan_application.models.OfferSelected
|
||||
import com.navi.medici.android_customer_app.loan_application.models.TenureDetails
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class OfferAcceptViewModel : ViewModel() {
|
||||
private val _customerId = MutableLiveData<String>()
|
||||
val customerId: LiveData<String>
|
||||
get() = _customerId
|
||||
|
||||
var offerSelected = MutableLiveData<OfferSelected>();
|
||||
private val offerAcceptRepository = LoanApplicationRepository(LoanApplicationApi())
|
||||
private val coroutineScope = CoroutineScope(Dispatchers.Main)
|
||||
|
||||
fun onSubmitOfferAccept() {
|
||||
|
||||
coroutineScope.launch {
|
||||
offerSelected.value?.let {
|
||||
// var of1 = OfferSelected("1", Amount("a", "a", 1), TenureDetails(12, "hrs"))
|
||||
val response = offerAcceptRepository.offerAccept(offerSelected.value)
|
||||
_customerId.value = response.customerId
|
||||
Log.i("Offer Accept response", response.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun fetchOffers() {
|
||||
coroutineScope.launch {
|
||||
val response = offerAcceptRepository.fetchOffer("123")
|
||||
// val response = OfferResponse("1", "12", OfferAmount(Amount("a", "A", 100), Amount("a", "A", 200)),
|
||||
// OfferTenure(TenureDetails(12, "Months"),TenureDetails(15, "Months")))
|
||||
selectOffer(response)
|
||||
Log.i("OfferSelected response", response.toString())
|
||||
}
|
||||
}
|
||||
|
||||
fun selectOffer(offerResponse: OfferResponse) {
|
||||
offerSelected.value =
|
||||
OfferSelected(offerResponse.id, offerResponse.amount?.max, offerResponse.tenure?.max)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models.response
|
||||
|
||||
data class Amount(
|
||||
val unit: String?,
|
||||
val symbol: String?,
|
||||
val value: Int
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models
|
||||
|
||||
import com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models.response.Amount
|
||||
|
||||
class OfferAmount(
|
||||
val min: Amount?,
|
||||
val max: Amount?
|
||||
) {
|
||||
}
|
||||
|
||||
fun OfferAmount.getMin(): Amount? {
|
||||
return min
|
||||
}
|
||||
|
||||
fun OfferAmount.getMax(): Amount? {
|
||||
return max
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.navi.medici.android_customer_app.loan_application.models
|
||||
|
||||
import com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models.response.Amount
|
||||
|
||||
data class OfferSelected(
|
||||
var schemeId: String? = "",
|
||||
var amount: Amount?,
|
||||
var duration: TenureDetails?
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models
|
||||
|
||||
import com.navi.medici.android_customer_app.loan_application.models.TenureDetails
|
||||
|
||||
class OfferTenure(
|
||||
val min: TenureDetails?,
|
||||
val max: TenureDetails?
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.navi.medici.android_customer_app.loan_application.models
|
||||
|
||||
data class TenureDetails(
|
||||
val value: Int = 0,
|
||||
val unit: String = ""
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.navi.medici.android_customer_app.loan_application.models
|
||||
|
||||
data class OfferAcceptResponse(
|
||||
val customerId: String? = ""
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.navi.medici.android_customer_app.bottomNavigation.loanApplication.models
|
||||
|
||||
import com.navi.medici.android_customer_app.loan_application.models.TenureDetails
|
||||
|
||||
data class OfferResponse(
|
||||
var id: String? = "",
|
||||
var personId: String? = "",
|
||||
var amount: OfferAmount?,
|
||||
var tenure: OfferTenure?
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.navi.medici.android_customer_app.preferences
|
||||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
|
||||
enum class PreferenceManager() {
|
||||
INSTANCE;
|
||||
|
||||
val PREFS_FILENAME = "com.navi.medici.android_customer_app.preferences"
|
||||
|
||||
fun getStringPreference(context: Context, preference: PreferenceNames): String? {
|
||||
val sharedPref: SharedPreferences =
|
||||
context.getSharedPreferences(PREFS_FILENAME, Context.MODE_PRIVATE)
|
||||
return sharedPref.getString(preference.name, "")
|
||||
}
|
||||
|
||||
fun setStringPreference(context: Context, preference: PreferenceNames, value: String?) {
|
||||
val sharedPref: SharedPreferences =
|
||||
context.getSharedPreferences(PREFS_FILENAME, Context.MODE_PRIVATE)
|
||||
val editor = sharedPref.edit()
|
||||
editor.putString(preference.name, value)
|
||||
editor.apply()
|
||||
}
|
||||
|
||||
|
||||
fun getIntPreference(context: Context, preference: PreferenceNames): Int {
|
||||
val sharedPref: SharedPreferences =
|
||||
context.getSharedPreferences(PREFS_FILENAME, Context.MODE_PRIVATE)
|
||||
return sharedPref.getInt(preference.name, 0)
|
||||
}
|
||||
|
||||
fun setIntPreference(context: Context, preference: PreferenceNames, value: Int) {
|
||||
val sharedPref: SharedPreferences =
|
||||
context.getSharedPreferences(PREFS_FILENAME, Context.MODE_PRIVATE)
|
||||
val editor = sharedPref.edit()
|
||||
editor.putInt(preference.name, value)
|
||||
editor.apply()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.navi.medici.android_customer_app.preferences
|
||||
|
||||
enum class PreferenceNames {
|
||||
SESSION_TOKEN,
|
||||
PERSON_ID,
|
||||
CUSTOMER_ID,
|
||||
APPROVED_AMOUT
|
||||
}
|
||||
17
app/src/main/res/drawable/border_shadow.xml
Normal file
17
app/src/main/res/drawable/border_shadow.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<corners
|
||||
android:radius="5dp" />
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:startColor="#33000000"
|
||||
android:centerColor="#11000000"
|
||||
android:endColor="#11000000"
|
||||
android:centerY="0.2"
|
||||
android:type="linear"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
11
app/src/main/res/drawable/custom_thumb.xml
Normal file
11
app/src/main/res/drawable/custom_thumb.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/colorBtnTextWhite"/>
|
||||
<size
|
||||
android:width="25dp"
|
||||
android:height="25dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
BIN
app/src/main/res/drawable/firework.png
Normal file
BIN
app/src/main/res/drawable/firework.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
16
app/src/main/res/drawable/seekbar_progress.xml
Normal file
16
app/src/main/res/drawable/seekbar_progress.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:id="@+id/progressshape" >
|
||||
<clip>
|
||||
<shape
|
||||
android:shape="rectangle" >
|
||||
<size android:height="2dp"/>
|
||||
<corners
|
||||
android:radius="2dp" />
|
||||
<solid android:color="@color/colorSeekbarBlue"/>
|
||||
</shape>
|
||||
</clip>
|
||||
</item>
|
||||
</layer-list>
|
||||
13
app/src/main/res/drawable/seekbar_style.xml
Normal file
13
app/src/main/res/drawable/seekbar_style.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:id="@android:id/background"
|
||||
android:drawable="@drawable/border_shadow" >
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@android:id/progress" >
|
||||
<clip
|
||||
android:drawable="@drawable/seekbar_progress" />
|
||||
</item>
|
||||
</layer-list>
|
||||
BIN
app/src/main/res/drawable/tick_mark.png
Normal file
BIN
app/src/main/res/drawable/tick_mark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
55
app/src/main/res/layout/loan_details_fragment.xml
Normal file
55
app/src/main/res/layout/loan_details_fragment.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:textAlignment="center"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1.2">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_total_amount_to_be_repaid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Total Amount to be Repaid"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.8">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/total_amount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:text=""
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
187
app/src/main/res/layout/offer_accept_fragment.xml
Normal file
187
app/src/main/res/layout/offer_accept_fragment.xml
Normal file
@@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="10sp"
|
||||
android:gravity="center"
|
||||
tools:context="com.navi.medici.android_customer_app.loan_application.OfferAcceptActivity">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/firework_image1"
|
||||
android:layout_marginTop="70dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tick_mark_image"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginRight="20dp"
|
||||
android:src="@drawable/firework" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tick_mark_image"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_width="182dp"
|
||||
android:layout_height="180dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/tick_mark" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/firework_image2"
|
||||
android:layout_marginTop="70dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tick_mark_image"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@drawable/firework" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/congratulations_label_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Congratulations"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@+id/loan_approved_label_text"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tick_mark_image"
|
||||
app:layout_constraintVertical_bias="0.592" />
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loan_approved_label_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Your loan got approved"
|
||||
app:layout_constraintTop_toBottomOf="@+id/congratulations_label_text"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/loan_details_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_gravity="center"
|
||||
card_view:cardCornerRadius="4dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loan_approved_label_text"
|
||||
android:orientation="horizontal"
|
||||
tools:layout_editor_absoluteX="1dp"
|
||||
android:elevation="10dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relativeLayout1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff">
|
||||
</com.google.android.material.tabs.TabLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/offer_accept_viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_below="@+id/tab_layout"
|
||||
tools:layout_editor_absoluteX="8dp" />
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loan_details_card"
|
||||
app:layout_constraintVertical_bias="0.103">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Invite friends to vouch for you to get discount" />
|
||||
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:background="#494968"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:text="Invite" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/checkbox_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:clickable="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout">
|
||||
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10sp"
|
||||
android:text="I accept that I have seen the loan details and EMI schedule" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/accept_offer_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Accept and Proceed"
|
||||
android:textAllCaps="false"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingRight="30dp"
|
||||
android:textSize="16sp"
|
||||
android:background="@color/colorRed"
|
||||
android:textColor="@color/colorWhite"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/checkbox_layout" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
3
app/src/main/res/values/dimens.xml
Normal file
3
app/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
</resources>
|
||||
@@ -19,4 +19,7 @@
|
||||
<string name="percentage_format">%.1f %%</string>
|
||||
<string name="completion_date">Completion Date</string>
|
||||
<string name="status">Status</string>
|
||||
<string name="accept_loan_details_and_emi">Please accept the loan details and EMI schedule!!</string>
|
||||
<string name="loan_details">Loan Details</string>
|
||||
<string name="emi_schedule">EMI Schedule</string>
|
||||
</resources>
|
||||
|
||||
@@ -48,4 +48,5 @@
|
||||
<item name="android:textColor">@color/colorWhite</item>
|
||||
<item name="android:backgroundTint">@color/colorDeepBlueGray</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -8,10 +8,10 @@ buildscript {
|
||||
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.1'
|
||||
classpath 'com.android.tools.build:gradle:3.5.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
// in the individual module adle files
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user