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
d2c1ab1a
Commit
d2c1ab1a
authored
Jan 06, 2022
by
shohboz
Browse files
Options
Browse Files
Download
Plain Diff
[UPD]
MUS-312
, Feature, updated payment
parents
4fbcec0b
e6960d70
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1136 additions
and
44 deletions
+1136
-44
misc.xml
.idea/misc.xml
+1
-0
LanguageActivity.kt
...c/main/java/uz/mobiuz/mobiservice/dev/LanguageActivity.kt
+1
-0
CheckPhoneFragment.kt
...obiuz/mobiservice/dev/ui/auth/check/CheckPhoneFragment.kt
+3
-0
CONSTANTS.kt
...ain/java/uz/mobiuz/mobiservice/dev/ui/global/CONSTANTS.kt
+8
-1
BillingFragment.kt
...java/uz/mobiuz/mobiservice/dev/ui/home/BillingFragment.kt
+4
-6
ReplenishBalanceFragment.kt
...mobiuz/mobiservice/dev/ui/sdk/ReplenishBalanceFragment.kt
+381
-10
AddCardFragment.kt
.../uz/mobiuz/mobiservice/dev/ui/sdk/card/AddCardFragment.kt
+1
-1
SelectAnotherCard.kt
...uz/mobiuz/mobiservice/dev/ui/sdk/pay/SelectAnotherCard.kt
+53
-0
PaymentSuccessfulFragment.kt
...rvice/dev/ui/sdk/pay/success/PaymentSuccessfulFragment.kt
+78
-0
StringExtension.kt
...obiuz/mobiservice/dev/utils/extensions/StringExtension.kt
+21
-5
AmountFormat.kt
...va/uz/mobiuz/mobiservice/dev/utils/format/AmountFormat.kt
+26
-0
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+2
-2
fragment_payment_successful.xml
app/src/main/res/layout/fragment_payment_successful.xml
+175
-0
fragment_replenish_balance.xml
app/src/main/res/layout/fragment_replenish_balance.xml
+298
-7
layout_select_another_card.xml
app/src/main/res/layout/layout_select_another_card.xml
+66
-0
nav_graph_home.xml
app/src/main/res/navigation/nav_graph_home.xml
+18
-12
No files found.
.idea/misc.xml
View file @
d2c1ab1a
...
@@ -100,6 +100,7 @@
...
@@ -100,6 +100,7 @@
<entry
key=
"app/src/main/res/layout/fragment_profile.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_profile.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_progress.xml"
value=
"0.33242753623188404"
/>
<entry
key=
"app/src/main/res/layout/fragment_progress.xml"
value=
"0.33242753623188404"
/>
<entry
key=
"app/src/main/res/layout/fragment_register.xml"
value=
"0.25"
/>
<entry
key=
"app/src/main/res/layout/fragment_register.xml"
value=
"0.25"
/>
<entry
key=
"app/src/main/res/layout/fragment_replenish_balance.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_safety.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_safety.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_security.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_security.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_service.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_service.xml"
value=
"0.25625"
/>
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/LanguageActivity.kt
View file @
d2c1ab1a
...
@@ -45,6 +45,7 @@ class LanguageActivity : AppCompatActivity() {
...
@@ -45,6 +45,7 @@ class LanguageActivity : AppCompatActivity() {
pref
.
language
=
lang
pref
.
language
=
lang
AGRBilling
.
setLanguage
(
this
,
lang
)
AGRBilling
.
setLanguage
(
this
,
lang
)
startActivity
(
Intent
(
this
,
AuthActivity
::
class
.
java
))
startActivity
(
Intent
(
this
,
AuthActivity
::
class
.
java
))
finish
()
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/auth/check/CheckPhoneFragment.kt
View file @
d2c1ab1a
package
uz.mobiuz.mobiservice.dev.ui.auth.check
package
uz.mobiuz.mobiservice.dev.ui.auth.check
import
android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
android.view.View
import
android.view.View
import
android.view.animation.AnimationUtils
import
android.view.animation.AnimationUtils
...
@@ -22,6 +23,7 @@ import uz.mobiuz.mobiservice.dev.utils.extensions.*
...
@@ -22,6 +23,7 @@ import uz.mobiuz.mobiservice.dev.utils.extensions.*
import
uz.mobiuz.mobiservice.dev.utils.hideKeyboard
import
uz.mobiuz.mobiservice.dev.utils.hideKeyboard
import
dagger.hilt.android.AndroidEntryPoint
import
dagger.hilt.android.AndroidEntryPoint
import
kotlinx.coroutines.flow.collect
import
kotlinx.coroutines.flow.collect
import
uz.mobiuz.mobiservice.dev.LanguageActivity
@AndroidEntryPoint
@AndroidEntryPoint
class
CheckPhoneFragment
:
BaseFragment
(
R
.
layout
.
fragment_check_phone
)
{
class
CheckPhoneFragment
:
BaseFragment
(
R
.
layout
.
fragment_check_phone
)
{
...
@@ -50,6 +52,7 @@ class CheckPhoneFragment : BaseFragment(R.layout.fragment_check_phone) {
...
@@ -50,6 +52,7 @@ class CheckPhoneFragment : BaseFragment(R.layout.fragment_check_phone) {
toolbar
.
setNavigationOnClickListener
{
toolbar
.
setNavigationOnClickListener
{
requireActivity
().
onBackPressed
()
requireActivity
().
onBackPressed
()
startActivity
(
Intent
(
requireContext
(),
LanguageActivity
::
class
.
java
))
}
}
viewGroup
.
setOnClickListener
(
object
:
ButtonClick
()
{
viewGroup
.
setOnClickListener
(
object
:
ButtonClick
()
{
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/global/CONSTANTS.kt
View file @
d2c1ab1a
...
@@ -38,7 +38,7 @@ object CONSTANTS {
...
@@ -38,7 +38,7 @@ object CONSTANTS {
const
val
PHONE2
=
"+998 97 130 09 09"
const
val
PHONE2
=
"+998 97 130 09 09"
const
val
PHONE3
=
"+998 97 203 10 10"
const
val
PHONE3
=
"+998 97 203 10 10"
const
val
DEFAULT_PHONE
=
"+998 97 999-99-99"
const
val
DEFAULT_PHONE
=
"+998 97 999-99-99"
const
val
RESEND_CODE_TIME
=
6000L
const
val
RESEND_CODE_TIME
=
6000
0
L
const
val
BLOCKED_TIME
=
6000
const
val
BLOCKED_TIME
=
6000
...
@@ -98,4 +98,11 @@ object CONSTANTS {
...
@@ -98,4 +98,11 @@ object CONSTANTS {
const
val
API_SERVICE_INDEX
=
"service/index"
const
val
API_SERVICE_INDEX
=
"service/index"
const
val
API_MAIN_ROAMING
=
"main/roaming"
const
val
API_MAIN_ROAMING
=
"main/roaming"
//payment
const
val
PAY_MIN_AMOUNT
=
1000
const
val
PAY_MAX_AMOUNT
=
500
_000L
const
val
PAY_AMOUNT
=
"PAYMENT_SUCCESS_PAYMENT"
const
val
PAY_SAVE_CARD
=
"PAYMENT_SAVE_CARD"
const
val
PAY_CARD_NUMBER
=
"PAYMENT_CARD_NUMBER"
}
}
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/home/BillingFragment.kt
View file @
d2c1ab1a
...
@@ -47,22 +47,20 @@ class BillingFragment : BaseFragment(R.layout.fragment_billing) {
...
@@ -47,22 +47,20 @@ class BillingFragment : BaseFragment(R.layout.fragment_billing) {
}
}
})
})
}
}
/*
payments.setOnClickListener {
payments
.
setOnClickListener
{
getPhoneNumber
(
object
:
LoadPhoneNumber
{
getPhoneNumber
(
object
:
LoadPhoneNumber
{
override
fun
invoke
(
phoneNumber
:
String
)
{
override
fun
invoke
(
phoneNumber
:
String
)
{
pref.isShowPin = false
navController
.
navigate
(
R
.
id
.
replenishBalanceFragment
,
bundleOf
(
CONSTANTS
.
PHONE
to
pref
.
userPhone
.
filter
{
it
.
isDigit
()
}))
startActivity(AGRBilling.createReplenishBalanceIntent(requireContext(), phoneNumber))
}
}
})
})
}
}
monitoring
.
setOnClickListener
{
monitoring
.
setOnClickListener
{
getPhoneNumber
(
object
:
LoadPhoneNumber
{
getPhoneNumber
(
object
:
LoadPhoneNumber
{
override
fun
invoke
(
phoneNumber
:
String
)
{
override
fun
invoke
(
phoneNumber
:
String
)
{
pref.isShowPin = false
// navController.navigate(R.id.replenishBalanceFragment, bundleOf(CONSTANTS.PHONE to pref.userPhone.filter { it.isDigit() }))
startActivity(AGRBilling.createHistoryIntent(requireContext(), phoneNumber))
}
}
})
})
}
*/
}
}
}
}
}
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/ReplenishBalanceFragment.kt
View file @
d2c1ab1a
package
uz.mobiuz.mobiservice.dev.ui.sdk
package
uz.mobiuz.mobiservice.dev.ui.sdk
import
android.content.Intent
import
android.net.Uri
import
android.os.Bundle
import
android.os.Bundle
import
android
x.fragment.app.Fragment
import
android
.text.Editable
import
android.
view.LayoutInflat
er
import
android.
text.method.DigitsKeyListen
er
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
androidx.core.os.bundleOf
import
androidx.core.view.isVisible
import
androidx.fragment.app.viewModels
import
androidx.fragment.app.viewModels
import
androidx.lifecycle.lifecycleScope
import
androidx.lifecycle.lifecycleScope
import
androidx.navigation.NavController
import
androidx.navigation.NavController
import
androidx.navigation.fragment.NavHostFragment
import
androidx.navigation.fragment.NavHostFragment
import
dagger.hilt.android.AndroidEntryPoint
import
dagger.hilt.android.AndroidEntryPoint
import
kotlinx.coroutines.flow.collect
import
kotlinx.coroutines.flow.collect
import
timber.log.Timber
import
uz.agr.mobiuz.model.system.LocaleManager
import
uz.agr.mobiuz.ui.fast_action.animation.getColorCompat
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.pgw_core.VendorPayConfirm
import
uz.agr.sdk.pgw_core.mobi.BaseListener
import
uz.agr.sdk.pgw_core.mobi.CardListenerMobi
import
uz.agr.sdk.pgw_core.mobi.MobiUz
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.databinding.FragmentMonitoringLocalBinding
import
uz.mobiuz.mobiservice.dev.databinding.FragmentReplenishBalanceBinding
import
uz.mobiuz.mobiservice.dev.databinding.FragmentReplenishBalanceBinding
import
uz.mobiuz.mobiservice.dev.model.SharedPref
import
uz.mobiuz.mobiservice.dev.model.SharedPref
import
uz.mobiuz.mobiservice.dev.network.model.UiStateObject
import
uz.mobiuz.mobiservice.dev.network.model.UiStateObject
import
uz.mobiuz.mobiservice.dev.ui.base.BaseFragment
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.home.HomeViewModel
import
uz.mobiuz.mobiservice.dev.ui.home.HomeViewModel
import
uz.mobiuz.mobiservice.dev.ui.sdk.pay.SelectAnotherCard
import
java.util.*
import
javax.inject.Inject
import
javax.inject.Inject
import
kotlin.collections.HashMap
@AndroidEntryPoint
@AndroidEntryPoint
class
ReplenishBalanceFragment
:
BaseFragment
(
R
.
layout
.
fragment_replenish_balance
)
{
class
ReplenishBalanceFragment
:
BaseFragment
(
R
.
layout
.
fragment_replenish_balance
)
{
...
@@ -31,6 +53,17 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
...
@@ -31,6 +53,17 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
private
val
viewModel
:
HomeViewModel
by
viewModels
()
private
val
viewModel
:
HomeViewModel
by
viewModels
()
private
val
navController
:
NavController
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
NavHostFragment
.
findNavController
(
this
)
}
private
val
navController
:
NavController
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
NavHostFragment
.
findNavController
(
this
)
}
private
var
payWithAnotherCard
=
false
private
var
selectedCard
:
CardInfo
?
=
null
private
var
amountIsValid
=
false
private
var
amountValid
:
Long
?
=
null
private
var
cardNumberIsValid
=
false
private
var
cardExpiryIsValid
=
false
private
var
cardNumberValid
:
String
=
""
private
var
cardExpiryValid
:
String
=
""
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
_bn
=
FragmentReplenishBalanceBinding
.
bind
(
view
)
_bn
=
FragmentReplenishBalanceBinding
.
bind
(
view
)
...
@@ -42,7 +75,45 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
...
@@ -42,7 +75,45 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
override
fun
setUpUI
()
{
override
fun
setUpUI
()
{
getAllCards
()
initPhone
()
initInputAmount
()
initInputCardNumber
()
initInputCardExpiry
()
bn
.
apply
{
toolbar
.
setNavigationOnClickListener
{
navController
.
navigateUp
()
}
etAmountInterval
.
text
=
getString
(
uz
.
agr
.
mobiuz
.
R
.
string
.
agr_mobi_uz_amount_interval
,
"1000"
,
"500 000"
)
tvLinkOferta
.
setOnClickListener
(
object
:
uz
.
agr
.
sdk
.
coreui
.
ui
.
ButtonClick
()
{
override
fun
onSingleClick
(
v
:
View
?)
{
val
uri
=
Uri
.
parse
(
when
(
pref
.
language
){
CONSTANTS
.
UZ
->
CONSTANTS
.
PAYSYS_LICENSE_UZ
CONSTANTS
.
RU
->
CONSTANTS
.
PRIVACY_POLICY_RU
else
->
CONSTANTS
.
PAYSYS_LICENSE_EN
})
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
)
intent
.
data
=
uri
startActivity
(
intent
)
}
})
addCard
.
setOnClickListener
(
object
:
ButtonClick
()
{
override
fun
onSingleClick
(
v
:
View
?)
{
onCLickAddCard
()
}
})
btnPay
.
setOnClickListener
(
object
:
ButtonClick
()
{
override
fun
onSingleClick
(
v
:
View
?)
{
onClickPay
()
}
})
}
}
}
...
@@ -51,23 +122,323 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
...
@@ -51,23 +122,323 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
viewModel
.
mainIndexUiState
.
collect
{
viewModel
.
mainIndexUiState
.
collect
{
when
(
it
)
{
when
(
it
)
{
is
UiStateObject
.
SUCCESS
->
{
is
UiStateObject
.
SUCCESS
->
{
}
}
is
UiStateObject
.
ERROR
->
{
is
UiStateObject
.
ERROR
->
{
}
}
is
UiStateObject
.
LOADING
->
{
is
UiStateObject
.
LOADING
->
{
}
}
else
->
Unit
else
->
Unit
}
}
}
}
}
}
}
private
fun
setCardListAdapter
(
list
:
List
<
CardInfo
>)
{
bn
.
apply
{
addCard
.
isVisible
=
list
.
isEmpty
()
selectCardView
.
isVisible
=
list
.
isNotEmpty
()
if
(
list
.
isNotEmpty
())
{
selectCardView
.
showCard
(
list
[
0
],
0
)
}
}
}
private
fun
getAllCards
()
{
Timber
.
d
(
"getAllCards"
)
MobiUz
.
getAllCards
(
object
:
CardListenerMobi
<
CardInfo
>
{
override
fun
error
(
message
:
String
)
{
Timber
.
e
(
"error: $message"
)
}
override
fun
loading
(
boolean
:
Boolean
)
{
Timber
.
e
(
"progress: $boolean"
)
showProgressDialog
(
boolean
)
}
override
fun
local
(
localData
:
List
<
CardInfo
>)
{
Timber
.
e
(
"local: ${localData.size}"
)
setCardListAdapter
(
localData
)
}
override
fun
server
(
serverData
:
List
<
CardInfo
>)
{
Timber
.
e
(
"server: ${serverData.size}"
)
setCardListAdapter
(
serverData
)
}
})
}
private
fun
onClickPay
()
{
bn
.
apply
{
requireActivity
().
hideSoftInput
()
if
(
payWithAnotherCard
)
{
pay
()
}
else
{
if
(
selectedCard
!=
null
)
{
if
(
selectedCard
!!
.
balance
>
amountValid
!!
)
pay
()
else
showSnackMessage
(
getString
(
uz
.
agr
.
mobiuz
.
R
.
string
.
agr_mobi_uz_not_enough_money
))
}
}
}
}
private
fun
isMobiUz
(
code
:
String
):
Boolean
{
return
code
==
"97"
||
code
==
"88"
}
private
fun
pay
()
{
bn
.
apply
{
val
phoneNumber
=
"998${etPhone.unmaskedText}"
val
amount
=
amountValid
?:
0
if
(!
isMobiUz
(
phoneNumber
.
substring
(
3
,
5
)))
{
showSnackMessage
(
getString
(
uz
.
agr
.
mobiuz
.
R
.
string
.
agr_mobi_uz_payment_phone_error
))
return
}
val
vendorFormParams
=
HashMap
<
String
,
String
>()
val
newAccount
=
phoneNumber
.
substring
(
3
,
phoneNumber
.
length
).
trim
()
val
newType
=
phoneNumber
.
substring
(
3
,
5
)
val
type
=
getNewVendorId
(
newType
.
toInt
())
if
(
newType
.
toInt
()
==
99
||
newType
.
toInt
()
==
95
||
newType
.
toInt
()
==
71
||
newType
.
toInt
()
==
97
||
newType
.
toInt
()
==
88
)
vendorFormParams
[
"amount"
]
=
amount
.
toString
()
else
vendorFormParams
[
"summa"
]
=
amount
.
toString
()
vendorFormParams
[
"vendor_id"
]
=
type
.
first
.
toString
()
if
(
newType
.
toInt
()
==
71
)
{
vendorFormParams
[
"type"
]
=
"1"
}
if
(
newType
.
toInt
()
==
99
||
newType
.
toInt
()
==
95
||
newType
.
toInt
()
==
71
)
{
vendorFormParams
[
"account"
]
=
newAccount
}
else
{
if
(
newType
.
toInt
()
==
90
||
newType
.
toInt
()
==
91
)
vendorFormParams
[
"phone_number"
]
=
newAccount
else
vendorFormParams
[
"clientid"
]
=
newAccount
}
MobiUz
.
vendorFormCheck
(
vendorFormParams
,
object
:
BaseListener
<
Boolean
>
{
override
fun
error
(
message
:
String
)
{
showSnackMessage
(
message
)
}
override
fun
loading
(
boolean
:
Boolean
)
{}
override
fun
success
(
data
:
Boolean
)
{
if
(
payWithAnotherCard
)
payWithAnotherCard
(
cardNumberValid
,
cardExpiryValid
,
btnSwitch
.
isChecked
,
phoneNumber
,
vendorFormParams
)
else
vendorPay
(
selectedCard
,
phoneNumber
,
vendorFormParams
)
}
})
}
}
private
fun
vendorPay
(
selectedCard
:
CardInfo
?,
phoneNumber
:
String
,
vendorFormParams
:
HashMap
<
String
,
String
>)
{
if
(
selectedCard
!=
null
)
{
MobiUz
.
onClickPay
(
phoneNumber
,
selectedCard
,
vendorFormParams
,
requireContext
(),
object
:
VendorPayConfirm
{
override
fun
showConfirmPage
(
transactionId
:
Long
,
phoneNumber
:
String
,
timeOut
:
Int
)
{
// todo Shohboz aka uchun
}
override
fun
showError
(
message
:
String
)
{
showSnackMessage
(
message
)
}
override
fun
showProgress
(
show
:
Boolean
)
{
showProgressDialog
(
show
)
}
override
fun
showSuccessfulPayment
(
transactionId
:
Long
)
{
navController
.
navigate
(
R
.
id
.
paymentSuccessfulFragment
,
bundleOf
(
CONSTANTS
.
PHONE
to
phoneNumber
,
CONSTANTS
.
PAY_AMOUNT
to
amountValid
)
)
}
})
}
}
private
fun
payWithAnotherCard
(
cardNumber
:
String
,
cardExpiry
:
String
,
saveCard
:
Boolean
,
phoneNumber
:
String
,
vendorFormParams
:
HashMap
<
String
,
String
>)
{
MobiUz
.
vendorPayWithAnotherCard
(
cardNumber
,
cardExpiry
,
saveCard
,
phoneNumber
,
vendorFormParams
,
object
:
VendorPayConfirm
{
override
fun
showConfirmPage
(
transactionId
:
Long
,
phoneNumber
:
String
,
timeOut
:
Int
)
{
// todo Shohboz aka uchun
}
override
fun
showError
(
message
:
String
)
{
showSnackMessage
(
message
)
}
override
fun
showProgress
(
show
:
Boolean
)
{
showProgressDialog
(
show
)
}
override
fun
showSuccessfulPayment
(
transactionId
:
Long
)
{
navController
.
navigate
(
R
.
id
.
paymentSuccessfulFragment
,
bundleOf
(
CONSTANTS
.
PHONE
to
phoneNumber
,
CONSTANTS
.
PAY_AMOUNT
to
amountValid
,
CONSTANTS
.
PAY_SAVE_CARD
to
saveCard
,
CONSTANTS
.
PAY_CARD_NUMBER
to
cardNumber
)
)
}
})
}
private
fun
onCLickAddCard
()
{
requireActivity
().
hideSoftInput
()
val
dialog
=
SelectAnotherCard
()
dialog
.
setListener
(
object
:
SelectAnotherCard
.
Listener
{
override
fun
onClickAnotherCard
()
{
bn
.
apply
{
selectedCard
=
null
payWithAnotherCard
=
true
selectCardView
.
showNewCard
()
selectCardView
.
isVisible
=
false
addCardForm
.
isVisible
=
payWithAnotherCard
addCard
.
isVisible
=
false
checkValidForm
()
}
dialog
.
dismiss
()
}
override
fun
onClickAddCard
()
{
navController
.
navigate
(
R
.
id
.
addCardFragment
)
}
})
dialog
.
show
(
childFragmentManager
,
SelectAnotherCard
::
class
.
java
.
simpleName
)
}
private
fun
initPhone
()
{
bn
.
apply
{
etPhone
.
addTextChangedListener
(
object
:
TextWatcherWrapper
()
{
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
else
false
val
cardValid
=
if
(
payWithAnotherCard
)
cardNumberIsValid
&&
cardExpiryIsValid
else
selectedCard
!=
null
btnPay
.
isEnabled
=
isAllFormsValid
&&
cardValid
}
})
}
}
private
fun
initInputAmount
()
{
bn
.
apply
{
etAmount
.
keyListener
=
DigitsKeyListener
.
getInstance
(
"1234567890 "
)
etAmount
.
addTextChangedListener
(
AmountFormat
{
valid
,
amount
->
amountIsValid
=
valid
amountValid
=
amount
checkValidForm
()
})
}
}
private
fun
initInputCardNumber
()
{
bn
.
apply
{
etCardNumber
.
keyListener
=
DigitsKeyListener
.
getInstance
(
"1234567890 "
)
etCardNumber
.
addTextChangedListener
(
CardNumberFormat
{
valid
,
number
->
cardNumberIsValid
=
valid
if
(
valid
)
{
etCardExpiry
.
requestFocus
()
cardNumberValid
=
number
etCardNumber
.
setBackgroundResource
(
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_edit_text_unchecked
)
etCardNumber
.
setTextColor
(
getColorCompat
(
uz
.
agr
.
mobiuz
.
R
.
color
.
agr_text_color
))
}
else
{
etCardNumber
.
setBackgroundResource
(
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_edit_text_error
)
etCardNumber
.
setTextColor
(
getColorCompat
(
uz
.
agr
.
mobiuz
.
R
.
color
.
primary100
))
}
tvErrorMsg
.
isVisible
=
!
valid
checkValidForm
()
})
}
}
private
fun
initInputCardExpiry
()
{
bn
.
apply
{
etCardExpiry
.
keyListener
=
DigitsKeyListener
.
getInstance
(
"1234567890/"
)
etCardExpiry
.
addTextChangedListener
(
CardDateExpireFormat
{
valid
,
date
->
var
checkValid
=
valid
if
(
checkValid
&&
date
.
length
==
4
)
{
val
calendar
:
Calendar
=
Calendar
.
getInstance
()
val
year
=
calendar
.
get
(
Calendar
.
YEAR
).
toString
()
val
currentMonth
=
calendar
.
get
(
Calendar
.
MONTH
).
toString
().
toInt
()
+
1
val
inputMonth
=
date
.
substring
(
0
,
2
).
toInt
()
val
inputYY
=
date
.
substring
(
2
,
4
).
toInt
()
val
currentYY
=
year
.
substring
(
2
,
4
).
toInt
()
checkValid
=
if
(
inputMonth
>
12
||
inputMonth
==
0
)
false
else
if
(
inputYY
<
currentYY
)
false
else
if
(
inputYY
==
currentYY
&&
inputMonth
<
currentMonth
)
false
else
!(
inputYY
>
currentYY
&&
inputYY
>
currentYY
+
5
)
}
if
(
checkValid
)
{
cardExpiryValid
=
date
if
(!
cardNumberIsValid
)
{
etCardNumber
.
requestFocus
()
}
else
activity
?.
hideSoftInput
()
etCardExpiry
.
setBackgroundResource
(
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_edit_text_unchecked
)
etCardExpiry
.
setTextColor
(
getColorCompat
(
uz
.
agr
.
mobiuz
.
R
.
color
.
agr_text_color
))
}
else
{
etCardExpiry
.
setBackgroundResource
(
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_edit_text_error
)
etCardExpiry
.
setTextColor
(
getColorCompat
(
uz
.
agr
.
mobiuz
.
R
.
color
.
primary100
))
}
cardExpiryIsValid
=
checkValid
tvErrorMsgExpiry
.
isVisible
=
!
checkValid
checkValidForm
()
})
}
}
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
else
false
val
cardValid
=
if
(
payWithAnotherCard
)
cardNumberIsValid
&&
cardExpiryIsValid
else
selectedCard
!=
null
btnPay
.
isEnabled
=
isAllFormsValid
&&
cardValid
}
}
private
fun
getNewVendorId
(
type
:
Int
):
Tuple3
{
return
when
(
type
)
{
99
->
Tuple3
(
"100240"
,
"Uzmobile GSM"
,
getResources
(
type
))
95
->
Tuple3
(
"100243"
,
"Uzmobile CDMA"
,
getResources
(
type
))
98
->
Tuple3
(
"100083"
,
"Perfectum"
,
getResources
(
type
))
97
->
Tuple3
(
"100082"
,
"UMS"
,
getResources
(
type
))
88
->
Tuple3
(
"100082"
,
"UMS"
,
getResources
(
type
))
94
->
Tuple3
(
"100081"
,
"Ucell"
,
getResources
(
type
))
93
->
Tuple3
(
"100081"
,
"Ucell"
,
getResources
(
type
))
91
->
Tuple3
(
"100080"
,
"Beeline"
,
getResources
(
type
))
90
->
Tuple3
(
"100080"
,
"Beeline"
,
getResources
(
type
))
71
->
Tuple3
(
"100406"
,
"TShTT Абонентская плата"
,
getResources
(
type
))
else
->
Tuple3
(
"-100001"
,
"Unknown"
,
getResources
(
type
))
}
}
private
fun
getResources
(
prefix
:
Int
):
Int
{
return
when
(
prefix
)
{
99
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_logo_uztelekom
95
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_logo_uztelekom
98
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_log_perfectum
97
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_logo_ums
88
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_logo_ums
94
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_logo_ucell
93
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_logo_ucell
91
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_logo_beeline
90
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_logo_beeline
71
->
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_logo_uztelekom
else
->
0
}
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/card/AddCardFragment.kt
View file @
d2c1ab1a
...
@@ -81,7 +81,7 @@ class AddCardFragment : BaseFragment(R.layout.fragment_add_card) {
...
@@ -81,7 +81,7 @@ class AddCardFragment : BaseFragment(R.layout.fragment_add_card) {
val
filteredCards
=
serverData
.
filter
{
it
.
cardHash
==
hash
}
val
filteredCards
=
serverData
.
filter
{
it
.
cardHash
==
hash
}
if
(
filteredCards
.
isEmpty
())
{
if
(
filteredCards
.
isEmpty
())
{
//
viewModel.cardRegistration("998949125150", cardNumberValid!!, cardExpiryValid!!)
viewModel
.
cardRegistration
(
"998949125150"
,
cardNumberValid
!!
,
cardExpiryValid
!!
)
}
else
{
}
else
{
showToastMessage
(
getString
(
uz
.
agr
.
mobiuz
.
R
.
string
.
agr_mobi_uz_card_exist
))
showToastMessage
(
getString
(
uz
.
agr
.
mobiuz
.
R
.
string
.
agr_mobi_uz_card_exist
))
}
}
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/pay/SelectAnotherCard.kt
0 → 100644
View file @
d2c1ab1a
package
uz.mobiuz.mobiservice.dev.ui.sdk.pay
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
com.google.android.material.bottomsheet.BottomSheetDialogFragment
import
uz.mobiuz.mobiservice.dev.databinding.LayoutSelectAnotherCardBinding
/**
* Created by DostonbekIbragimov on 24/12/2021.
*/
class
SelectAnotherCard
:
BottomSheetDialogFragment
()
{
private
var
_bn
:
LayoutSelectAnotherCardBinding
?
=
null
private
val
bn
get
()
=
_bn
?:
throw
NullPointerException
(
"cannot inflate"
)
private
var
mListener
:
Listener
?
=
null
fun
setListener
(
listener
:
Listener
?)
{
this
.
mListener
=
listener
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
{
_bn
=
LayoutSelectAnotherCardBinding
.
inflate
(
inflater
)
return
bn
.
root
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
setUpUI
()
}
private
fun
setUpUI
()
{
bn
.
apply
{
btnAnotherCard
.
setOnClickListener
{
mListener
?.
onClickAnotherCard
()
dismiss
()
}
btnAddCard
.
setOnClickListener
{
mListener
?.
onClickAddCard
()
dismiss
()
}
}
}
interface
Listener
{
fun
onClickAnotherCard
()
fun
onClickAddCard
()
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/pay/success/PaymentSuccessfulFragment.kt
0 → 100644
View file @
d2c1ab1a
package
uz.mobiuz.mobiservice.dev.ui.sdk.pay.success
import
android.annotation.SuppressLint
import
android.os.Bundle
import
android.view.View
import
androidx.core.view.isVisible
import
androidx.navigation.NavController
import
androidx.navigation.fragment.NavHostFragment
import
dagger.hilt.android.AndroidEntryPoint
import
uz.agr.mobiuz.ui.fast_action.animation.formatPhone
import
uz.agr.sdk.coreui.extension.formattedMoney
import
uz.agr.sdk.coreui.extension.showSnackMessage
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.databinding.FragmentPaymentSuccessfulBinding
import
uz.mobiuz.mobiservice.dev.ui.base.BaseFragment
import
uz.mobiuz.mobiservice.dev.ui.global.CONSTANTS
import
uz.mobiuz.mobiservice.dev.utils.extensions.formatCard
/**
* Created by DostonbekIbragimov on 06/01/2022.
*/
@AndroidEntryPoint
class
PaymentSuccessfulFragment
:
BaseFragment
(
R
.
layout
.
fragment_payment_successful
)
{
private
var
_bn
:
FragmentPaymentSuccessfulBinding
?
=
null
private
val
bn
get
()
=
_bn
?:
throw
NullPointerException
(
"cannot inflate"
)
private
var
phone
=
""
private
var
amount
=
""
private
var
saveCard
:
Boolean
?
=
null
private
var
cardNumber
=
""
private
val
navController
:
NavController
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
NavHostFragment
.
findNavController
(
this
)
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
phone
=
arguments
?.
getString
(
CONSTANTS
.
PHONE
,
""
)
?:
""
amount
=
arguments
?.
getString
(
CONSTANTS
.
PAY_AMOUNT
,
"0"
)
?:
"0"
saveCard
=
arguments
?.
getBoolean
(
CONSTANTS
.
PAY_SAVE_CARD
)
cardNumber
=
arguments
?.
getString
(
CONSTANTS
.
PAY_CARD_NUMBER
,
""
)
?:
""
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
_bn
=
FragmentPaymentSuccessfulBinding
.
bind
(
view
)
setUpUI
()
collects
()
}
@SuppressLint
(
"SetTextI18n"
)
override
fun
setUpUI
()
{
bn
.
apply
{
etAmount
.
text
=
"${amount.toLong().formattedMoney(showDecimal = false, tiyinToSum = false)} ${getString(uz.agr.mobiuz.R.string.agr_mobi_uz_curr)}"
etPhone
.
text
=
phone
.
formatPhone
(
minus
=
false
)
if
(
saveCard
==
true
)
{
showSnackMessage
(
getString
(
uz
.
agr
.
mobiuz
.
R
.
string
.
agr_mobi_uz_card_added
))
if
(
cardNumber
.
isNotEmpty
())
{
tvPanTitle
.
isVisible
=
true
etCardPan
.
text
=
cardNumber
.
formatCard
()
}
}
if
(
saveCard
==
false
)
{
showSnackMessage
(
getString
(
uz
.
agr
.
mobiuz
.
R
.
string
.
agr_mobi_uz_card_not_save
))
}
}
}
override
fun
collects
()
{
}
override
fun
onDestroy
()
{
_bn
=
null
super
.
onDestroy
()
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/utils/extensions/StringExtension.kt
View file @
d2c1ab1a
...
@@ -21,14 +21,14 @@ import androidx.fragment.app.FragmentActivity
...
@@ -21,14 +21,14 @@ import androidx.fragment.app.FragmentActivity
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.google.android.material.textfield.TextInputEditText
import
com.google.android.material.textfield.TextInputEditText
import
com.google.gson.JsonSyntaxException
import
com.google.gson.JsonSyntaxException
import
retrofit2.HttpException
import
uz.agr.mobiuz.ui.fast_action.animation.getPhoneMasked
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.model.Translate
import
uz.mobiuz.mobiservice.dev.network.model.Errors
import
uz.mobiuz.mobiservice.dev.network.model.Errors
import
uz.mobiuz.mobiservice.dev.ui.global.CONSTANTS
import
uz.mobiuz.mobiservice.dev.ui.global.CONSTANTS
import
uz.mobiuz.mobiservice.dev.ui.global.ExitDialog
import
uz.mobiuz.mobiservice.dev.ui.global.ExitDialog
import
uz.mobiuz.mobiservice.dev.ui.global.OfflineBottomSheet
import
uz.mobiuz.mobiservice.dev.ui.global.OfflineBottomSheet
import
uz.mobiuz.mobiservice.dev.ui.global.SenderDialog
import
uz.mobiuz.mobiservice.dev.ui.global.SenderDialog
import
retrofit2.HttpException
import
uz.mobiuz.mobiservice.dev.utils.NetworkUtil
import
uz.mobiuz.mobiservice.dev.utils.NetworkUtil
import
java.io.IOException
import
java.io.IOException
import
java.net.ConnectException
import
java.net.ConnectException
...
@@ -145,8 +145,8 @@ fun View.getStatusBarHeight(): Int {
...
@@ -145,8 +145,8 @@ fun View.getStatusBarHeight(): Int {
fun
String
.
maskedTextMobi
():
String
{
fun
String
.
maskedTextMobi
():
String
{
var
newText
=
""
var
newText
=
""
for
(
i
in
this
.
indices
){
for
(
i
in
this
.
indices
)
{
if
(
i
==
2
||
i
==
5
||
i
==
7
)
{
if
(
i
==
2
||
i
==
5
||
i
==
7
)
{
newText
+=
" "
newText
+=
" "
}
}
newText
+=
this
[
i
]
newText
+=
this
[
i
]
...
@@ -290,4 +290,20 @@ fun List<Errors>.getMessage(): String {
...
@@ -290,4 +290,20 @@ fun List<Errors>.getMessage(): String {
message
+=
"${it.message}\n"
message
+=
"${it.message}\n"
}
}
return
message
return
message
}
}
\ No newline at end of file
fun
String
.
formatCard
():
String
{
return
when
(
this
.
length
)
{
16
->
"${this.substring(0, 4)} ${this.substring(4, 6)}** **** ${this.substring(12, 16)}"
13
->
"${this.substring(0, 4)} ${this.substring(4, 6)}** **** ${this.substring(9, 13)}"
else
->
this
}
}
fun
String
.
formatPhone
(
minus
:
Boolean
=
true
):
String
{
return
when
(
this
.
length
)
{
12
->
getPhoneMasked
(
this
.
substring
(
this
.
length
-
9
,
this
.
length
),
minus
)
9
->
getPhoneMasked
(
this
,
minus
)
else
->
this
}
}
app/src/main/java/uz/mobiuz/mobiservice/dev/utils/format/AmountFormat.kt
0 → 100644
View file @
d2c1ab1a
package
uz.mobiuz.mobiservice.dev.utils.format
import
android.text.Editable
import
uz.mobiuz.mobiservice.dev.ui.global.TextWatcherWrapper
class
AmountFormat
(
private
val
validListener
:
(
Boolean
,
Long
)
->
Unit
)
:
TextWatcherWrapper
()
{
private
var
lock
=
false
override
fun
afterTextChanged
(
s
:
Editable
)
{
if
(
lock
)
return
lock
=
true
val
text
=
s
.
toString
().
replace
(
"\\D"
.
toRegex
(),
""
)
s
.
replace
(
0
,
s
.
length
,
text
)
var
i
=
s
.
length
-
3
while
(
i
>
0
&&
i
<
s
.
length
)
{
if
(
s
.
toString
()[
i
]
!=
' '
)
{
s
.
insert
(
i
,
" "
)
}
i
-=
3
}
lock
=
false
validListener
.
invoke
(
text
.
matches
(
"^[1-9][0-9]*$"
.
toRegex
()),
if
(
text
.
isNotEmpty
())
text
.
toLong
()
else
0L
)
}
}
\ No newline at end of file
app/src/main/res/layout/fragment_home.xml
View file @
d2c1ab1a
...
@@ -10,14 +10,14 @@
...
@@ -10,14 +10,14 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<ImageView
<
uz.mobiuz.mobiservice.dev.ui.home.Home
ImageView
android:id=
"@+id/home_image2"
android:id=
"@+id/home_image2"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:scaleType=
"fitXY"
android:scaleType=
"fitXY"
android:src=
"@drawable/bgn_home"
/>
android:src=
"@drawable/bgn_home"
/>
<ImageView
<
uz.mobiuz.mobiservice.dev.ui.home.Home
ImageView
android:id=
"@+id/home_image"
android:id=
"@+id/home_image"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
app/src/main/res/layout/fragment_payment_successful.xml
0 → 100644
View file @
d2c1ab1a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/paySuccessLayout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/_30sdp"
>
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/successPayment"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:gravity=
"center"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<ImageView
android:id=
"@+id/image"
android:layout_width=
"@dimen/_70sdp"
android:layout_height=
"@dimen/_70sdp"
android:layout_gravity=
"center"
android:layout_marginTop=
"36dp"
android:adjustViewBounds=
"true"
android:src=
"@drawable/icon_female"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/description"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginHorizontal=
"26dp"
android:layout_marginTop=
"20dp"
android:gravity=
"center"
android:letterSpacing=
"0.05"
android:text=
"@string/agr_mobi_uz_payment_success"
android:textColor=
"@color/agr_black80"
android:textSize=
"32sp"
android:textStyle=
"bold"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"7dp"
android:text=
"@string/agr_mobi_uz_summa_pay"
android:textColor=
"@color/agr_grey110"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/etAmount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:textColor=
"@color/primary110"
android:textSize=
"16sp"
android:textStyle=
"bold"
tools:text=
"25 000 UZC"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"@string/agr_mobi_uz_summa_phone"
android:textColor=
"@color/agr_grey110"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/etPhone"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:textColor=
"@color/primary110"
android:textSize=
"16sp"
android:textStyle=
"bold"
tools:text=
"+998 99 055 21 09"
/>
<TextView
android:id=
"@+id/tvPanTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:text=
"@string/agr_mobi_uz_summa_card_pan"
android:textColor=
"@color/agr_grey110"
android:textSize=
"12sp"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
<TextView
android:id=
"@+id/etCardPan"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:textColor=
"@color/primary110"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:visibility=
"gone"
tools:text=
"8600 31** **** 88989"
tools:visibility=
"visible"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/errorPayment"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginBottom=
"@dimen/_30sdp"
android:clickable=
"true"
android:focusable=
"true"
android:gravity=
"center"
android:orientation=
"vertical"
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<ImageView
android:layout_width=
"@dimen/_70sdp"
android:layout_height=
"@dimen/_70sdp"
android:layout_gravity=
"center"
android:layout_marginTop=
"36dp"
android:adjustViewBounds=
"true"
android:scaleType=
"centerCrop"
android:src=
"@drawable/agr_female_error"
tools:ignore=
"ContentDescription"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginHorizontal=
"26dp"
android:layout_marginTop=
"20dp"
android:gravity=
"center"
android:letterSpacing=
"0.01"
android:text=
"@string/agr_mobi_uz_payment_error"
android:textColor=
"@color/agr_black80"
android:textSize=
"24sp"
android:textStyle=
"bold"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"7dp"
android:text=
"@string/agr_mobi_uz_refresh_time"
android:textColor=
"@color/agr_grey110"
android:textSize=
"14sp"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
<Button
android:id=
"@+id/doneButton"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:layout_marginHorizontal=
"16dp"
android:layout_marginLeft=
"16dp"
android:layout_marginTop=
"30dp"
android:layout_marginRight=
"16dp"
android:layout_marginBottom=
"40dp"
android:text=
"@string/agr_mobi_uz_done"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
</LinearLayout>
app/src/main/res/layout/fragment_replenish_balance.xml
View file @
d2c1ab1a
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:fitsSystemWindows=
"true"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".ui.sdk.ReplenishBalanceFragment"
>
android:background=
"@color/agr_white"
android:orientation=
"vertical"
>
<!-- TODO: Update blank fragment layout -->
<com.google.android.material.appbar.MaterialToolbar
<TextView
android:id=
"@+id/toolbar"
style=
"@style/agr_ToolbarStyle"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/hello_blank_fragment"
/>
android:elevation=
"0dp"
app:title=
"@string/agr_mobi_uz_rb_title"
app:navigationIcon=
"@drawable/agr_ic_arrow_blue"
/>
</FrameLayout>
<ScrollView
\ No newline at end of file
android:id=
"@+id/replenishBalanceContainer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:overScrollMode=
"never"
android:scrollbars=
"none"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:animateLayoutChanges=
"true"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/txt_hint_phone"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"24dp"
android:text=
"@string/agr_mobi_uz_fast_phone_number"
android:textColor=
"@color/agr_black75"
android:textSize=
"15sp"
/>
<com.github.pinball83.maskededittext.MaskedEditText
android:id=
"@+id/etPhone"
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"4dp"
android:background=
"@drawable/agr_edit_text_unchecked"
android:gravity=
"center|start"
android:imeOptions=
"actionNext"
android:inputType=
"number|textNoSuggestions"
android:paddingHorizontal=
"12dp"
android:paddingVertical=
"12dp"
android:textColor=
"@color/agr_text_color"
android:textSize=
"15sp"
app:mask=
"+998 ** *** ** **"
app:notMaskedSymbol=
"*"
/>
<TextView
android:id=
"@+id/txt_hint_amount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:text=
"@string/agr_mobi_uz_amount"
android:textColor=
"@color/agr_black75"
android:textSize=
"15sp"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"4dp"
>
<EditText
android:id=
"@+id/etAmount"
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:background=
"@drawable/agr_edit_text_unchecked"
android:gravity=
"center|start"
android:imeOptions=
"actionDone"
android:importantForAutofill=
"no"
android:inputType=
"number|textNoSuggestions"
android:longClickable=
"false"
android:maxLength=
"11"
android:paddingHorizontal=
"12dp"
android:paddingVertical=
"12dp"
android:textColor=
"@color/agr_text_color"
android:textSize=
"15sp"
tools:ignore=
"LabelFor"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center|end"
android:layout_marginEnd=
"16dp"
android:text=
"@string/agr_mobi_uz_curr"
android:textColor=
"@color/agr_grey100"
android:textSize=
"15sp"
/>
</FrameLayout>
<TextView
android:id=
"@+id/etAmountInterval"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"12dp"
android:text=
"@string/agr_mobi_uz_amount_interval"
android:textStyle=
"bold"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"16dp"
android:layout_marginTop=
"40dp"
android:layout_marginRight=
"16dp"
android:text=
"@string/agr_mobi_uz_source_money_transfer"
android:textColor=
"@color/agr_black75"
android:textSize=
"15sp"
/>
<LinearLayout
android:id=
"@+id/addCard"
android:layout_width=
"match_parent"
android:layout_height=
"124dp"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"6dp"
android:background=
"@drawable/agr_add_card_bg"
android:clickable=
"true"
android:focusable=
"true"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/agr_mobi_uz_add_card"
android:textColor=
"@color/agr_text_color"
android:textSize=
"14sp"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:contentDescription=
"@null"
app:srcCompat=
"@drawable/ic_agr_add"
/>
</LinearLayout>
<uz.agr.mobiuz.ui.view.SelectCardView1
android:id=
"@+id/selectCardView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"16dp"
android:layout_marginTop=
"4dp"
android:layout_marginRight=
"16dp"
android:layout_marginBottom=
"10dp"
android:visibility=
"gone"
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:layout_marginBottom=
"16dp"
android:orientation=
"vertical"
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/agr_black75"
android:textSize=
"15sp"
/>
<EditText
android:id=
"@+id/etCardNumber"
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:layout_marginTop=
"4dp"
android:background=
"@drawable/agr_edit_text_unchecked"
android:gravity=
"center|start"
android:hint=
"0000 0000 0000 0000"
android:imeOptions=
"actionNext"
android:importantForAutofill=
"no"
android:inputType=
"number|textNoSuggestions"
android:longClickable=
"false"
android:maxLength=
"19"
android:paddingHorizontal=
"16dp"
android:paddingVertical=
"12dp"
android:textColor=
"@color/agr_text_color"
android:textSize=
"15sp"
tools:ignore=
"Autofill,HardcodedText"
/>
<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/agr_red"
android:textSize=
"13sp"
android:textStyle=
"bold"
android:visibility=
"gone"
app:drawableStartCompat=
"@drawable/agr_mobi_uz_ic_error"
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/agr_black75"
android:textSize=
"15sp"
/>
<EditText
android:id=
"@+id/etCardExpiry"
android:layout_width=
"wrap_content"
android:layout_height=
"56dp"
android:layout_marginTop=
"4dp"
android:background=
"@drawable/agr_edit_text_unchecked"
android:gravity=
"center|start"
android:hint=
"ММ/ГГ"
android:imeOptions=
"actionDone"
android:importantForAutofill=
"no"
android:inputType=
"number|textNoSuggestions"
android:longClickable=
"false"
android:maxLength=
"5"
android:paddingVertical=
"12dp"
android:paddingStart=
"16dp"
android:paddingEnd=
"16dp"
android:textColor=
"@color/agr_text_color"
android:textSize=
"15sp"
tools:ignore=
"HardcodedText"
/>
<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/agr_red"
android:textSize=
"13sp"
android:textStyle=
"bold"
android:visibility=
"gone"
app:drawableStartCompat=
"@drawable/agr_mobi_uz_ic_error"
tools:visibility=
"visible"
/>
<LinearLayout
android:id=
"@+id/checkboxSaveCard"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
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/agr_text_color"
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>
</LinearLayout>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:minHeight=
"@dimen/_20sdp"
/>
<Button
android:id=
"@+id/btnPay"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:layout_marginHorizontal=
"16dp"
android:layout_marginBottom=
"40dp"
android:enabled=
"false"
android:text=
"@string/agr_mobi_uz_to_pay"
/>
<TextView
android:id=
"@+id/tvLinkOferta"
android:background=
"?android:selectableItemBackground"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginBottom=
"64dp"
android:text=
"@string/agr_mobi_uz_oferta"
android:textColor=
"@color/linkColor"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/layout_select_another_card.xml
0 → 100644
View file @
d2c1ab1a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/agr_rounded_dialog"
android:orientation=
"vertical"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"12dp"
android:contentDescription=
"@null"
app:srcCompat=
"@drawable/agr_bg_bottom_sheet_top"
/>
<TextView
android:id=
"@+id/txt_title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginHorizontal=
"@dimen/_20sdp"
android:layout_marginTop=
"@dimen/_20sdp"
android:gravity=
"center"
android:text=
"@string/agr_mobi_uz_source_money_transfer"
android:textColor=
"@color/agr_text_color"
android:textSize=
"20sp"
android:textStyle=
"bold"
/>
<Button
android:id=
"@+id/btnAnotherCard"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/_44sdp"
android:layout_gravity=
"center_horizontal"
android:layout_marginHorizontal=
"@dimen/_20sdp"
android:layout_marginTop=
"@dimen/_20sdp"
android:background=
"@drawable/agr_mobi_uz_button_grey"
android:elevation=
"0dp"
android:text=
"@string/agr_mobi_uz_pay_with_another_card"
android:textAllCaps=
"false"
android:textColor=
"@color/primary100"
android:textSize=
"15sp"
android:textStyle=
"bold"
android:translationZ=
"0dp"
/>
<Button
android:id=
"@+id/btnAddCard"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/_44sdp"
android:layout_gravity=
"center"
android:layout_marginHorizontal=
"@dimen/_20sdp"
android:layout_marginTop=
"@dimen/_12sdp"
android:background=
"@drawable/agr_mobi_uz_button"
android:elevation=
"0dp"
android:paddingVertical=
"12dp"
android:text=
"@string/agr_mobi_uz_add_card"
android:textAllCaps=
"false"
android:textColor=
"@color/agr_white"
android:textSize=
"15sp"
android:textStyle=
"bold"
android:translationZ=
"0dp"
/>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/_24sdp"
/>
</LinearLayout>
\ No newline at end of file
app/src/main/res/navigation/nav_graph_home.xml
View file @
d2c1ab1a
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
<navigation
xmlns:android=
"http://schemas.android.com/apk/res/android"
<navigation
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
a
pp:startDestination=
"@id/homeFragment
"
a
ndroid:id=
"@+id/nav_graph_home
"
a
ndroid:id=
"@+id/nav_graph_home
"
>
a
pp:startDestination=
"@id/homeFragment
"
>
<fragment
<fragment
android:id=
"@+id/homeFragment"
android:id=
"@+id/homeFragment"
...
@@ -24,9 +24,9 @@
...
@@ -24,9 +24,9 @@
tools:layout=
"@layout/fragment_language"
/>
tools:layout=
"@layout/fragment_language"
/>
<fragment
<fragment
android:id=
"@+id/supportFragment"
android:id=
"@+id/supportFragment"
tools:layout=
"@layout/fragment_support"
android:name=
"uz.mobiuz.mobiservice.dev.ui.settings.SupportFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.settings.SupportFragment"
android:label=
"SupportFragment"
/>
android:label=
"SupportFragment"
tools:layout=
"@layout/fragment_support"
/>
<fragment
<fragment
android:id=
"@+id/securityFragment"
android:id=
"@+id/securityFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.settings.security.SecurityFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.settings.security.SecurityFragment"
...
@@ -40,9 +40,9 @@
...
@@ -40,9 +40,9 @@
<fragment
<fragment
android:id=
"@+id/changePasswordFragment"
android:id=
"@+id/changePasswordFragment"
tools:layout=
"@layout/fragment_change_password"
android:name=
"uz.mobiuz.mobiservice.dev.ui.settings.security.ChangePasswordFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.settings.security.ChangePasswordFragment"
android:label=
"CurrentPasswordFragment"
/>
android:label=
"CurrentPasswordFragment"
tools:layout=
"@layout/fragment_change_password"
/>
<fragment
<fragment
android:id=
"@+id/billingFragment"
android:id=
"@+id/billingFragment"
...
@@ -52,9 +52,9 @@
...
@@ -52,9 +52,9 @@
<fragment
<fragment
android:id=
"@+id/pinFragment"
android:id=
"@+id/pinFragment"
tools:layout=
"@layout/fragment_pin"
android:name=
"uz.mobiuz.mobiservice.dev.ui.global.PinFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.global.PinFragment"
android:label=
"FullScreenFragment"
/>
android:label=
"FullScreenFragment"
tools:layout=
"@layout/fragment_pin"
/>
<fragment
<fragment
android:id=
"@+id/motionFragment"
android:id=
"@+id/motionFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.home.MotionFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.home.MotionFragment"
...
@@ -62,9 +62,9 @@
...
@@ -62,9 +62,9 @@
tools:layout=
"@layout/fragment_motion"
/>
tools:layout=
"@layout/fragment_motion"
/>
<fragment
<fragment
android:id=
"@+id/cardsListFragment"
android:id=
"@+id/cardsListFragment"
tools:layout=
"@layout/fragment_cards_list"
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.card.CardsListFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.card.CardsListFragment"
android:label=
"CardsListFragment"
/>
android:label=
"CardsListFragment"
tools:layout=
"@layout/fragment_cards_list"
/>
<fragment
<fragment
android:id=
"@+id/monitoringLocalFragment"
android:id=
"@+id/monitoringLocalFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.MonitoringLocalFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.MonitoringLocalFragment"
...
@@ -77,9 +77,9 @@
...
@@ -77,9 +77,9 @@
tools:layout=
"@layout/fragment_replenish_balance"
/>
tools:layout=
"@layout/fragment_replenish_balance"
/>
<fragment
<fragment
android:id=
"@+id/addCardFragment"
android:id=
"@+id/addCardFragment"
tools:layout=
"@layout/fragment_add_card"
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.card.AddCardFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.card.AddCardFragment"
android:label=
"AddCardFragment"
/>
android:label=
"AddCardFragment"
tools:layout=
"@layout/fragment_add_card"
/>
<fragment
<fragment
android:id=
"@+id/cardConfirmFragment"
android:id=
"@+id/cardConfirmFragment"
tools:layout=
"@layout/fragment_card_confirm"
tools:layout=
"@layout/fragment_card_confirm"
...
@@ -87,6 +87,12 @@
...
@@ -87,6 +87,12 @@
android:label=
"CardConfirmFragment"
/>
android:label=
"CardConfirmFragment"
/>
<fragment
<fragment
android:id=
"@+id/paymentSuccessfulFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.pay.success.PaymentSuccessfulFragment"
android:label=
"PaymentSuccessfulFragment"
tools:layout=
"@layout/fragment_payment_successful"
/>
<fragment
android:id=
"@+id/verificationFragment"
android:id=
"@+id/verificationFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.auth.verification.VerificationFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.auth.verification.VerificationFragment"
android:label=
"MyVerificationFragment"
/>
android:label=
"MyVerificationFragment"
/>
...
...
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