Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shunchaki
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shohboz Qoraboev
shunchaki
Commits
caf6065a
Commit
caf6065a
authored
Jan 08, 2022
by
shohboz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX]
MUS-401
, Feature, fixed bugs with sms and card
parent
7db31b15
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
337 additions
and
300 deletions
+337
-300
build.gradle
app/build.gradle
+2
-0
MainRepository.kt
...biuz/mobiservice/dev/network/repository/MainRepository.kt
+0
-1
CheckPhoneFragment.kt
...obiuz/mobiservice/dev/ui/auth/check/CheckPhoneFragment.kt
+15
-7
InstallPinFragment.kt
.../mobiuz/mobiservice/dev/ui/auth/pin/InstallPinFragment.kt
+17
-12
VerificationFragment.kt
...iservice/dev/ui/auth/verification/VerificationFragment.kt
+20
-19
CONSTANTS.kt
...ain/java/uz/mobiuz/mobiservice/dev/ui/global/CONSTANTS.kt
+13
-11
HomeFragment.kt
...in/java/uz/mobiuz/mobiservice/dev/ui/home/HomeFragment.kt
+0
-1
CardViewModel.kt
...va/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardViewModel.kt
+9
-0
CardsListFragment.kt
...z/mobiuz/mobiservice/dev/ui/sdk/card/CardsListFragment.kt
+0
-21
PaymentSuccessfulFragment.kt
...rvice/dev/ui/sdk/pay/success/PaymentSuccessfulFragment.kt
+4
-9
ReplenishBalanceFragment.kt
...obiservice/dev/ui/sdk/payment/ReplenishBalanceFragment.kt
+91
-55
StringExtension.kt
...obiuz/mobiservice/dev/utils/extensions/StringExtension.kt
+1
-1
switch_thumb_selector.xml
app/src/main/res/color/switch_thumb_selector.xml
+7
-0
switch_track_selector.xml
app/src/main/res/color/switch_track_selector.xml
+7
-0
fragment_biometric.xml
app/src/main/res/layout/fragment_biometric.xml
+4
-1
fragment_check_phone.xml
app/src/main/res/layout/fragment_check_phone.xml
+14
-34
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+0
-10
fragment_replenish_balance.xml
app/src/main/res/layout/fragment_replenish_balance.xml
+131
-118
themes.xml
app/src/main/res/values/themes.xml
+2
-0
No files found.
app/build.gradle
View file @
caf6065a
...
...
@@ -280,6 +280,8 @@ dependencies {
implementation
'xyz.peridy.shimmer:shimmerlayout:1.1'
implementation
'com.facebook.shimmer:shimmer:0.5.0'
implementation
'com.github.reinaldoarrosi:maskededittext:1.1.0'
}
repositories
{
maven
{
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/network/repository/MainRepository.kt
View file @
caf6065a
...
...
@@ -47,7 +47,6 @@ class MainRepository @Inject constructor(
try
{
withContext
(
Dispatchers
.
IO
)
{
AGRBilling
.
deleteAllCards
()
// todo monitoring ni delete qilish kerak
apiService
.
logOut
()
dao
.
deleteAllMonitoring
()
}
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/auth/check/CheckPhoneFragment.kt
View file @
caf6065a
...
...
@@ -44,6 +44,7 @@ class CheckPhoneFragment : BaseFragment(R.layout.fragment_check_phone) {
setUpUI
()
collects
()
}
override
fun
setUpUI
()
{
...
...
@@ -62,7 +63,6 @@ class CheckPhoneFragment : BaseFragment(R.layout.fragment_check_phone) {
})
inputPhone
.
addTextChangedListener
(
object
:
TextWatcherWrapper
()
{
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{
super
.
beforeTextChanged
(
s
,
start
,
count
,
after
)
oldText
=
s
.
toString
()
...
...
@@ -72,13 +72,21 @@ class CheckPhoneFragment : BaseFragment(R.layout.fragment_check_phone) {
super
.
onTextChanged
(
s
,
start
,
before
,
count
)
try
{
inputPhone
.
removeTextChangedListener
(
this
)
newText
=
s
.
toString
().
filter
{
it
.
isDigit
()
}.
maskedTextMobi
()
inputPhone
.
setText
(
newText
)
inputPhone
.
setSelection
(
oldText
.
checkChangedPosition
(
newText
))
val
text
=
s
.
toString
()
if
(
text
.
length
<
5
){
inputPhone
.
setText
(
"+998 "
)
inputPhone
.
setSelection
(
5
)
}
else
{
newText
=
text
.
filter
{
it
.
isDigit
()
||
it
==
'+'
}.
maskedTextMobi
()
inputPhone
.
setText
(
newText
)
inputPhone
.
setSelection
(
oldText
.
checkChangedPosition
(
newText
))
}
inputPhone
.
addTextChangedListener
(
this
)
btnCheckPhone
.
isEnabled
=
inputPhone
.
text
.
toString
().
trim
().
length
==
12
btnCheckPhone
.
isEnabled
=
inputPhone
.
text
.
toString
().
filter
{
it
.
isDigit
()
||
it
==
'+'
}.
length
==
13
}
catch
(
e
:
Exception
){
inputPhone
.
text
.
clear
()
inputPhone
.
addTextChangedListener
(
this
)
}
}
...
...
@@ -86,8 +94,8 @@ class CheckPhoneFragment : BaseFragment(R.layout.fragment_check_phone) {
btnCheckPhone
.
setOnClickListener
(
object
:
ButtonClick
()
{
override
fun
onSingleClick
(
v
:
View
?)
{
phone
=
"+998"
+
inputPhone
.
text
.
toString
().
trim
().
replace
(
" "
,
""
)
phoneRaw
=
"+998 "
+
inputPhone
.
text
.
toString
().
trim
()
phone
=
inputPhone
.
text
.
toString
().
filter
{
it
.
isDigit
()
||
it
==
'+'
}
phoneRaw
=
inputPhone
.
text
.
toString
().
trim
()
when
{
phone
.
length
<
13
->
{
inputPhone
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
requireContext
(),
R
.
anim
.
shake
))
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/auth/pin/InstallPinFragment.kt
View file @
caf6065a
...
...
@@ -5,6 +5,7 @@ import android.os.Bundle
import
android.view.View
import
android.view.animation.AnimationUtils
import
android.widget.TextView
import
androidx.activity.OnBackPressedCallback
import
androidx.biometric.BiometricManager
import
androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG
import
androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_WEAK
...
...
@@ -65,19 +66,13 @@ class InstallPinFragment : BaseFragment(R.layout.fragment_install_pin) {
bn
.
apply
{
loadData
()
toolbar
.
setNavigationOnClickListener
{
if
(
type
==
CONSTANTS
.
NEW_PIN
){
when
{
navController
.
popBackStack
(
R
.
id
.
registerFragment
,
false
)
->
{
}
navController
.
popBackStack
(
R
.
id
.
loginFragment
,
false
)
->
{
}
else
->
navController
.
navigateUp
()
}
}
else
navController
.
navigateUp
()
handleBackStack
()
}
requireActivity
().
onBackPressedDispatcher
.
addCallback
(
viewLifecycleOwner
,
object
:
OnBackPressedCallback
(
true
)
{
override
fun
handleOnBackPressed
()
{
handleBackStack
()
}
})
rvPin
.
layoutManager
=
LinearLayoutManager
(
requireContext
(),
LinearLayoutManager
.
HORIZONTAL
,
false
)
rvPin
.
setHasFixedSize
(
true
)
...
...
@@ -174,6 +169,16 @@ class InstallPinFragment : BaseFragment(R.layout.fragment_install_pin) {
}
}
private
fun
handleBackStack
()
{
if
(
type
==
CONSTANTS
.
NEW_PIN
){
when
{
navController
.
popBackStack
(
R
.
id
.
registerFragment
,
false
)
->
{}
navController
.
popBackStack
(
R
.
id
.
loginFragment
,
false
)
->
{}
else
->
navController
.
navigateUp
()
}
}
else
navController
.
navigateUp
()
}
private
fun
checkBiometric
()
:
Boolean
{
return
when
(
biometricManager
.
canAuthenticate
(
BIOMETRIC_STRONG
or
BIOMETRIC_WEAK
))
{
BiometricManager
.
BIOMETRIC_SUCCESS
->
true
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/auth/verification/VerificationFragment.kt
View file @
caf6065a
...
...
@@ -3,12 +3,9 @@ package uz.mobiuz.mobiservice.dev.ui.auth.verification
import
android.app.Activity
import
android.content.Intent
import
android.content.IntentFilter
import
android.graphics.Color
import
android.graphics.drawable.ColorDrawable
import
android.os.Bundle
import
android.view.KeyEvent
import
android.view.View
import
android.view.ViewGroup
import
android.view.animation.AnimationUtils
import
androidx.core.os.bundleOf
import
androidx.core.view.isVisible
...
...
@@ -36,7 +33,6 @@ import uz.mobiuz.mobiservice.dev.utils.Utils
import
uz.mobiuz.mobiservice.dev.utils.extensions.*
import
uz.mobiuz.mobiservice.dev.utils.hideKeyboard
import
uz.mobiuz.mobiservice.dev.utils.showKeyboard
import
uz.mobiuz.mobiservice.dev.utils.sms.MessageDialog
import
uz.mobiuz.mobiservice.dev.utils.sms.SmsBroadcastReceiver
import
java.util.regex.Pattern
import
javax.inject.Inject
...
...
@@ -62,7 +58,7 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
private
var
cardNumber
=
""
private
var
cardId
=
""
private
var
cardExpire
=
""
private
var
payCard
n
umber
=
""
private
var
payCard
N
umber
=
""
private
var
monitoring
=
""
var
transactionId
=
0L
...
...
@@ -80,7 +76,7 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
cardId
=
it
.
getString
(
CONSTANTS
.
CARD_ID
)
?:
""
cardNumber
=
it
.
getString
(
CONSTANTS
.
CARD_NUMBER
)
?:
""
cardExpire
=
it
.
getString
(
CONSTANTS
.
CARD_EXPIRE
)
?:
""
payCard
n
umber
=
it
.
getString
(
CONSTANTS
.
PAY_CARD_NUMBER
)
?:
""
payCard
N
umber
=
it
.
getString
(
CONSTANTS
.
PAY_CARD_NUMBER
)
?:
""
transactionId
=
it
.
getLong
(
CONSTANTS
.
TRANSACTION_ID
)
saveCard
=
it
.
getInt
(
CONSTANTS
.
SAVED_CARD
,
0
)
...
...
@@ -146,31 +142,31 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
sentCodeAgain
.
setOnClickListener
{
when
(
type
)
{
CONSTANTS
.
TYPE_ADD_CARD
->
{
viewModel
.
resendSms
(
"998949125150"
,
cardNumber
,
cardExpire
)
viewModel
.
resendSms
(
pref
.
userPhone
.
filter
{
it
.
isDigit
()
}
,
cardNumber
,
cardExpire
)
}
CONSTANTS
.
TYPE_ANOTHER_CARD
->
{
viewModel
.
vendorResendSms
(
transactionId
)
}
else
->
viewModel
.
resetSmsCode
(
UserAuth
(
phone
.
filter
{
it
.
isDigit
()
}))
else
->
viewModel
.
resetSmsCode
(
UserAuth
(
p
ref
.
userP
hone
.
filter
{
it
.
isDigit
()
}))
}
}
coutdownView
.
setOnCountdownEndListener
{
count
(
false
)
}
// setVerificationCode()
}
}
private
fun
setVerificationCode
(
code
:
String
)
{
if
(
code
.
length
==
6
)
{
bn
.
apply
{
pin1
.
setText
(
verificationC
ode
[
0
].
toString
())
pin2
.
setText
(
verificationC
ode
[
1
].
toString
())
pin3
.
setText
(
verificationC
ode
[
2
].
toString
())
pin4
.
setText
(
verificationC
ode
[
3
].
toString
())
pin5
.
setText
(
verificationC
ode
[
4
].
toString
())
pin6
.
setText
(
verificationC
ode
[
5
].
toString
())
pin1
.
setText
(
c
ode
[
0
].
toString
())
pin2
.
setText
(
c
ode
[
1
].
toString
())
pin3
.
setText
(
c
ode
[
2
].
toString
())
pin4
.
setText
(
c
ode
[
3
].
toString
())
pin5
.
setText
(
c
ode
[
4
].
toString
())
pin6
.
setText
(
c
ode
[
5
].
toString
())
pin6
.
requestFocus
()
pin6
.
setSelection
(
1
)
btnVerification
.
isEnabled
=
true
}
}
...
...
@@ -384,7 +380,7 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
R
.
id
.
paymentSuccessfulFragment
,
bundleOf
(
CONSTANTS
.
PAY_SAVE_CARD
to
saveCard
,
CONSTANTS
.
PAY_CARD_NUMBER
to
payCard
n
umber
,
CONSTANTS
.
PAY_CARD_NUMBER
to
payCard
N
umber
,
CONSTANTS
.
PAY_MONITORING
to
monitoring
)
)
...
...
@@ -448,7 +444,7 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
private
fun
getOtpFromMessage
(
message
:
String
)
{
// This will match any 6 digit number in the message
val
matcher
=
Pattern
.
compile
(
"(|^)\\d{6}"
).
matcher
(
message
)
if
(
matcher
.
find
())
{
customLog
(
"verification code:${matcher.group(0)} "
)
//
customLog("verification code:${matcher.group(0)} ")
setVerificationCode
(
matcher
.
group
(
0
))
}
}
...
...
@@ -479,17 +475,22 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
smsBroadcastReceiver
?.
smsBroadcastReceiverListener
=
object
:
SmsBroadcastReceiver
.
SmsBroadcastReceiverListener
{
override
fun
onSuccess
(
intent
:
Intent
?)
{
pref
.
isShowPin
=
false
startActivityForResult
(
intent
,
200
)
}
override
fun
onFailure
()
{}
}
val
intentFilter
=
IntentFilter
(
SmsRetriever
.
SMS_RETRIEVED_ACTION
)
context
?.
registerReceiver
(
smsBroadcastReceiver
,
intentFilter
)
requireActivity
().
registerReceiver
(
smsBroadcastReceiver
,
intentFilter
)
}
override
fun
onDestroyView
()
{
requireActivity
().
unregisterReceiver
(
smsBroadcastReceiver
)
super
.
onDestroyView
()
}
override
fun
onDestroy
()
{
context
?.
unregisterReceiver
(
smsBroadcastReceiver
)
_bn
=
null
super
.
onDestroy
()
}
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/global/CONSTANTS.kt
View file @
caf6065a
package
uz.mobiuz.mobiservice.dev.ui.global
import
android.annotation.SuppressLint
import
uz.mobiuz.mobiservice.dev.BuildConfig
import
java.text.SimpleDateFormat
object
CONSTANTS
{
...
...
@@ -13,8 +14,9 @@ object CONSTANTS {
const
val
CARD_NUMBER
=
"CARD_NUMBER"
const
val
CARD_EXPIRE
=
"CARD_EXPIRE"
const
val
UNAUTHORIZED
=
"UNAUTHORIZED"
const
val
BASE_URL
=
"http://10.160.41.12:82/"
// const val BASE_URL = "https://mobileapp.mobi.uz/"
val
BASE_URL
by
lazy
{
if
(
BuildConfig
.
DEBUG
)
BASE_URL_PROD
else
BASE_URL_PROD
}
private
const
val
BASE_URL_TEST
=
"https://testapp.mobi.uz:8443/"
private
const
val
BASE_URL_PROD
=
"https://mobileapp.mobi.uz/"
//languages
const
val
RU
=
"ru"
...
...
@@ -30,17 +32,17 @@ object CONSTANTS {
const
val
TERMS_OF_USE
=
"Terms of Use"
const
val
PRIVACY_POLICY
=
"Privacy Policy"
const
val
LICENSE_UZ
=
"${BASE_URL}uploads/licenses/license_uz.html"
const
val
LICENSE_RU
=
"${BASE_URL}uploads/licenses/license_ru.html"
const
val
LICENSE_EN
=
"${BASE_URL}uploads/licenses/license_en.html"
val
LICENSE_UZ
=
"${BASE_URL}uploads/licenses/license_uz.html"
val
LICENSE_RU
=
"${BASE_URL}uploads/licenses/license_ru.html"
val
LICENSE_EN
=
"${BASE_URL}uploads/licenses/license_en.html"
const
val
PRIVACY_POLICY_UZ
=
"${BASE_URL}uploads/privacy/privacy_policy_uz.html"
const
val
PRIVACY_POLICY_RU
=
"${BASE_URL}uploads/privacy/privacy_policy_ru.html"
const
val
PRIVACY_POLICY_EN
=
"${BASE_URL}uploads/privacy/privacy_policy_en.html"
val
PRIVACY_POLICY_UZ
=
"${BASE_URL}uploads/privacy/privacy_policy_uz.html"
val
PRIVACY_POLICY_RU
=
"${BASE_URL}uploads/privacy/privacy_policy_ru.html"
val
PRIVACY_POLICY_EN
=
"${BASE_URL}uploads/privacy/privacy_policy_en.html"
const
val
PAYSYS_LICENSE_UZ
=
"${BASE_URL}uploads/paysys/license_uz.html"
const
val
PAYSYS_LICENSE_RU
=
"${BASE_URL}uploads/paysys/license_ru.html"
const
val
PAYSYS_LICENSE_EN
=
"${BASE_URL}uploads/paysys/license_en.html"
val
PAYSYS_LICENSE_UZ
=
"${BASE_URL}uploads/paysys/license_uz.html"
val
PAYSYS_LICENSE_RU
=
"${BASE_URL}uploads/paysys/license_ru.html"
val
PAYSYS_LICENSE_EN
=
"${BASE_URL}uploads/paysys/license_en.html"
const
val
PHONE1
=
"0890"
const
val
PHONE2
=
"+998 97 130 09 09"
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/home/HomeFragment.kt
View file @
caf6065a
...
...
@@ -219,7 +219,6 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) {
private
fun
loadData
()
{
try
{
sliderAdapter
.
submitList
(
customer
?.
events
?:
emptyList
())
bn
.
imagePlaceHolder
.
isVisible
=
customer
?.
events
?.
isEmpty
()
?:
false
customer
?.
customer
?.
info
?.
let
{
bn
.
apply
{
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardViewModel.kt
View file @
caf6065a
...
...
@@ -4,7 +4,9 @@ import androidx.lifecycle.ViewModel
import
androidx.lifecycle.viewModelScope
import
dagger.hilt.android.lifecycle.HiltViewModel
import
kotlinx.coroutines.flow.MutableSharedFlow
import
kotlinx.coroutines.flow.MutableStateFlow
import
kotlinx.coroutines.flow.SharedFlow
import
kotlinx.coroutines.flow.StateFlow
import
kotlinx.coroutines.launch
import
uz.agr.sdk.core.entity.card.CardInfo
import
uz.agr.sdk.core.entity.card.CardRegistration
...
...
@@ -115,5 +117,12 @@ class CardViewModel @Inject constructor(
})
}
private
val
_onClickedCardUiState
=
MutableStateFlow
<
UiStateObject
<
Long
>>(
UiStateObject
.
EMPTY
)
val
onClickedCardUiState
:
StateFlow
<
UiStateObject
<
Long
>>
=
_onClickedCardUiState
fun
onCLickAddCard
(
time
:
Long
){
_onClickedCardUiState
.
value
=
UiStateObject
.
SUCCESS
(
time
)
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardsListFragment.kt
View file @
caf6065a
...
...
@@ -96,27 +96,6 @@ class CardsListFragment : BaseFragment(R.layout.fragment_cards_list) {
)
)
// swipeToRefresh.setColorSchemeResources(
// R.color.agr_black,
// R.color.primary100
// )
// swipeToRefresh.setOnRefreshListener {
// MobiUz.refreshCardsInfo(object : BaseListener<List<CardInfo>> {
// override fun error(message: String) {
// swipeToRefresh.isRefreshing = false
// showToastMessage(message)
// }
//
// override fun loading(boolean: Boolean) {
// swipeToRefresh.isRefreshing = boolean
// }
//
// override fun success(data: List<CardInfo>) {
// swipeToRefresh.isRefreshing = false
// setData(data)
// }
// })
// }
}
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/pay/success/PaymentSuccessfulFragment.kt
View file @
caf6065a
...
...
@@ -36,7 +36,7 @@ class PaymentSuccessfulFragment : BaseFragment(R.layout.fragment_payment_success
private
val
bn
get
()
=
_bn
?:
throw
NullPointerException
(
"cannot inflate"
)
private
var
saveCard
:
Int
=
0
private
var
cardNumber
=
""
private
var
cardNumber
:
String
=
""
private
lateinit
var
monitoring
:
Monitoring
private
val
viewModel
:
HistoryViewModel
by
viewModels
()
...
...
@@ -47,7 +47,7 @@ class PaymentSuccessfulFragment : BaseFragment(R.layout.fragment_payment_success
super
.
onCreate
(
savedInstanceState
)
arguments
?.
let
{
saveCard
=
it
.
getInt
(
CONSTANTS
.
PAY_SAVE_CARD
,
0
)
saveCard
=
it
.
getInt
(
CONSTANTS
.
PAY_SAVE_CARD
,
0
)
?:
0
cardNumber
=
it
.
getString
(
CONSTANTS
.
PAY_CARD_NUMBER
,
""
)
?:
""
val
arg
=
it
.
getString
(
CONSTANTS
.
PAY_MONITORING
,
""
)
?:
""
if
(
arg
.
isNotEmpty
())
...
...
@@ -119,14 +119,9 @@ class PaymentSuccessfulFragment : BaseFragment(R.layout.fragment_payment_success
}
if
(
card
!=
null
)
{
AGRBilling
.
deleteCard
(
card
,
object
:
BaseListener
<
Boolean
>
{
override
fun
error
(
message
:
String
)
{
message
}
override
fun
error
(
message
:
String
)
{}
override
fun
loading
(
boolean
:
Boolean
)
{}
override
fun
success
(
data
:
Boolean
)
{
data
}
override
fun
success
(
data
:
Boolean
)
{}
})
}
}
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/payment/ReplenishBalanceFragment.kt
View file @
caf6065a
...
...
@@ -9,34 +9,37 @@ import android.view.View
import
androidx.core.os.bundleOf
import
androidx.core.view.isVisible
import
androidx.fragment.app.viewModels
import
androidx.lifecycle.lifecycleScope
import
androidx.navigation.NavController
import
androidx.navigation.fragment.NavHostFragment
import
com.google.gson.Gson
import
dagger.hilt.android.AndroidEntryPoint
import
kotlinx.android.synthetic.main.fragment_replenish_balance.*
import
timber.log.Timber
import
kotlinx.coroutines.flow.collect
import
uz.agr.sdk.core.entity.card.CardInfo
import
uz.agr.sdk.core.entity.tuple.Tuple3
import
uz.agr.sdk.coreui.extension.hideSoftInput
import
uz.agr.sdk.coreui.extension.showSnackMessage
import
uz.agr.sdk.coreui.ui.TextWatcherWrapper
import
uz.agr.sdk.coreui.ui.form.AmountFormat
import
uz.agr.sdk.coreui.ui.form.CardDateExpireFormat
import
uz.agr.sdk.coreui.ui.form.CardNumberFormat
import
uz.agr.sdk.mobi_uz.AGRBilling
import
uz.agr.sdk.mobi_uz.BaseListener
import
uz.agr.sdk.mobi_uz.CardListener
import
uz.agr.sdk.mobi_uz.AGRBilling
import
uz.agr.sdk.mobi_uz.VendorPayConfirm
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.databinding.FragmentReplenishBalanceBinding
import
uz.mobiuz.mobiservice.dev.model.Monitoring
import
uz.mobiuz.mobiservice.dev.model.SharedPref
import
uz.mobiuz.mobiservice.dev.network.model.UiStateObject
import
uz.mobiuz.mobiservice.dev.ui.base.BaseFragment
import
uz.mobiuz.mobiservice.dev.ui.global.ButtonClick
import
uz.mobiuz.mobiservice.dev.ui.global.CONSTANTS
import
uz.mobiuz.mobiservice.dev.ui.sdk.card.CardViewModel
import
uz.mobiuz.mobiservice.dev.ui.sdk.pay.SelectAnotherCard
import
uz.mobiuz.mobiservice.dev.utils.extensions.getColorCompat
import
uz.mobiuz.mobiservice.dev.utils.extensions.checkChangedPosition
import
uz.mobiuz.mobiservice.dev.utils.extensions.customLog
import
uz.mobiuz.mobiservice.dev.utils.extensions.maskedTextMobi
import
java.util.*
import
javax.inject.Inject
import
kotlin.collections.HashMap
...
...
@@ -63,6 +66,9 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
private
var
cardNumberValid
:
String
=
""
private
var
cardExpiryValid
:
String
=
""
private
var
phoneNumber
=
""
var
oldText
=
""
var
newText
=
""
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
_bn
=
FragmentReplenishBalanceBinding
.
bind
(
view
)
...
...
@@ -118,14 +124,36 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
override
fun
collects
()
{
viewLifecycleOwner
.
lifecycleScope
.
launchWhenCreated
{
viewModel
.
onClickedCardUiState
.
collect
{
when
(
it
)
{
is
UiStateObject
.
SUCCESS
->
{
bn
.
apply
{
selectedCard
=
null
payWithAnotherCard
=
true
selectCardView
.
showNewCard
()
selectCardView
.
isVisible
=
payWithAnotherCard
addCardForm
.
isVisible
=
payWithAnotherCard
customLog
(
"addCard.isVisible = !payWithAnotherCard ${!payWithAnotherCard}"
)
addCard
.
isVisible
=
!
payWithAnotherCard
checkValidForm
()
customLog
(
"onClickedCardUiState"
)
}
}
else
->
Unit
}
}
}
}
private
fun
setCardListAdapter
(
list
:
List
<
CardInfo
>)
{
bn
.
apply
{
initSelectCardView
(
list
)
addCard
.
isVisible
=
list
.
isEmpty
()
selectCardView
.
isVisible
=
list
.
isNotEmpty
()
customLog
(
"addCard.isVisible = list.isEmpty() ${list.isEmpty()}"
)
if
(!
payWithAnotherCard
)
{
addCard
.
isVisible
=
list
.
isEmpty
()
selectCardView
.
isVisible
=
list
.
isNotEmpty
()
}
if
(
list
.
isNotEmpty
())
{
selectCardView
.
showCard
(
list
[
0
],
0
)
}
...
...
@@ -171,15 +199,9 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
}
private
fun
getAllCards
()
{
Timber
.
d
(
"getAllCards"
)
AGRBilling
.
getAllCards
(
object
:
CardListener
<
CardInfo
>
{
override
fun
error
(
message
:
String
)
{
}
override
fun
loading
(
boolean
:
Boolean
)
{
// showProgressDialog(boolean)
}
override
fun
error
(
message
:
String
)
{}
override
fun
loading
(
boolean
:
Boolean
)
{}
override
fun
local
(
localData
:
List
<
CardInfo
>)
{
setCardListAdapter
(
localData
)
if
(
localData
.
isNotEmpty
())
{
...
...
@@ -225,7 +247,6 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
private
fun
pay
()
{
bn
.
apply
{
val
phoneNumber
=
"998${etPhone.unmaskedText}"
val
amount
=
amountValid
?:
0
if
(!
isMobiUz
(
phoneNumber
.
substring
(
3
,
5
)))
{
showSnackMessage
(
getString
(
R
.
string
.
agr_mobi_uz_payment_phone_error
))
...
...
@@ -263,9 +284,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
override
fun
success
(
data
:
Boolean
)
{
if
(
payWithAnotherCard
)
payWithAnotherCard
(
cardNumberValid
,
cardExpiryValid
,
btnSwitch
.
isChecked
,
pref
.
userPhone
.
filter
{
it
.
isDigit
()
},
vendorFormParams
)
cardNumberValid
,
cardExpiryValid
,
btnSwitch
.
isChecked
,
phoneNumber
,
vendorFormParams
)
else
vendorPay
(
selectedCard
,
pref
.
userPhone
.
filter
{
it
.
isDigit
()
},
vendorFormParams
)
}
})
...
...
@@ -280,7 +299,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
val
monitoring
=
Monitoring
(
date
=
System
.
currentTimeMillis
(),
phone
=
"998${bn.etPhone.unmaskedText}"
,
phone
=
this
@ReplenishBalanceFragment
.
phoneNumber
,
amount
=
bn
.
etAmount
.
text
.
toString
().
filter
{
it
.
isDigit
()
}.
toLong
(),
pan
=
selectedCard
.
pan
)
...
...
@@ -307,7 +326,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
override
fun
showSuccessfulPayment
(
transactionId
:
Long
)
{
val
monitoring
=
Monitoring
(
date
=
System
.
currentTimeMillis
(),
phone
=
"998${etPhone.unmaskedText}"
,
phone
=
this
@ReplenishBalanceFragment
.
phoneNumber
,
amount
=
etAmount
.
text
.
toString
().
filter
{
it
.
isDigit
()
}.
toLong
(),
pan
=
selectedCard
.
pan
)
...
...
@@ -329,28 +348,30 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
var
isSave
=
false
val
responsePhone
=
phoneNumber
.
replace
(
"+"
,
""
)
val
inputPhone
=
phone
.
replace
(
"+"
,
""
)
if
(
responsePhone
.
substring
(
0
,
5
)
==
inputPhone
.
substring
(
0
,
5
)
&&
responsePhone
.
substring
(
responsePhone
.
length
-
2
,
responsePhone
.
length
)
==
inputPhone
.
substring
(
inputPhone
.
length
-
2
,
inputPhone
.
length
)
)
isSave
=
true
else
{
// deleteCard(cardNumber, cardExpiry)
}
isSave
=
responsePhone
.
substring
(
0
,
5
)
==
inputPhone
.
substring
(
0
,
5
)
&&
responsePhone
.
substring
(
responsePhone
.
length
-
2
,
responsePhone
.
length
)
==
inputPhone
.
substring
(
inputPhone
.
length
-
2
,
inputPhone
.
length
)
val
monitoring
=
Monitoring
(
date
=
System
.
currentTimeMillis
(),
phone
=
"998${bn.etPhone.unmaskedText}"
,
phone
=
this
@ReplenishBalanceFragment
.
phoneNumber
,
amount
=
etAmount
.
text
.
toString
().
filter
{
it
.
isDigit
()
}.
toLong
(),
pan
=
cardNumber
)
val
isSaveCard
=
0
if
(
saveCard
){
if
(
isSave
)
CONSTANTS
.
IS_SAVED_CARD
else
CONSTANTS
.
IS_NOT_SAVED_CARD
}
navController
.
navigate
(
R
.
id
.
verificationFragment
,
bundleOf
(
CONSTANTS
.
TYPE_VERIFICATION
to
CONSTANTS
.
TYPE_ANOTHER_CARD
,
CONSTANTS
.
TRANSACTION_ID
to
transactionId
,
CONSTANTS
.
PHONE
to
monitoring
.
phone
,
CONSTANTS
.
PHONE
to
phoneNumber
,
CONSTANTS
.
PAY_AMOUNT
to
monitoring
.
amount
,
CONSTANTS
.
SAVED_CARD
to
i
f
(
isSave
)
CONSTANTS
.
IS_SAVED_CARD
else
CONSTANTS
.
IS_NOT_SAVED_CARD
,
CONSTANTS
.
SAVED_CARD
to
i
sSaveCard
,
CONSTANTS
.
PAY_CARD_NUMBER
to
if
(
isSave
)
cardNumber
else
cardNumber
+
cardExpiry
,
CONSTANTS
.
PAY_MONITORING
to
Gson
().
toJson
(
monitoring
)
)
...
...
@@ -368,7 +389,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
override
fun
showSuccessfulPayment
(
transactionId
:
Long
)
{
val
monitoring
=
Monitoring
(
date
=
System
.
currentTimeMillis
(),
phone
=
"998${etPhone.unmaskedText}"
,
phone
=
this
@ReplenishBalanceFragment
.
phoneNumber
,
amount
=
etAmount
.
text
.
toString
().
filter
{
it
.
isDigit
()
}.
toLong
(),
pan
=
cardNumber
)
...
...
@@ -377,7 +398,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
R
.
id
.
paymentSuccessfulFragment
,
bundleOf
(
CONSTANTS
.
PAY_MONITORING
to
Gson
().
toJson
(
monitoring
),
CONSTANTS
.
PAY_SAVE_CARD
to
saveCard
,
CONSTANTS
.
PAY_SAVE_CARD
to
if
(
saveCard
)
CONSTANTS
.
IS_SAVED_CARD
else
CONSTANTS
.
IS_NOT_SAVED_CARD
,
CONSTANTS
.
PAY_CARD_NUMBER
to
cardNumber
)
)
...
...
@@ -390,16 +411,8 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
val
dialog
=
SelectAnotherCard
()
dialog
.
setListener
(
object
:
SelectAnotherCard
.
Listener
{
override
fun
onClickAnotherCard
()
{
bn
.
apply
{
selectedCard
=
null
payWithAnotherCard
=
true
selectCardView
.
showNewCard
()
selectCardView
.
isVisible
=
true
addCardForm
.
isVisible
=
payWithAnotherCard
addCard
.
isVisible
=
false
checkValidForm
()
}
dialog
.
dismiss
()
viewModel
.
onCLickAddCard
(
System
.
currentTimeMillis
())
}
override
fun
onClickAddCard
()
{
...
...
@@ -411,10 +424,39 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
private
fun
initPhone
()
{
bn
.
apply
{
etPhone
.
addTextChangedListener
(
object
:
TextWatcherWrapper
()
{
inputPhone
.
addTextChangedListener
(
object
:
uz
.
mobiuz
.
mobiservice
.
dev
.
ui
.
global
.
TextWatcherWrapper
()
{
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{
super
.
beforeTextChanged
(
s
,
start
,
count
,
after
)
oldText
=
s
.
toString
()
}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
super
.
onTextChanged
(
s
,
start
,
before
,
count
)
try
{
inputPhone
.
removeTextChangedListener
(
this
)
val
text
=
s
.
toString
()
if
(
text
.
length
<
5
)
{
inputPhone
.
setText
(
"+998 "
)
inputPhone
.
setSelection
(
5
)
}
else
{
newText
=
text
.
filter
{
it
.
isDigit
()
||
it
==
'+'
}.
maskedTextMobi
()
inputPhone
.
setText
(
newText
)
inputPhone
.
setSelection
(
oldText
.
checkChangedPosition
(
newText
))
}
inputPhone
.
addTextChangedListener
(
this
)
phoneNumber
=
inputPhone
.
text
.
toString
().
filter
{
it
.
isDigit
()
}
}
catch
(
e
:
Exception
)
{
inputPhone
.
text
.
clear
()
inputPhone
.
addTextChangedListener
(
this
)
}
}
override
fun
afterTextChanged
(
s
:
Editable
)
{
val
isAllFormsValid
=
if
(
amountValid
!=
null
&&
amountValid
!!
>=
CONSTANTS
.
PAY_MIN_AMOUNT
&&
amountValid
!!
<=
CONSTANTS
.
PAY_MAX_AMOUNT
)
amountIsValid
&&
s
.
toString
().
filter
{
it
.
isDigit
()
}
.
length
==
12
amountIsValid
&&
phoneNumber
.
length
==
12
else
false
val
cardValid
=
if
(
payWithAnotherCard
)
cardNumberIsValid
&&
cardExpiryIsValid
else
selectedCard
!=
null
...
...
@@ -444,16 +486,13 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
if
(
valid
)
{
etCardExpiry
.
requestFocus
()
cardNumberValid
=
number
// etCardNumber.setBackgroundResource(R.drawable.edit_text_unchecked)
// etCardNumber.setTextColor(getColorCompat(R.color.black100))
}
else
{
// etCardNumber.setBackgroundResource(R.drawable.edit_text_error)
// etCardNumber.setTextColor(getColorCompat(R.color.primary100))
}
tvErrorMsg
.
isVisible
=
!
valid
checkValidForm
()
if
(
etCardNumber
.
text
.
toString
().
isEmpty
())
{
tvErrorMsg
.
isVisible
=
false
}
})
}
}
...
...
@@ -480,18 +519,15 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
if
(!
cardNumberIsValid
)
{
etCardNumber
.
requestFocus
()
}
else
activity
?.
hideSoftInput
()
// etCardExpiry.setBackgroundResource(R.drawable.edit_text_unchecked)
// etCardExpiry.setTextColor(getColorCompat(R.color.black100))
}
else
{
// etCardExpiry.setBackgroundResource(R.drawable.edit_text_error)
// etCardExpiry.setTextColor(getColorCompat(R.color.primary100))
}
cardExpiryIsValid
=
checkValid
tvErrorMsgExpiry
.
isVisible
=
!
checkValid
checkValidForm
()
if
(
etCardExpiry
.
text
.
toString
().
isEmpty
())
{
tvErrorMsgExpiry
.
isVisible
=
false
}
})
}
}
...
...
@@ -499,7 +535,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
private
fun
checkValidForm
()
{
bn
.
apply
{
val
isAllFormsValid
=
if
(
amountValid
!=
null
&&
amountValid
!!
>=
CONSTANTS
.
PAY_MIN_AMOUNT
&&
amountValid
!!
<=
CONSTANTS
.
PAY_MAX_AMOUNT
)
amountIsValid
&&
etPhone
.
unmaskedText
.
toString
().
length
==
9
amountIsValid
&&
this
@ReplenishBalanceFragment
.
phoneNumber
.
length
==
12
else
false
val
cardValid
=
if
(
payWithAnotherCard
)
cardNumberIsValid
&&
cardExpiryIsValid
else
selectedCard
!=
null
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/utils/extensions/StringExtension.kt
View file @
caf6065a
...
...
@@ -146,7 +146,7 @@ fun View.getStatusBarHeight(): Int {
fun
String
.
maskedTextMobi
():
String
{
var
newText
=
""
for
(
i
in
this
.
indices
)
{
if
(
i
==
2
||
i
==
5
||
i
==
7
)
{
if
(
i
==
4
||
i
==
6
||
i
==
9
||
i
==
11
)
{
newText
+=
" "
}
newText
+=
this
[
i
]
...
...
app/src/main/res/color/switch_thumb_selector.xml
0 → 100644
View file @
caf6065a
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:color=
"@color/primary100"
android:state_checked=
"true"
/>
<item
android:color=
"@color/grey70"
/>
</selector>
\ No newline at end of file
app/src/main/res/color/switch_track_selector.xml
0 → 100644
View file @
caf6065a
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:color=
"@color/primary70"
android:state_checked=
"true"
/>
<item
android:color=
"@color/grey30"
/>
</selector>
\ No newline at end of file
app/src/main/res/layout/fragment_biometric.xml
View file @
caf6065a
...
...
@@ -3,6 +3,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:background=
"@drawable/gradient"
android:orientation=
"vertical"
tools:context=
".dev.ui.auth.biometric.BiometricFragment"
>
...
...
@@ -78,11 +79,13 @@
android:textColor=
"@color/black100"
android:textSize=
"17sp"
/>
<
Switch
<
androidx.appcompat.widget.SwitchCompat
android:id=
"@+id/btn_switch"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"true"
app:trackTint=
"@color/switch_track_selector"
app:thumbTint=
"@color/switch_thumb_selector"
tools:ignore=
"UseSwitchCompatOrMaterialXml"
/>
</LinearLayout>
...
...
app/src/main/res/layout/fragment_check_phone.xml
View file @
caf6065a
...
...
@@ -38,43 +38,23 @@
android:textColor=
"@color/black75"
/>
<LinearLayout
<EditText
android:layout_width=
"match_parent"
android:background=
"@drawable/edit_text_unchecked"
android:id=
"@+id/input_phone"
android:inputType=
"phone"
android:longClickable=
"false"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"6dp"
android:layout_height=
"wrap_content"
>
<TextView
android:layout_width=
"wrap_content"
android:text=
"+998 "
android:visibility=
"visible"
android:layout_marginStart=
"@dimen/_16sdp"
android:paddingVertical=
"@dimen/_14sdp"
android:textStyle=
"bold"
android:layout_gravity=
"center"
android:textColor=
"@color/black80"
android:textSize=
"17sp"
android:layout_height=
"wrap_content"
/>
<EditText
android:layout_width=
"match_parent"
android:id=
"@+id/input_phone"
android:inputType=
"phone"
app:allowed_chars=
"1234567890"
android:longClickable=
"false"
app:mask=
"+998 ## ### ## ##"
android:maxLength=
"12"
android:paddingVertical=
"@dimen/_14sdp"
android:textStyle=
"bold"
android:layout_gravity=
"center"
android:imeOptions=
"actionDone"
android:textSize=
"17sp"
android:background=
"@drawable/edit_text_unchecked"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
android:paddingHorizontal=
"@dimen/_16sdp"
android:text=
"+998 "
android:maxLength=
"17"
android:paddingVertical=
"@dimen/_14sdp"
android:textStyle=
"bold"
android:layout_gravity=
"center"
android:imeOptions=
"actionDone"
android:textSize=
"17sp"
android:background=
"@drawable/edit_text_unchecked"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
...
...
app/src/main/res/layout/fragment_home.xml
View file @
caf6065a
...
...
@@ -426,16 +426,6 @@
app:riv_corner_radius=
"6dp"
/>
</com.facebook.shimmer.ShimmerFrameLayout>
<com.makeramen.roundedimageview.RoundedImageView
android:id=
"@+id/image_place_holder"
android:layout_width=
"match_parent"
android:layout_height=
"200dp"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"@dimen/_16sdp"
android:src=
"@drawable/image_slider2"
android:visibility=
"gone"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
...
...
app/src/main/res/layout/fragment_replenish_balance.xml
View file @
caf6065a
...
...
@@ -40,22 +40,24 @@
android:textColor=
"@color/black75"
android:textSize=
"15sp"
/>
<com.github.pinball83.maskededittext.MaskedEditText
android:id=
"@+id/etPhone"
<EditText
android:id=
"@+id/input_phone"
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"
4
dp"
android:layout_marginTop=
"
6
dp"
android:background=
"@drawable/edit_text_unchecked"
android:
gravity=
"center|start
"
android:i
meOptions=
"actionNext
"
android:
inputType=
"number|textNoSuggestions
"
android:
paddingHorizontal=
"12dp
"
android:padding
Vertical=
"12
dp"
android:
textColor=
"@color/black100
"
android:text
Size=
"15sp
"
a
pp:mask=
"+998 ** *** ** **
"
a
pp:notMaskedSymbol=
"*
"
/>
android:
imeOptions=
"actionDone
"
android:i
nputType=
"phone
"
android:
longClickable=
"false
"
android:
maxLength=
"17
"
android:padding
Horizontal=
"@dimen/_16s
dp"
android:
paddingVertical=
"@dimen/_14sdp
"
android:text
=
"+998
"
a
ndroid:textSize=
"17sp
"
a
ndroid:textStyle=
"bold
"
/>
<TextView
android:id=
"@+id/txt_hint_amount"
...
...
@@ -159,128 +161,139 @@
tools:visibility=
"visible"
/>
<LinearLayout
android:id=
"@+id/addCardForm"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"16dp"
android:background=
"@drawable/card_background"
android:layout_marginBottom=
"16dp"
android:orientation=
"vertical"
android:padding=
"16dp"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/agr_mobi_uz_card_number"
android:textColor=
"@color/white100"
android:textSize=
"15sp"
/>
android:id=
"@+id/addCardForm"
tools:visibility=
"visible"
android:visibility=
"gone"
>
<EditText
android:id=
"@+id/etCardNumber"
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:background=
"@android:color/transparent"
android:textColorHint=
"@color/grey100"
android:hint=
"0000 0000 0000 0000"
android:imeOptions=
"actionNext"
android:inputType=
"number|textNoSuggestions"
android:longClickable=
"false"
android:maxLength=
"19"
android:paddingVertical=
"12dp"
android:textColor=
"@color/white100"
android:textSize=
"15sp"
tools:ignore=
"Autofill,HardcodedText"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/white100"
/>
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"16dp"
android:background=
"@drawable/card_background"
android:orientation=
"vertical"
android:padding=
"16dp"
>
<TextView
android:id=
"@+id/tvErrorMsg"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:drawablePadding=
"8dp"
android:text=
"@string/agr_mobi_uz_card_format_error"
android:textColor=
"@color/grey100"
android:textSize=
"13sp"
android:textStyle=
"bold"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/agr_mobi_uz_card_number"
android:textColor=
"@color/white100"
android:textSize=
"15sp"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:text=
"@string/agr_mobi_uz_card_expiry"
android:textColor=
"@color/white100"
android:textSize=
"15sp"
/>
<EditText
android:id=
"@+id/etCardNumber"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:background=
"@android:color/transparent"
android:hint=
"0000 0000 0000 0000"
android:imeOptions=
"actionNext"
android:inputType=
"number|textNoSuggestions"
android:longClickable=
"false"
android:maxLength=
"19"
android:paddingVertical=
"12dp"
android:textColor=
"@color/white100"
android:textColorHint=
"@color/grey100"
android:textSize=
"15sp"
tools:ignore=
"Autofill,HardcodedText"
/>
<EditText
android:id=
"@+id/etCardExpiry"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:hint=
"ММ / ГГ"
android:background=
"@android:color/transparent"
android:textColorHint=
"@color/grey100"
android:imeOptions=
"actionDone"
android:textColor=
"@color/white100"
android:importantForAutofill=
"no"
android:inputType=
"number|textNoSuggestions"
android:longClickable=
"false"
android:maxLength=
"5"
android:paddingVertical=
"12dp"
android:textSize=
"15sp"
tools:ignore=
"HardcodedText"
/>
<View
android:layout_width=
"60dp"
android:layout_height=
"1dp"
android:background=
"@color/white100"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:background=
"@color/white100"
/>
<TextView
android:id=
"@+id/tvErrorMsgExpiry"
<TextView
android:id=
"@+id/tvErrorMsg"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:drawablePadding=
"8dp"
android:text=
"@string/agr_mobi_uz_card_format_error"
android:textColor=
"@color/grey100"
android:textSize=
"13sp"
android:textStyle=
"bold"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:text=
"@string/agr_mobi_uz_card_expiry"
android:textColor=
"@color/white100"
android:textSize=
"15sp"
/>
<EditText
android:id=
"@+id/etCardExpiry"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:background=
"@android:color/transparent"
android:hint=
"ММ / ГГ"
android:imeOptions=
"actionDone"
android:importantForAutofill=
"no"
android:inputType=
"number|textNoSuggestions"
android:longClickable=
"false"
android:maxLength=
"5"
android:paddingVertical=
"12dp"
android:textColor=
"@color/white100"
android:textColorHint=
"@color/grey100"
android:textSize=
"15sp"
tools:ignore=
"HardcodedText"
/>
<View
android:layout_width=
"60dp"
android:layout_height=
"1dp"
android:background=
"@color/white100"
/>
<TextView
android:id=
"@+id/tvErrorMsgExpiry"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:drawablePadding=
"8dp"
android:text=
"@string/agr_mobi_uz_card_expire_error"
android:textColor=
"@color/grey100"
android:textSize=
"13sp"
android:textStyle=
"bold"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/checkboxSaveCard"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:drawablePadding=
"8dp"
android:text=
"@string/agr_mobi_uz_card_expire_error"
android:textColor=
"@color/grey100"
android:textSize=
"13sp"
android:textStyle=
"bold"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"16dp"
android:gravity=
"center"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"@string/agr_mobi_uz_save_card"
android:textColor=
"@color/black100"
android:textSize=
"16sp"
/>
<androidx.appcompat.widget.SwitchCompat
android:id=
"@+id/btnSwitch"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"false"
app:thumbTint=
"@color/switch_thumb_selector"
app:trackTint=
"@color/switch_track_selector"
tools:ignore=
"UseSwitchCompatOrMaterialXml"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id=
"@+id/checkboxSaveCard"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"15dp"
android:gravity=
"center"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"@string/agr_mobi_uz_save_card"
android:textColor=
"@color/black100"
android:textSize=
"16sp"
/>
<Switch
android:id=
"@+id/btnSwitch"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:checked=
"false"
tools:ignore=
"UseSwitchCompatOrMaterialXml"
/>
</LinearLayout>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/values/themes.xml
View file @
caf6065a
...
...
@@ -24,6 +24,8 @@
<item
name=
"android:textColor"
>
@color/black
</item>
<item
name=
"buttonStyle"
>
@style/ButtonPrimary
</item>
<item
name=
"bottomSheetDialogTheme"
>
@style/AppModalBottomSheetStyle
</item>
<item
name=
"colorSwitchThumbNormal"
>
@color/primary100
</item>
<!-- Customize your theme here. -->
</style>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment