Master to develop

This commit is contained in:
shankar-yadav
2021-08-02 10:08:05 +05:30
8 changed files with 29 additions and 18 deletions

View File

@@ -15,7 +15,7 @@ plugins {
id('com.google.firebase.firebase-perf')
}
def VERSION_NAME = "1.7.5"
def VERSION_NAME = "1.8.0"
android {
compileSdkVersion 29
@@ -34,7 +34,7 @@ android {
applicationId "com.naviapp"
minSdkVersion 21
targetSdkVersion 29
versionCode 70
versionCode 71
versionName VERSION_NAME
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -8,12 +8,11 @@ package com.naviapp.network.retrofit
import com.facebook.stetho.okhttp3.StethoInterceptor
import com.naviapp.app.NaviApplication
import com.naviapp.network.ApiConstants
import com.readystatesoftware.chuck.ChuckInterceptor
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
class NaviHttpClient(timeoutInSec: Long = ApiConstants.API_CONNECT_TIMEOUT_VALUE) : BaseHttpClient(timeoutInSec) {
class NaviHttpClient(timeoutInSec: Long) : BaseHttpClient(timeoutInSec) {
val httpClientBuilder: OkHttpClient.Builder
get() {
val okHttpClientBuilder = baseHttpClientBuilder

View File

@@ -13,7 +13,7 @@ import androidx.databinding.DataBindingUtil
import com.naviapp.R
import com.naviapp.databinding.BoxInputGroupLayoutBinding
import com.naviapp.utils.*
import kotlinx.android.synthetic.main.otp_layout.view.*
import kotlinx.android.synthetic.main.otp_box_layout.view.*
class BoxInputGroup(context: Context, attributeSet: AttributeSet? = null) :
LinearLayout(context, attributeSet), TextWatcher, View.OnFocusChangeListener,
@@ -57,8 +57,7 @@ class BoxInputGroup(context: Context, attributeSet: AttributeSet? = null) :
private fun inflateItems(size: Int) {
for (position in 1..size) {
val otpView =
LayoutInflater.from(context).inflate(R.layout.otp_layout, binding.otpLayout, false)
val otpView = LayoutInflater.from(context).inflate(R.layout.otp_box_layout, binding.otpLayout, false)
val layoutParams = otpView.layoutParams as LayoutParams
layoutParams.setMargins(
0,

View File

@@ -92,13 +92,13 @@ class OtpBottomSheet : BaseBottomSheet(), View.OnClickListener {
R.drawable.ic_check_mark_svg
)
binding.verifyOtpBtn.setState(false)
binding.otpLayout.setTextChangeListener {
if (binding.otpLayout.getText().length == otpSize && otpSharedViewModel?.errorVerifyOtp?.value != ApiErrorTagType.MAX_OTP_ATTEMPTS) {
binding.otpBoxLayout.setTextChangeListener {
if (binding.otpBoxLayout.getText().length == otpSize && otpSharedViewModel?.errorVerifyOtp?.value != ApiErrorTagType.MAX_OTP_ATTEMPTS) {
binding.verifyOtpBtn.setState(true)
} else {
binding.verifyOtpBtn.setState(false)
}
if (binding.otpLayout.getText().length == 1 && otpSharedViewModel?.errorVerifyOtp?.value != ApiErrorTagType.MAX_OTP_ATTEMPTS) {
if (binding.otpBoxLayout.getText().length == 1 && otpSharedViewModel?.errorVerifyOtp?.value != ApiErrorTagType.MAX_OTP_ATTEMPTS) {
binding.errorMsgOtpTv.visibility = View.INVISIBLE
}
}
@@ -118,7 +118,7 @@ class OtpBottomSheet : BaseBottomSheet(), View.OnClickListener {
otpReceiver.setListener(object : OtpReceiveListener {
override fun onOtpReceive(otp: String) {
if (otp.length == otpSize) {
binding.otpLayout.setOtp(otp)
binding.otpBoxLayout.setOtp(otp)
verifyOtp(true)
}
}
@@ -143,7 +143,7 @@ class OtpBottomSheet : BaseBottomSheet(), View.OnClickListener {
otpSharedViewModel?.errorVerifyOtp?.observeNonNull(this) {
hideLoader()
timer?.cancel()
binding.otpLayout.clear()
binding.otpBoxLayout.clear()
binding.errorMsgOtpTv.visibility = View.VISIBLE
when (it) {
ApiErrorTagType.OTP_WRONG -> {
@@ -221,7 +221,7 @@ class OtpBottomSheet : BaseBottomSheet(), View.OnClickListener {
NaviAnalytics.OTP_DISBURSEMENT -> {
otpSharedViewModel?.verifyOtp(
OtpRequest(
binding.otpLayout.getText(),
binding.otpBoxLayout.getText(),
otpToken,
otpAutoFill
)
@@ -231,7 +231,7 @@ class OtpBottomSheet : BaseBottomSheet(), View.OnClickListener {
startCountDownTimerForApiTimeout(API_TIMEOUT)
otpSharedViewModel?.verifyOtpForEPFO(
OtpRequest(
binding.otpLayout.getText(),
binding.otpBoxLayout.getText(),
otpToken,
otpAutoFill,
arguments?.getString(KEY_COMPANY_NAME)

View File

@@ -6,6 +6,7 @@
package com.naviapp.network.retrofit
import com.naviapp.network.ApiConstants
import com.naviapp.network.util.createRetrofitClient
import retrofit2.Retrofit
@@ -23,6 +24,6 @@ class RetrofitProvider private constructor() {
companion object {
val instance: RetrofitProvider by lazy { Holder.INSTANCE }
val defaultRetrofitClient: Retrofit =
createRetrofitClient(NaviHttpClient().httpClientBuilder)
createRetrofitClient(NaviHttpClient(ApiConstants.API_CONNECT_TIMEOUT_VALUE).httpClientBuilder)
}
}

View File

@@ -34,7 +34,7 @@
app:layout_constraintTop_toBottomOf="@id/title_tv" />
<com.naviapp.common.customview.BoxInputGroup
android:id="@+id/otp_layout"
android:id="@+id/otp_box_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_dp_24"
@@ -53,7 +53,7 @@
android:textColor="@color/red"
android:visibility="invisible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/otp_layout"
app:layout_constraintTop_toBottomOf="@id/otp_box_layout"
tools:text="Some error" />
<TextView

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<EditText
android:id="@+id/otp_et"
style="@style/BoxInputGroupStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/navi_extra_bold"
android:inputType="number" />
</layout>

View File

@@ -8,7 +8,7 @@ package com.naviapp.network.retrofit
import okhttp3.OkHttpClient
class NaviHttpClient : BaseHttpClient() {
class NaviHttpClient(timeoutInSec: Long) : BaseHttpClient(timeoutInSec) {
val httpClientBuilder: OkHttpClient.Builder
get() {
return baseHttpClientBuilder