Commit 21461be2 authored by shohboz's avatar shohboz

[UPD] MUS-318 Feature, updated sdk, added library

parent a4b84542
......@@ -31,5 +31,10 @@
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="http://185.74.5.122:8081/artifactory/agr-libs" />
</remote-repository>
</component>
</project>
\ No newline at end of file
......@@ -56,10 +56,15 @@ repositories {
dependencies {
api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
api(name: 'agr-sdk-core-release-1.7.0', ext: 'aar')
api(name: 'agr-sdk-coreui-release-1.7.0', ext: 'aar')
// api(name: 'agr-sdk-core-release-1.7.0', ext: 'aar')
// api(name: 'agr-sdk-coreui-release-1.7.0', ext: 'aar')
// api(name: 'agr-sdk-mobi-uz-release-1.0.0', ext: 'aar')
api(name: 'agr-sdk-pgw-core-release-1.7.0', ext: 'aar')
implementation "uz.agr.sdk:agr-sdk-core:1.7.1-alpha-1"
implementation "uz.agr.sdk:agr-sdk-coreui:1.7.0"
implementation "uz.agr.sdk:agr-sdk-mobi-uz:1.0.0"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
......@@ -123,15 +128,9 @@ dependencies {
// SDK libs
// ### Cicerone Navigation ###
implementation "ru.terrakok.cicerone:cicerone:5.1.0"
implementation 'com.android.support:multidex:1.0.3'
// ### SearchView ###
implementation 'com.github.Ferfalk:SimpleSearchView:0.1.6'
// ### DI ###
implementation "com.github.stephanenicolas.toothpick:toothpick-runtime:3.1.0"
kapt("com.github.stephanenicolas.toothpick:toothpick-compiler:3.1.0")
implementation "ru.tinkoff.scrollingpagerindicator:scrollingpagerindicator:1.2.0"
......@@ -140,22 +139,8 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.1'
// ### MVP Moxy ###
kapt("com.github.moxy-community:moxy-compiler:$moxyVersion")
implementation "com.github.moxy-community:moxy:$moxyVersion"
implementation "com.github.moxy-community:moxy-androidx:$moxyVersion"
implementation "com.google.code.gson:gson:2.8.6"
// ### Cicerone Navigation ###
implementation "ru.terrakok.cicerone:cicerone:5.1.0"
// ### DI ###
implementation "com.github.stephanenicolas.toothpick:toothpick-runtime:$toothpickVersion"
kapt("com.github.stephanenicolas.toothpick:toothpick-compiler:$toothpickVersion")
// ### Moshi ###
implementation 'com.squareup.moshi:moshi:1.12.0'
kapt('com.squareup.moshi:moshi-kotlin-codegen:1.12.0')
// ### Retrofit ###
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
......@@ -193,14 +178,6 @@ dependencies {
api 'com.airbnb.android:lottie:3.5.0'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
// ### View Pager Dots ###
implementation 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:2.0.24'
implementation "ru.tinkoff.scrollingpagerindicator:scrollingpagerindicator:1.2.0"
implementation "com.aurelhubert:ahbottomnavigation:2.3.4"
implementation 'com.justkiddingbaby:vercodeedittext:1.1.0'
// volley http library
implementation 'com.android.volley:volley:1.2.0'
// ### SMS ###
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
......@@ -212,28 +189,13 @@ dependencies {
// ### Logging ###
implementation "com.jakewharton.timber:timber:$timber_version"
// ### MVP Moxy ###
kapt("com.github.moxy-community:moxy-compiler:$moxy_version")
implementation "com.github.moxy-community:moxy:$moxy_version"
implementation "com.github.moxy-community:moxy-androidx:$moxy_version"
// ### Cicerone Navigation ###
implementation "ru.terrakok.cicerone:cicerone:5.1.0"
// ### DI ###
implementation "com.github.stephanenicolas.toothpick:toothpick-runtime:$toothpick_version"
kapt("com.github.stephanenicolas.toothpick:toothpick-compiler:$toothpick_version")
// ### Network ###
implementation "com.squareup.moshi:moshi:1.11.0"
kapt("com.squareup.moshi:moshi-kotlin-codegen:1.11.0")
implementation 'com.facebook.stetho:stetho:1.5.1'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1'
// ### RxJava ### noinspection GradleDependency
implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.1'
// ### Image load and cache ### noinspection GradleDependency
implementation "com.github.bumptech.glide:glide:$glide_version"
......@@ -319,3 +281,13 @@ dependencies {
implementation 'com.facebook.shimmer:shimmer:0.5.0'
}
repositories {
maven {
url "http://185.74.5.122:8081/artifactory/agr-libs"
allowInsecureProtocol = true
credentials {
username = "${artifactory_username}"
password = "${artifactory_password}"
}
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import dagger.hilt.android.AndroidEntryPoint
import uz.agr.sdk.pgw_core.mobi.MobiUz
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.mobiuz.mobiservice.dev.databinding.ActivityLanguageBinding
import uz.mobiuz.mobiservice.dev.model.SharedPref
import uz.mobiuz.mobiservice.dev.ui.auth.AuthActivity
......@@ -43,7 +43,7 @@ class LanguageActivity : AppCompatActivity() {
private fun setLangAndNavigate(lang: String) {
pref.language = lang
MobiUz.setLanguage(this, lang)
AGRBilling.setLanguage(this, lang)
startActivity(Intent(this, AuthActivity::class.java))
finish()
}
......
......@@ -4,16 +4,14 @@ import android.content.Context
import androidx.multidex.MultiDex
import androidx.multidex.MultiDexApplication
import dagger.hilt.android.HiltAndroidApp
import ru.terrakok.cicerone.Router
import timber.log.Timber
import toothpick.Toothpick
import toothpick.configuration.Configuration
import uz.agr.sdk.core.di.DI
import uz.agr.sdk.core.di.module.CoreServerModule
import uz.agr.sdk.core.model.system.LocaleManager
import uz.agr.sdk.coreui.di.FlowNavigationModule
import uz.agr.sdk.coreui.di.ServerModule
import uz.agr.sdk.pgw_core.mobi.MobiUz
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.mobiuz.mobiservice.dev.BuildConfig
import uz.mobiuz.mobiservice.dev.utils.LocaleHelper
......@@ -26,7 +24,7 @@ class App : MultiDexApplication() {
initToothpick()
// initAppScope()
initLogger()
MobiUz.init(this)
AGRBilling.init(this)
}
override fun attachBaseContext(base: Context) {
......
......@@ -2,17 +2,18 @@ package uz.mobiuz.mobiservice.dev.network.repository
import android.content.Context
import com.google.gson.Gson
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.mobiuz.mobiservice.dev.model.SharedPref
import uz.mobiuz.mobiservice.dev.model.database.MonitoringDao
import uz.mobiuz.mobiservice.dev.network.api.ApiService
import uz.mobiuz.mobiservice.dev.network.model.Customer
import uz.mobiuz.mobiservice.dev.network.model.Roaming
import uz.mobiuz.mobiservice.dev.network.model.UiStateObject
import uz.mobiuz.mobiservice.dev.utils.extensions.getMessage
import uz.mobiuz.mobiservice.dev.utils.extensions.userMessage
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import uz.agr.sdk.pgw_core.mobi.MobiUz
import javax.inject.Inject
import javax.inject.Singleton
......@@ -20,13 +21,14 @@ import javax.inject.Singleton
class MainRepository @Inject constructor(
private val apiService: ApiService,
private val pref: SharedPref,
private val dao: MonitoringDao,
@ApplicationContext val context: Context
){
) {
suspend fun mainIndex(): UiStateObject<Customer> {
return try {
withContext(Dispatchers.IO){
withContext(Dispatchers.IO) {
val res = apiService.mainIndex()
withContext(Dispatchers.Main){
withContext(Dispatchers.Main) {
when {
res.status && res.data != null -> {
UiStateObject.SUCCESS(res.data!!)
......@@ -43,10 +45,11 @@ class MainRepository @Inject constructor(
suspend fun logOut() {
try {
withContext(Dispatchers.IO){
MobiUz.deleteAllCards()
withContext(Dispatchers.IO) {
AGRBilling.deleteAllCards()
// todo monitoring ni delete qilish kerak
apiService.logOut()
dao.deleteAllMonitoring()
}
} catch (e: Exception) {
e.printStackTrace()
......@@ -55,9 +58,9 @@ class MainRepository @Inject constructor(
suspend fun services(): UiStateObject<String> {
return try {
withContext(Dispatchers.IO){
withContext(Dispatchers.IO) {
val res = apiService.getServices()
withContext(Dispatchers.Main){
withContext(Dispatchers.Main) {
when {
res.status -> {
pref.services = Gson().toJson(res.data)
......@@ -72,11 +75,12 @@ class MainRepository @Inject constructor(
UiStateObject.ERROR(e.userMessage(context))
}
}
suspend fun mainRoaming(): UiStateObject<Roaming> {
return try {
withContext(Dispatchers.IO){
withContext(Dispatchers.IO) {
val res = apiService.mainRoaming()
withContext(Dispatchers.Main){
withContext(Dispatchers.Main) {
when {
res.status -> {
UiStateObject.SUCCESS(res.data!!)
......@@ -92,5 +96,4 @@ class MainRepository @Inject constructor(
}
}
\ No newline at end of file
package uz.mobiuz.mobiservice.dev.ui.auth
import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import uz.mobiuz.mobiservice.dev.model.UserAuth
import uz.mobiuz.mobiservice.dev.network.model.Action
import uz.mobiuz.mobiservice.dev.network.model.ChangePassword
import uz.mobiuz.mobiservice.dev.network.model.UiStateObject
import uz.mobiuz.mobiservice.dev.network.repository.AuthRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.launch
import uz.agr.sdk.core.entity.card.CardInfo
import uz.agr.sdk.core.entity.card.CardRegistration
import uz.agr.sdk.pgw_core.VendorPaySuccessListener
import uz.agr.sdk.pgw_core.VendorReSendCodeListener
import uz.agr.sdk.pgw_core.mobi.BaseListener
import uz.agr.sdk.pgw_core.mobi.MobiUz
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.agr.sdk.mobi_uz.BaseListener
import uz.agr.sdk.mobi_uz.VendorPaySuccessListener
import uz.agr.sdk.mobi_uz.VendorReSendCodeListener
import uz.mobiuz.mobiservice.dev.model.UserAuth
import uz.mobiuz.mobiservice.dev.network.model.Action
import uz.mobiuz.mobiservice.dev.network.model.ChangePassword
import uz.mobiuz.mobiservice.dev.network.model.UiStateObject
import uz.mobiuz.mobiservice.dev.network.repository.AuthRepository
import javax.inject.Inject
@HiltViewModel
......@@ -110,9 +111,10 @@ class AuthViewModel @Inject constructor(
fun cardConfirm(cardId: String, code: String) = viewModelScope.launch {
_cardConfirmUiState.emit(UiStateObject.LOADING)
MobiUz.cardConfirmSms(cardId, code, object : BaseListener<CardInfo> {
AGRBilling.cardConfirmSms(cardId, code, object : BaseListener<CardInfo> {
override fun error(message: String) {
viewModelScope.launch {
Log.e("AAA", "error: $message")
_cardConfirmUiState.emit(UiStateObject.ERROR(message))
}
}
......@@ -121,6 +123,7 @@ class AuthViewModel @Inject constructor(
override fun success(data: CardInfo) {
viewModelScope.launch {
Log.e("AAA", "success: $data")
_cardConfirmUiState.emit(UiStateObject.SUCCESS(data))
}
}
......@@ -132,7 +135,7 @@ class AuthViewModel @Inject constructor(
fun resendSms(phoneNumber: String, cardNumber: String, cardExpire: String) = viewModelScope.launch {
_resendSmsUiState.emit(UiStateObject.LOADING)
MobiUz.registerCardResendSms(phoneNumber, cardNumber, cardExpire,object : BaseListener<CardRegistration> {
AGRBilling.registerCardResendSms(phoneNumber, cardNumber, cardExpire, object : BaseListener<CardRegistration> {
override fun error(message: String) {
viewModelScope.launch {
_resendSmsUiState.emit(UiStateObject.ERROR(message))
......@@ -154,7 +157,7 @@ class AuthViewModel @Inject constructor(
fun vendorResendSms(transactionId: Long) = viewModelScope.launch {
_vendorResendSmsUiState.emit(UiStateObject.LOADING)
MobiUz.vendorReSendSmsCode(transactionId, object : VendorReSendCodeListener {
AGRBilling.vendorReSendSmsCode(transactionId, object : VendorReSendCodeListener {
override fun showError(message: String) {
viewModelScope.launch {
......@@ -173,13 +176,12 @@ class AuthViewModel @Inject constructor(
}
private val _vendorUiState = MutableSharedFlow<UiStateObject<String>>()
val vendorUiState: SharedFlow<UiStateObject<String>> = _vendorUiState
fun vendor(code: String, transactionId: Long) = viewModelScope.launch {
_vendorUiState.emit(UiStateObject.LOADING)
MobiUz.vendorPay(code, transactionId, object : VendorPaySuccessListener {
AGRBilling.vendorPay(code, transactionId, object : VendorPaySuccessListener {
override fun exit() {
viewModelScope.launch {
_vendorUiState.emit(UiStateObject.ERROR("exit"))
......
......@@ -19,6 +19,7 @@ import androidx.navigation.fragment.NavHostFragment
import com.google.android.gms.auth.api.phone.SmsRetriever
import com.google.android.material.textfield.TextInputEditText
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.android.synthetic.main.fragment_card_confirm.*
import kotlinx.coroutines.flow.collect
import uz.agr.sdk.coreui.extension.hideSoftInput
import uz.mobiuz.mobiservice.dev.R
......@@ -145,7 +146,7 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
sentCodeAgain.setOnClickListener {
when (type) {
CONSTANTS.TYPE_ADD_CARD -> {
viewModel.resendSms("998917797278", cardNumber, cardExpire)
viewModel.resendSms("998949125150", cardNumber, cardExpire)
}
CONSTANTS.TYPE_ANOTHER_CARD -> {
viewModel.vendorResendSms(transactionId)
......@@ -161,7 +162,7 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
}
private fun setVerificationCode(code: String) {
if (verificationCode.length == 6) {
if (code.length == 6) {
bn.apply {
pin1.setText(verificationCode[0].toString())
pin2.setText(verificationCode[1].toString())
......@@ -339,6 +340,7 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
when (it) {
is UiStateObject.SUCCESS -> {
showProgressDialog(false)
customLog("UiStateObject.SUCCESS")
showSuccessDialog()
}
is UiStateObject.ERROR -> {
......@@ -431,6 +433,7 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
customLog("onActivityResult:")
activity?.hideSoftInput(bn.pinView)
if (requestCode == 200) {
if (resultCode == Activity.RESULT_OK && data != null) { //That gives all message to us.
......@@ -445,27 +448,23 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
private fun getOtpFromMessage(message: String) { // This will match any 6 digit number in the message
val matcher = Pattern.compile("(|^)\\d{6}").matcher(message)
if (matcher.find()) {
customLog("verification code:${matcher.group(0)} ")
setVerificationCode(matcher.group(0))
// etConfirmCode.setText(matcher.group(0))
}
}
private fun showSuccessDialog() {
val dialog = MessageDialog(
requireContext(),
getString(R.string.agr_mobi_uz_card_added),
getString(R.string.agr_mobi_uz_close_process)
)
dialog.window!!.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
dialog.window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
dialog.setCanceledOnTouchOutside(true)
dialog.setOnOkClickListener(object : MessageDialog.OnClickListener {
override fun dialogPositiveClicked() {
dialog.dismiss()
try {
showCustomDialog(getString(R.string.agr_mobi_uz_card_added),true){
navController.popBackStack(R.id.cardsListFragment, false)
}
})
dialog.show()
//
}catch (e:Exception){
navController.popBackStack(R.id.cardsListFragment, false)
customLog(e.localizedMessage)
}
}
private fun startSmsUserConsent() {
......@@ -477,7 +476,7 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
private fun registerBroadcastReceiver() {
smsBroadcastReceiver = SmsBroadcastReceiver()
smsBroadcastReceiver!!.smsBroadcastReceiverListener =
smsBroadcastReceiver?.smsBroadcastReceiverListener =
object : SmsBroadcastReceiver.SmsBroadcastReceiverListener {
override fun onSuccess(intent: Intent?) {
startActivityForResult(intent, 200)
......@@ -486,11 +485,11 @@ class VerificationFragment : BaseFragment(R.layout.fragment_verification) {
override fun onFailure() {}
}
val intentFilter = IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION)
requireActivity().registerReceiver(smsBroadcastReceiver, intentFilter)
context?.registerReceiver(smsBroadcastReceiver, intentFilter)
}
override fun onDestroy() {
requireActivity().unregisterReceiver(smsBroadcastReceiver)
context?.unregisterReceiver(smsBroadcastReceiver)
_bn = null
super.onDestroy()
}
......
......@@ -6,12 +6,14 @@ import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.fragment.app.Fragment
import uz.agr.sdk.coreui.extension.hideSoftInput
import uz.mobiuz.mobiservice.dev.ui.global.ProgressDialog
abstract class BaseFragment(private val layoutId: Int) : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
requireActivity().hideSoftInput()
return inflater.inflate(layoutId, container, false)
}
......
......@@ -13,7 +13,8 @@ object CONSTANTS {
const val CARD_NUMBER = "CARD_NUMBER"
const val CARD_EXPIRE = "CARD_EXPIRE"
const val UNAUTHORIZED = "UNAUTHORIZED"
const val BASE_URL = "https://mobileapp.mobi.uz/api/v1/"
const val BASE_URL = "http://10.160.41.12:82/"
// const val BASE_URL = "https://mobileapp.mobi.uz/"
//languages
const val RU = "ru"
......@@ -29,24 +30,24 @@ object CONSTANTS {
const val TERMS_OF_USE = "Terms of Use"
const val PRIVACY_POLICY = "Privacy Policy"
const val LICENSE_UZ = "https://mobileapp.mobi.uz/uploads/licenses/license_uz.html"
const val LICENSE_RU = "https://mobileapp.mobi.uz/uploads/licenses/license_ru.html"
const val LICENSE_EN = "https://mobileapp.mobi.uz/uploads/licenses/license_en.html"
const val LICENSE_UZ = "${BASE_URL}uploads/licenses/license_uz.html"
const val LICENSE_RU = "${BASE_URL}uploads/licenses/license_ru.html"
const val LICENSE_EN = "${BASE_URL}uploads/licenses/license_en.html"
const val PRIVACY_POLICY_UZ = "https://mobileapp.mobi.uz/uploads/privacy/privacy_policy_uz.html"
const val PRIVACY_POLICY_RU = "https://mobileapp.mobi.uz/uploads/privacy/privacy_policy_ru.html"
const val PRIVACY_POLICY_EN = "https://mobileapp.mobi.uz/uploads/privacy/privacy_policy_en.html"
const val PRIVACY_POLICY_UZ = "${BASE_URL}uploads/privacy/privacy_policy_uz.html"
const val PRIVACY_POLICY_RU = "${BASE_URL}uploads/privacy/privacy_policy_ru.html"
const val PRIVACY_POLICY_EN = "${BASE_URL}uploads/privacy/privacy_policy_en.html"
const val PAYSYS_LICENSE_UZ = "https://mobileapp.mobi.uz/uploads/paysys/license_uz.html"
const val PAYSYS_LICENSE_RU = "https://mobileapp.mobi.uz/uploads/paysys/license_ru.html"
const val PAYSYS_LICENSE_EN = "https://mobileapp.mobi.uz/uploads/paysys/license_en.html"
const val PAYSYS_LICENSE_UZ = "${BASE_URL}uploads/paysys/license_uz.html"
const val PAYSYS_LICENSE_RU = "${BASE_URL}uploads/paysys/license_ru.html"
const val PAYSYS_LICENSE_EN = "${BASE_URL}uploads/paysys/license_en.html"
const val PHONE1 = "0890"
const val PHONE2 = "+998 97 130 09 09"
const val PHONE3 = "+998 97 203 10 10"
const val DEFAULT_PHONE = "+998 97 999-99-99"
const val RESEND_CODE_TIME = 60000L
const val BLOCKED_TIME = 6000
const val BLOCKED_TIME = 600
const val PHONE = "phone"
......@@ -90,20 +91,20 @@ object CONSTANTS {
//urls
const val API_LOGIN = "customer/login"
const val API_REGISTER = "customer/register"
const val API_CHECK_PHONE = "customer/check-phone"
const val API_CHECK_SMS_CODE = "customer/check-sms-code"
const val API_MAIN_INDEX = "main/index"
const val API_FORGET_PASSWORD = "customer/forget-password"
const val API_CHECK_RESET_CODE = "customer/check-reset-code"
const val API_RESET_PASSWORD = "customer/reset-password"
const val API_LOG_OUT = "customer/log-out"
const val API_SEND_SMS_CODE = "customer/send-sms-code"
const val API_CHECK_PASSWORD = "customer/check-password"
const val API_CHANGE_PASSWORD = "customer/change-password"
const val API_SERVICE_INDEX = "service/index"
const val API_MAIN_ROAMING = "main/roaming"
const val API_LOGIN = "api/v1/customer/login"
const val API_REGISTER = "api/v1/customer/register"
const val API_CHECK_PHONE = "api/v1/customer/check-phone"
const val API_CHECK_SMS_CODE = "api/v1/customer/check-sms-code"
const val API_MAIN_INDEX = "api/v1/main/index"
const val API_FORGET_PASSWORD = "api/v1/customer/forget-password"
const val API_CHECK_RESET_CODE = "api/v1/customer/check-reset-code"
const val API_RESET_PASSWORD = "api/v1/customer/reset-password"
const val API_LOG_OUT = "api/v1/customer/log-out"
const val API_SEND_SMS_CODE = "api/v1/customer/send-sms-code"
const val API_CHECK_PASSWORD = "api/v1/customer/check-password"
const val API_CHANGE_PASSWORD = "api/v1/customer/change-password"
const val API_SERVICE_INDEX = "api/v1/service/index"
const val API_MAIN_ROAMING = "api/v1/main/roaming"
//payment
......
......@@ -52,13 +52,6 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) {
private lateinit var changedParam: FrameLayout.LayoutParams
private val navController: NavController by lazy(LazyThreadSafetyMode.NONE) { NavHostFragment.findNavController(this) }
companion object{
private var listener: SingleBlock<Unit>? = null
fun setOnPaymentClickListener(block: SingleBlock<Unit>){
listener = block
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
viewModel.mainIndex()
......@@ -95,7 +88,6 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) {
slider.getChildAt(0).overScrollMode = RecyclerView.OVER_SCROLL_NEVER
btnAddSum.setOnClickListener {
pref.isShowPin = false
if (checkInternet()) {
navController.navigate(R.id.billingFragment)
}
......
......@@ -18,8 +18,8 @@ import uz.agr.sdk.coreui.extension.showSoftInput
import uz.agr.sdk.coreui.ui.ButtonClick
import uz.agr.sdk.coreui.ui.form.CardDateExpireFormat
import uz.agr.sdk.coreui.ui.form.CardNumberFormat
import uz.agr.sdk.pgw_core.mobi.CardListenerMobi
import uz.agr.sdk.pgw_core.mobi.MobiUz
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.agr.sdk.mobi_uz.CardListener
import uz.mobiuz.mobiservice.dev.R
import uz.mobiuz.mobiservice.dev.databinding.FragmentAddCardBinding
import uz.mobiuz.mobiservice.dev.model.SharedPref
......@@ -65,9 +65,7 @@ class AddCardFragment : BaseFragment(R.layout.fragment_add_card) {
btnContinue.setOnClickListener(object : ButtonClick() {
override fun onSingleClick(v: View?) {
if (cardNumberValid != null && cardExpiryValid != null) {
// viewModel.cardRegistration(pref.userPhone.filter { it.isDigit() }, cardNumberValid!!, cardExpiryValid!!)
MobiUz.getAllCards(object : CardListenerMobi<CardInfo> {
AGRBilling.getAllCards(object : CardListener<CardInfo> {
override fun error(message: String) {}
override fun loading(boolean: Boolean) {
showProgressDialog(boolean)
......@@ -75,11 +73,11 @@ class AddCardFragment : BaseFragment(R.layout.fragment_add_card) {
override fun local(localData: List<CardInfo>) {}
override fun server(serverData: List<CardInfo>) {
val hash = MobiUz.getHash(cardNumberValid!!, cardExpiryValid!!)
val hash = AGRBilling.getHash(cardNumberValid!!, cardExpiryValid!!)
val filteredCards = serverData.filter { it.cardHash == hash }
if (filteredCards.isEmpty()) {
viewModel.cardRegistration("998917797278", cardNumberValid!!, cardExpiryValid!!)
viewModel.cardRegistration(pref.userPhone.filter { it.isDigit() }, cardNumberValid!!, cardExpiryValid!!)
} else {
showToastMessage(getString(R.string.agr_mobi_uz_card_exist))
}
......
......@@ -8,9 +8,9 @@ import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.launch
import uz.agr.sdk.core.entity.card.CardInfo
import uz.agr.sdk.core.entity.card.CardRegistration
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.agr.sdk.mobi_uz.BaseListener
import uz.agr.sdk.mobi_uz.CardListener
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.mobiuz.mobiservice.dev.network.model.UiStateList
import uz.mobiuz.mobiservice.dev.network.model.UiStateObject
import uz.mobiuz.mobiservice.dev.network.repository.MainRepository
......@@ -26,7 +26,7 @@ class CardViewModel @Inject constructor(
fun getAllCards() = viewModelScope.launch {
_cardListUiState.emit(UiStateList.LOADING)
MobiUz.getAllCards(object : CardListenerMobi<CardInfo> {
AGRBilling.getAllCards(object : CardListener<CardInfo> {
override fun error(message: String) {
viewModelScope.launch {
_cardListUiState.emit(UiStateList.ERROR(message))
......@@ -54,7 +54,7 @@ class CardViewModel @Inject constructor(
fun cardRegistration(phone: String, card: String, expire: String) = viewModelScope.launch {
_cardRegistrationUiState.emit(UiStateObject.LOADING)
MobiUz.registerCard(phone, card, expire, object : BaseListener<CardRegistration> {
AGRBilling.registerCard(phone, card, expire, object : BaseListener<CardRegistration> {
override fun error(message: String) {
viewModelScope.launch {
_cardRegistrationUiState.emit(UiStateObject.ERROR(message))
......@@ -76,7 +76,7 @@ class CardViewModel @Inject constructor(
fun cardConfirm(cardId: String, code: String) = viewModelScope.launch {
_cardConfirmUiState.emit(UiStateObject.LOADING)
MobiUz.cardConfirmSms(cardId, code, object : BaseListener<CardInfo> {
AGRBilling.cardConfirmSms(cardId, code, object : BaseListener<CardInfo> {
override fun error(message: String) {
viewModelScope.launch {
_cardConfirmUiState.emit(UiStateObject.ERROR(message))
......@@ -98,7 +98,7 @@ class CardViewModel @Inject constructor(
fun resendSms(phoneNumber: String, cardNumber: String, cardExpire: String) = viewModelScope.launch {
_resendSmsUiState.emit(UiStateObject.LOADING)
MobiUz.registerCardResendSms(phoneNumber, cardNumber, cardExpire,object : BaseListener<CardRegistration> {
AGRBilling.registerCardResendSms(phoneNumber, cardNumber, cardExpire,object : BaseListener<CardRegistration> {
override fun error(message: String) {
viewModelScope.launch {
_resendSmsUiState.emit(UiStateObject.ERROR(message))
......
......@@ -30,6 +30,9 @@ class CardsListAdapter(
items.clear()
items.addAll(cardsList)
items.addAll(cardsList)
items.addAll(cardsList)
items.addAll(cardsList)
if (progress) items.add(ProgressItem())
//yes, on main thread...
......
......@@ -15,11 +15,10 @@ import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.collect
import uz.agr.sdk.core.entity.card.CardInfo
import uz.agr.sdk.coreui.extension.formattedCardNumber
import uz.agr.sdk.coreui.extension.visible
import uz.agr.sdk.coreui.ui.decoration.EndOffsetItemDecoration
import uz.agr.sdk.coreui.ui.decoration.StartOffsetItemDecoration
import uz.agr.sdk.pgw_core.mobi.BaseListener
import uz.agr.sdk.pgw_core.mobi.MobiUz
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.agr.sdk.mobi_uz.BaseListener
import uz.mobiuz.mobiservice.dev.R
import uz.mobiuz.mobiservice.dev.databinding.FragmentCardsListBinding
import uz.mobiuz.mobiservice.dev.model.SharedPref
......@@ -74,7 +73,6 @@ class CardsListFragment : BaseFragment(R.layout.fragment_cards_list) {
}
btnAddCard.setOnClickListener {
// addCard()
navController.navigate(R.id.addCardFragment)
}
......@@ -82,7 +80,6 @@ class CardsListFragment : BaseFragment(R.layout.fragment_cards_list) {
layoutManager = LinearLayoutManager(context)
setHasFixedSize(true)
adapter = this@CardsListFragment.adapter
visible(false)
}
recyclerView.addItemDecoration(
StartOffsetItemDecoration(
......@@ -99,27 +96,27 @@ class CardsListFragment : BaseFragment(R.layout.fragment_cards_list) {
)
)
swipeToRefresh.setColorSchemeResources(
R.color.agr_black,
R.color.primary100
)
swipeToRefresh.setOnRefreshListener {
MobiUz.refreshCardsInfo(object : BaseListener<List<CardInfo>> {
override fun error(message: String) {
swipeToRefresh.isRefreshing = false
showToastMessage(message)
}
override fun loading(boolean: Boolean) {
swipeToRefresh.isRefreshing = boolean
}
override fun success(data: List<CardInfo>) {
swipeToRefresh.isRefreshing = false
setData(data)
}
})
}
// swipeToRefresh.setColorSchemeResources(
// R.color.agr_black,
// R.color.primary100
// )
// swipeToRefresh.setOnRefreshListener {
// MobiUz.refreshCardsInfo(object : BaseListener<List<CardInfo>> {
// override fun error(message: String) {
// swipeToRefresh.isRefreshing = false
// showToastMessage(message)
// }
//
// override fun loading(boolean: Boolean) {
// swipeToRefresh.isRefreshing = boolean
// }
//
// override fun success(data: List<CardInfo>) {
// swipeToRefresh.isRefreshing = false
// setData(data)
// }
// })
// }
}
......@@ -139,10 +136,8 @@ class CardsListFragment : BaseFragment(R.layout.fragment_cards_list) {
dialog.dismiss()
}
dialog.setOnOkClickListener {
MobiUz.deleteCard(selectedCard!!, object : BaseListener<Boolean> {
override fun error(message: String) {
}
AGRBilling.deleteCard(selectedCard!!, object : BaseListener<Boolean> {
override fun error(message: String) {}
override fun loading(boolean: Boolean) {
// showProgressDialog(boolean)
......@@ -157,88 +152,12 @@ class CardsListFragment : BaseFragment(R.layout.fragment_cards_list) {
dialog.show()
}
// private fun hasCards() {
// MobiUz.hasCards(object : BaseListener<Boolean> {
// override fun error(message: String) {
//
// }
//
// override fun loading(boolean: Boolean) {
//
// }
//
// override fun success(data: Boolean) {
// getAllCards()
// }
// })
// }
//
// private fun getAllCards() {
// MobiUz.getAllCards(object : CardListenerMobi<CardInfo> {
// override fun error(message: String) {
//
// }
//
// override fun loading(boolean: Boolean) {
//
// }
//
// override fun local(localData: List<CardInfo>) {
// setData(localData)
// }
//
// override fun server(serverData: List<CardInfo>) {
// setData(serverData)
// }
// })
// }
private fun setData(data: List<CardInfo>) {
bn.recyclerView.isVisible = data.isNotEmpty()
bn.layoutEmpty.root.isVisible = data.isEmpty()
adapter.setData(data)
}
// private fun addCard() {
// MobiUz.registerCard("998917797278", "8600312917291250", "0325", object : BaseListener<CardRegistration> {
// override fun error(message: String) {
// Log.e("TTT", "error:$message")
// }
//
// override fun loading(boolean: Boolean) {
// Log.e("TTT", "loading:$boolean")
// }
//
// override fun success(data: CardRegistration) {
// Log.e("TTT", "success:${data.maskedPhoneNumber}")
// }
// })
// }
//
// private fun cardConfirm(cardId: String, code: String) {
// MobiUz.cardConfirmSms(cardId, code, object : BaseListener<CardInfo> {
// override fun error(message: String) {
//
// }
//
// override fun loading(boolean: Boolean) {
//
// }
//
// override fun success(data: CardInfo) {
//
// }
// })
//
//
// }
//
// private fun delete(card: CardInfo) {
// MobiUz.deleteCard(card)
// }
override fun collects() {
viewLifecycleOwner.lifecycleScope.launchWhenStarted {
viewModel.cardListUiState.collect {
......
......@@ -19,14 +19,12 @@ class MonitoringAdapter : ListDelegationAdapter<MutableList<Any>>() {
items = mutableListOf()
delegatesManager.addDelegate(HistoryHeaderDelegate())
delegatesManager.addDelegate(MonitoringDelegate())
delegatesManager.addDelegate(ProgressAdapterDelegate())
}
fun isHeaderItem(position: Int): Boolean = items[position] is Tuple2
fun setData(historyList: List<Monitoring>) {
val oldData = items.toList()
val progress = isProgress()
items.clear()
var summa: Long = 0
......@@ -60,8 +58,6 @@ class MonitoringAdapter : ListDelegationAdapter<MutableList<Any>>() {
}
items.add(item)
}
if (progress) items.add(ProgressItem())
//yes, on main thread...
DiffUtil
.calculateDiff(DiffCallback(items, oldData), false)
......@@ -73,7 +69,6 @@ class MonitoringAdapter : ListDelegationAdapter<MutableList<Any>>() {
val currentProgress = isProgress()
if (isVisible && !currentProgress) {
items.add(ProgressItem())
notifyItemInserted(items.lastIndex)
} else if (!isVisible && currentProgress) {
items.remove(items.last())
......
......@@ -2,6 +2,7 @@ package uz.mobiuz.mobiservice.dev.ui.sdk.history
import android.os.Bundle
import android.view.View
import androidx.core.view.isVisible
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import androidx.navigation.NavController
......@@ -30,6 +31,11 @@ class MonitoringLocalFragment : BaseFragment(R.layout.fragment_monitoring_local)
private val adapter: MonitoringAdapter by lazy { MonitoringAdapter() }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
loadData()
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
_bn = FragmentMonitoringLocalBinding.bind(view)
......@@ -43,6 +49,10 @@ class MonitoringLocalFragment : BaseFragment(R.layout.fragment_monitoring_local)
toolbar.setNavigationOnClickListener {
navController.navigateUp()
}
swipeToRefresh.setOnRefreshListener {
loadData()
swipeToRefresh.isRefreshing = false
}
recyclerView.apply {
layoutManager = LinearLayoutManager(context)
setHasFixedSize(true)
......@@ -57,15 +67,20 @@ class MonitoringLocalFragment : BaseFragment(R.layout.fragment_monitoring_local)
}
override fun collects() {
private fun loadData() {
lifecycleScope.launchWhenStarted {
viewModel.getAllMonitoring().collect {
bn.recyclerView.isVisible = it.isNotEmpty()
bn.layoutEmpty.root.isVisible = it.isEmpty()
adapter.setData(it)
}
}
}
override fun collects() {}
override fun onDestroy() {
_bn = null
super.onDestroy()
......
......@@ -13,8 +13,8 @@ import dagger.hilt.android.AndroidEntryPoint
import uz.agr.sdk.core.entity.card.CardInfo
import uz.agr.sdk.coreui.extension.formattedMoney
import uz.agr.sdk.coreui.extension.showSnackMessage
import uz.agr.sdk.pgw_core.mobi.BaseListener
import uz.agr.sdk.pgw_core.mobi.MobiUz
import uz.agr.sdk.mobi_uz.BaseListener
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.mobiuz.mobiservice.dev.R
import uz.mobiuz.mobiservice.dev.databinding.FragmentPaymentSuccessfulBinding
import uz.mobiuz.mobiservice.dev.model.Monitoring
......@@ -106,7 +106,7 @@ class PaymentSuccessfulFragment : BaseFragment(R.layout.fragment_payment_success
}
private fun deleteCard(cardNumber: String, cardExpiry: String) {
MobiUz.getLocalCards(object : BaseListener<List<CardInfo>> {
AGRBilling.getLocalCards(object : BaseListener<List<CardInfo>> {
override fun error(message: String) {}
override fun loading(boolean: Boolean) {}
override fun success(data: List<CardInfo>) {
......@@ -118,7 +118,7 @@ class PaymentSuccessfulFragment : BaseFragment(R.layout.fragment_payment_success
cardNumber.replace(" ", "").substring(cardNumber.length - 4, cardNumber.length)
}
if (card != null) {
MobiUz.deleteCard(card, object : BaseListener<Boolean> {
AGRBilling.deleteCard(card, object : BaseListener<Boolean> {
override fun error(message: String) {
message
}
......
......@@ -23,10 +23,10 @@ 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.agr.sdk.mobi_uz.BaseListener
import uz.agr.sdk.mobi_uz.CardListener
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.agr.sdk.mobi_uz.VendorPayConfirm
import uz.mobiuz.mobiservice.dev.R
import uz.mobiuz.mobiservice.dev.databinding.FragmentReplenishBalanceBinding
import uz.mobiuz.mobiservice.dev.model.Monitoring
......@@ -172,18 +172,15 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
private fun getAllCards() {
Timber.d("getAllCards")
MobiUz.getAllCards(object : CardListenerMobi<CardInfo> {
AGRBilling.getAllCards(object : CardListener<CardInfo> {
override fun error(message: String) {
Timber.e("error: $message")
}
override fun loading(boolean: Boolean) {
Timber.e("progress: $boolean")
showProgressDialog(boolean)
// showProgressDialog(boolean)
}
override fun local(localData: List<CardInfo>) {
Timber.e("local: ${localData.size}")
setCardListAdapter(localData)
if (localData.isNotEmpty()) {
showSelectedCard(localData.first(), 0)
......@@ -191,7 +188,6 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
}
override fun server(serverData: List<CardInfo>) {
Timber.e("server: ${serverData.size}")
setCardListAdapter(serverData)
if (serverData.isNotEmpty()) {
showSelectedCard(serverData.first(), 0)
......@@ -224,9 +220,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
}
private fun isMobiUz(code: String): Boolean {
return true
// return code == "97" || code == "88"
// return code == "99"
return code == "97" || code == "88"
}
private fun pay() {
......@@ -258,7 +252,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
else vendorFormParams["clientid"] = newAccount
}
MobiUz.vendorFormCheck(vendorFormParams, object : BaseListener<Boolean> {
AGRBilling.vendorFormCheck(vendorFormParams, object : BaseListener<Boolean> {
override fun error(message: String) {
showSnackMessage(message)
}
......@@ -269,10 +263,10 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
override fun success(data: Boolean) {
if (payWithAnotherCard) payWithAnotherCard(
cardNumberValid, cardExpiryValid, btnSwitch.isChecked, /*pref.userPhone.filter { it.isDigit() }*/"998917797278",
cardNumberValid, cardExpiryValid, btnSwitch.isChecked, pref.userPhone.filter { it.isDigit() },
vendorFormParams
)
else vendorPay(selectedCard, /*pref.userPhone.filter { it.isDigit() }*/"998917797278", vendorFormParams)
else vendorPay(selectedCard, pref.userPhone.filter { it.isDigit() }, vendorFormParams)
}
})
}
......@@ -281,7 +275,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
private fun vendorPay(selectedCard: CardInfo?, phoneNumber: String, vendorFormParams: HashMap<String, String>) {
if (selectedCard != null) {
MobiUz.onClickPay(phoneNumber, selectedCard, vendorFormParams, requireContext(), object : VendorPayConfirm {
AGRBilling.onClickPay(phoneNumber, selectedCard, vendorFormParams, requireContext(), object : VendorPayConfirm {
override fun showConfirmPage(transactionId: Long, phoneNumber: String, timeOut: Int) {
val monitoring = Monitoring(
......@@ -330,7 +324,7 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
private fun payWithAnotherCard(cardNumber: String, cardExpiry: String, saveCard: Boolean, phone: String, vendorFormParams: HashMap<String, String>) {
MobiUz.vendorPayWithAnotherCard(cardNumber, cardExpiry, saveCard, phone, vendorFormParams, object : VendorPayConfirm {
AGRBilling.vendorPayWithAnotherCard(cardNumber, cardExpiry, saveCard, phone, vendorFormParams, object : VendorPayConfirm {
override fun showConfirmPage(transactionId: Long, phoneNumber: String, timeOut: Int) {
var isSave = false
val responsePhone = phoneNumber.replace("+", "")
......@@ -451,11 +445,11 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
etCardExpiry.requestFocus()
cardNumberValid = number
etCardNumber.setBackgroundResource(R.drawable.edit_text_unchecked)
etCardNumber.setTextColor(getColorCompat(R.color.black100))
// etCardNumber.setBackgroundResource(R.drawable.edit_text_unchecked)
// etCardNumber.setTextColor(getColorCompat(R.color.black100))
} else {
etCardNumber.setBackgroundResource(R.drawable.edit_text_error)
etCardNumber.setTextColor(getColorCompat(R.color.primary100))
// etCardNumber.setBackgroundResource(R.drawable.edit_text_error)
// etCardNumber.setTextColor(getColorCompat(R.color.primary100))
}
tvErrorMsg.isVisible = !valid
......@@ -487,11 +481,11 @@ class ReplenishBalanceFragment : BaseFragment(R.layout.fragment_replenish_balanc
etCardNumber.requestFocus()
} else activity?.hideSoftInput()
etCardExpiry.setBackgroundResource(R.drawable.edit_text_unchecked)
etCardExpiry.setTextColor(getColorCompat(R.color.black100))
// etCardExpiry.setBackgroundResource(R.drawable.edit_text_unchecked)
// etCardExpiry.setTextColor(getColorCompat(R.color.black100))
} else {
etCardExpiry.setBackgroundResource(R.drawable.edit_text_error)
etCardExpiry.setTextColor(getColorCompat(R.color.primary100))
// etCardExpiry.setBackgroundResource(R.drawable.edit_text_error)
// etCardExpiry.setTextColor(getColorCompat(R.color.primary100))
}
cardExpiryIsValid = checkValid
......
......@@ -7,7 +7,7 @@ import androidx.core.view.isVisible
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import dagger.hilt.android.AndroidEntryPoint
import uz.agr.sdk.pgw_core.mobi.MobiUz
import uz.agr.sdk.mobi_uz.AGRBilling
import uz.mobiuz.mobiservice.dev.MainActivity
import uz.mobiuz.mobiservice.dev.R
import uz.mobiuz.mobiservice.dev.databinding.FragmentLanguageBinding
......@@ -71,7 +71,7 @@ class LanguageFragment : BaseFragment(R.layout.fragment_language) {
private fun setLangAndNavigate(lang: String) {
pref.language = lang
MobiUz.setLanguage(requireContext(), lang)
AGRBilling.setLanguage(requireContext(), lang)
LocaleHelper.setLocale(requireContext())
val intent = Intent(requireContext(), MainActivity::class.java)
intent.putExtra(CONSTANTS.FIRST, CONSTANTS.FIRST)
......
......@@ -3,7 +3,7 @@
<item android:state_pressed="false">
<shape>
<corners android:radius="6dp" />
<stroke android:width="1dp" android:color="@color/grey30" android:dashWidth="1dp" android:dashGap="1dp" />
<stroke android:width="1dp" android:color="@color/grey30" android:dashWidth="2dp" android:dashGap="2dp" />
</shape>
</item>
......@@ -11,7 +11,7 @@
<shape>
<solid android:color="@color/fast_text_grey" />
<corners android:radius="6dp" />
<stroke android:width="1dp" android:color="@color/grey30" android:dashWidth="1dp" android:dashGap="1dp" />
<stroke android:width="1dp" android:color="@color/grey30" android:dashWidth="2dp" android:dashGap="2dp" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/grey20">
<item android:drawable="@drawable/button_grey_ripple" />
</ripple>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="180"
android:endColor="@color/grey15"
android:startColor="@color/grey15"
android:type="linear" />
<corners android:radius="6dp" />
</shape>
\ No newline at end of file
......@@ -18,48 +18,44 @@
app:navigationIcon="@drawable/ic_baseline_arrow_back"
app:title="@string/agr_mobi_uz_save_cards" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/agr_white">
android:layout_height="match_parent">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeToRefresh"
<include
layout="@layout/layout_empty"
android:id="@+id/layout_empty"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:paddingBottom="@dimen/_84sdp"
android:layout_height="match_parent"
android:visibility="visible" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never"
android:visibility="visible"
tools:listitem="@layout/mobi_uz_item_card"
tools:paddingTop="@dimen/agr_card_list_start_offset" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
tools:itemCount="3"
android:clipToPadding="false"
android:paddingBottom="@dimen/_84sdp"
android:visibility="gone"
tools:listitem="@layout/mobi_uz_item_card" />
<include
android:id="@+id/layout_empty"
layout="@layout/layout_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
</FrameLayout>
<Button
android:id="@+id/btnAddCard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:layout_marginTop="@dimen/_10sdp"
android:layout_marginBottom="72dp"
android:layout_marginTop="@dimen/_20sdp"
android:layout_marginBottom="32dp"
android:paddingHorizontal="16dp"
android:text="@string/agr_mobi_uz_add_card_plus"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
android:text="@string/agr_mobi_uz_add_card_plus" />
</FrameLayout>
</LinearLayout>
......@@ -17,12 +17,13 @@
android:scaleType="fitXY"
android:src="@drawable/bgn_home" />
<uz.mobiuz.mobiservice.dev.ui.home.HomeImageView
<ImageView
android:id="@+id/home_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/bgn_home" />
android:src="@drawable/bgn_home"
/>
</FrameLayout>
......@@ -412,34 +413,44 @@
</com.google.android.material.card.MaterialCardView>
<com.facebook.shimmer.ShimmerFrameLayout
android:layout_width="match_parent"
android:id="@+id/shimmer"
android:layout_marginTop="@dimen/_16sdp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_height="wrap_content">
android:layout_marginTop="@dimen/_16sdp">
<com.makeramen.roundedimageview.RoundedImageView
android:layout_width="match_parent"
app:riv_corner_radius="6dp"
android:layout_height="200dp"
android:background="@color/grey30"
android:layout_height="200dp"/>
app:riv_corner_radius="6dp" />
</com.facebook.shimmer.ShimmerFrameLayout>
<com.makeramen.roundedimageview.RoundedImageView
android:layout_width="match_parent"
android:id="@+id/image_place_holder"
android:visibility="gone"
android:layout_marginTop="@dimen/_16sdp"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="@dimen/_16sdp"
android:src="@drawable/image_slider2"
android:layout_height="200dp"/>
android:visibility="gone" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<uz.mobiuz.mobiservice.dev.ui.home.SliderImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/slider"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="@dimen/_16sdp" />
</FrameLayout>
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabIndicator"
......
......@@ -13,7 +13,7 @@
style="@style/agr_ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
android:elevation="1dp"
app:navigationIcon="@drawable/ic_baseline_arrow_back"
app:title="@string/agr_mobi_uz_history_title" />
......@@ -29,12 +29,15 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layoutAnimation="@anim/layout_animation"
android:layout_height="match_parent"
android:overScrollMode="never"
android:visibility="visible"
tools:listitem="@layout/monitoring_item" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<include
android:id="@+id/layout_empty"
layout="@layout/layout_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
......
......@@ -119,6 +119,7 @@
android:textColor="@color/black75"
android:textSize="15sp" />
<LinearLayout
android:id="@+id/addCard"
android:layout_width="match_parent"
......@@ -164,8 +165,10 @@
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:background="@drawable/card_background"
android:layout_marginBottom="16dp"
android:orientation="vertical"
android:padding="16dp"
android:visibility="gone"
tools:visibility="visible">
......@@ -173,27 +176,29 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/agr_mobi_uz_card_number"
android:textColor="@color/black75"
android:textColor="@color/white100"
android:textSize="15sp" />
<EditText
android:id="@+id/etCardNumber"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:background="@drawable/edit_text_unchecked"
android:gravity="center|start"
android:background="@android:color/transparent"
android:textColorHint="@color/grey100"
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/black100"
android:textColor="@color/white100"
android:textSize="15sp"
tools:ignore="Autofill,HardcodedText" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/white100"/>
<TextView
android:id="@+id/tvErrorMsg"
......@@ -202,11 +207,10 @@
android:layout_marginTop="6dp"
android:drawablePadding="8dp"
android:text="@string/agr_mobi_uz_card_format_error"
android:textColor="@color/agr_red"
android:textColor="@color/grey100"
android:textSize="13sp"
android:textStyle="bold"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_vector_error"
tools:visibility="visible" />
<TextView
......@@ -214,28 +218,30 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/agr_mobi_uz_card_expiry"
android:textColor="@color/black75"
android:textColor="@color/white100"
android:textSize="15sp" />
<EditText
android:id="@+id/etCardExpiry"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:background="@drawable/edit_text_unchecked"
android:gravity="center|start"
android:hint="ММ/ГГ"
android:hint="ММ / ГГ"
android:background="@android:color/transparent"
android:textColorHint="@color/grey100"
android:imeOptions="actionDone"
android:textColor="@color/white100"
android:importantForAutofill="no"
android:inputType="number|textNoSuggestions"
android:longClickable="false"
android:maxLength="5"
android:paddingVertical="12dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="@color/black100"
android:textSize="15sp"
tools:ignore="HardcodedText" />
<View
android:layout_width="60dp"
android:layout_height="1dp"
android:background="@color/white100"/>
<TextView
android:id="@+id/tvErrorMsgExpiry"
......@@ -244,17 +250,19 @@
android:layout_marginTop="6dp"
android:drawablePadding="8dp"
android:text="@string/agr_mobi_uz_card_expire_error"
android:textColor="@color/agr_red"
android:textColor="@color/grey100"
android:textSize="13sp"
android:textStyle="bold"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_vector_error"
tools:visibility="visible" />
</LinearLayout>
<LinearLayout
android:id="@+id/checkboxSaveCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="15dp"
android:gravity="center">
......@@ -273,13 +281,12 @@
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"
......
......@@ -4,7 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000">
android:background="#00000000"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
......
......@@ -27,21 +27,22 @@
android:textSize="20sp"
android:textStyle="bold" />
<TextView
<Button
android:id="@+id/btnAnotherCard"
android:layout_width="match_parent"
android:layout_height="@dimen/_44sdp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginHorizontal="@dimen/_20sdp"
android:layout_marginTop="@dimen/_20sdp"
android:background="?android:selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:background="@drawable/button_grey"
android:elevation="0dp"
android:paddingVertical="@dimen/_13sdp"
android:text="@string/agr_mobi_uz_pay_with_another_card"
android:textAllCaps="false"
android:textColor="@color/primary100"
android:textSize="15sp"
android:textStyle="bold" />
android:textStyle="bold"
android:translationZ="0dp" />
<Button
android:id="@+id/btnAddCard"
......
......@@ -24,6 +24,7 @@
<color name="grey60">#918A8B</color>
<color name="grey30">#E7E1DD</color>
<color name="grey20">#F1F1F1</color>
<color name="grey15">#F8F8F8</color>
<color name="grey10">#FBFBFB</color>
<color name="primary100">#E62229</color>
......
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