Commit e6960d70 authored by Dostonbek Ibragimov's avatar Dostonbek Ibragimov 💻

[ADD] MUS-288, ReplenishBalance pay vendor

parent ff55e2e3
......@@ -95,4 +95,11 @@ object CONSTANTS {
const val API_SERVICE_INDEX = "service/index"
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"
}
package uz.mobiuz.mobiservice.dev.ui.sdk
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.text.Editable
import android.text.method.DigitsKeyListener
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.lifecycle.lifecycleScope
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import dagger.hilt.android.AndroidEntryPoint
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.databinding.FragmentMonitoringLocalBinding
import uz.mobiuz.mobiservice.dev.databinding.FragmentReplenishBalanceBinding
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.home.HomeViewModel
import uz.mobiuz.mobiservice.dev.ui.sdk.pay.SelectAnotherCard
import java.util.*
import javax.inject.Inject
import kotlin.collections.HashMap
@AndroidEntryPoint
class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balance) {
......@@ -31,6 +53,17 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
private val viewModel: HomeViewModel by viewModels()
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?) {
_bn = FragmentReplenishBalanceBinding.bind(view)
......@@ -42,7 +75,42 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
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 lang = LocaleManager.getLanguage(requireContext())
val uri = Uri.parse("https://mobileapp.mobi.uz/uploads/paysys/license_$lang.html")
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 +119,323 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
viewModel.mainIndexUiState.collect {
when (it) {
is UiStateObject.SUCCESS -> {
}
is UiStateObject.ERROR -> {
}
is UiStateObject.LOADING -> {
}
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() {
......
......@@ -130,7 +130,7 @@ class CardsListFragment : BaseFragment(R.layout.fragment_cards_list) {
}
private fun delete(card: CardInfo) {
MobiUz.deleteCard(card)
// MobiUz.deleteCard(card)
}
......
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
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
......@@ -21,14 +21,14 @@ import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.textfield.TextInputEditText
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.model.Translate
import uz.mobiuz.mobiservice.dev.network.model.Errors
import uz.mobiuz.mobiservice.dev.ui.global.CONSTANTS
import uz.mobiuz.mobiservice.dev.ui.global.ExitDialog
import uz.mobiuz.mobiservice.dev.ui.global.OfflineBottomSheet
import uz.mobiuz.mobiservice.dev.ui.global.SenderDialog
import retrofit2.HttpException
import uz.mobiuz.mobiservice.dev.utils.NetworkUtil
import java.io.IOException
import java.net.ConnectException
......@@ -145,8 +145,8 @@ fun View.getStatusBarHeight(): Int {
fun String.maskedTextMobi(): String {
var newText = ""
for (i in this.indices){
if(i == 2 || i == 5 || i == 7){
for (i in this.indices) {
if (i == 2 || i == 5 || i == 7) {
newText += " "
}
newText += this[i]
......@@ -290,4 +290,20 @@ fun List<Errors>.getMessage(): String {
message += "${it.message}\n"
}
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
}
}
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
<?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>
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.sdk.ReplenishBalanceFragment">
android:background="@color/agr_white"
android:fitsSystemWindows="true"
android:orientation="vertical">
<!-- TODO: Update blank fragment layout -->
<TextView
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/agr_ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
android:layout_height="wrap_content"
android:elevation="0dp"
app:navigationIcon="@drawable/agr_ic_arrow_blue">
</FrameLayout>
\ No newline at end of file
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/agr_mobi_uz_rb_title"
android:textColor="@color/agr_black"
android:textSize="18sp"
android:textStyle="bold" />
</androidx.appcompat.widget.Toolbar>
<ScrollView
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: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
<?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
......@@ -2,8 +2,8 @@
<navigation 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"
app:startDestination="@id/homeFragment"
android:id="@+id/nav_graph_home">
android:id="@+id/nav_graph_home"
app:startDestination="@id/homeFragment">
<fragment
android:id="@+id/homeFragment"
......@@ -24,9 +24,9 @@
tools:layout="@layout/fragment_language" />
<fragment
android:id="@+id/supportFragment"
tools:layout="@layout/fragment_support"
android:name="uz.mobiuz.mobiservice.dev.ui.settings.SupportFragment"
android:label="SupportFragment" />
android:label="SupportFragment"
tools:layout="@layout/fragment_support" />
<fragment
android:id="@+id/securityFragment"
android:name="uz.mobiuz.mobiservice.dev.ui.settings.security.SecurityFragment"
......@@ -40,9 +40,9 @@
<fragment
android:id="@+id/changePasswordFragment"
tools:layout="@layout/fragment_change_password"
android:name="uz.mobiuz.mobiservice.dev.ui.settings.security.ChangePasswordFragment"
android:label="CurrentPasswordFragment" />
android:label="CurrentPasswordFragment"
tools:layout="@layout/fragment_change_password" />
<fragment
android:id="@+id/billingFragment"
......@@ -52,9 +52,9 @@
<fragment
android:id="@+id/pinFragment"
tools:layout="@layout/fragment_pin"
android:name="uz.mobiuz.mobiservice.dev.ui.global.PinFragment"
android:label="FullScreenFragment" />
android:label="FullScreenFragment"
tools:layout="@layout/fragment_pin" />
<fragment
android:id="@+id/motionFragment"
android:name="uz.mobiuz.mobiservice.dev.ui.home.MotionFragment"
......@@ -62,9 +62,9 @@
tools:layout="@layout/fragment_motion" />
<fragment
android:id="@+id/cardsListFragment"
tools:layout="@layout/fragment_cards_list"
android:name="uz.mobiuz.mobiservice.dev.ui.sdk.card.CardsListFragment"
android:label="CardsListFragment" />
android:label="CardsListFragment"
tools:layout="@layout/fragment_cards_list" />
<fragment
android:id="@+id/monitoringLocalFragment"
android:name="uz.mobiuz.mobiservice.dev.ui.sdk.MonitoringLocalFragment"
......@@ -77,13 +77,19 @@
tools:layout="@layout/fragment_replenish_balance" />
<fragment
android:id="@+id/addCardFragment"
tools:layout="@layout/fragment_add_card"
android:name="uz.mobiuz.mobiservice.dev.ui.sdk.card.AddCardFragment"
android:label="AddCardFragment" />
android:label="AddCardFragment"
tools:layout="@layout/fragment_add_card" />
<fragment
android:id="@+id/cardConfirmFragment"
tools:layout=""
android:name="uz.mobiuz.mobiservice.dev.ui.sdk.card.CardConfirmFragment"
android:label="CardConfirmFragment" />
android:label="CardConfirmFragment"
tools:layout="" />
<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" />
</navigation>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment