Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shunchaki
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shohboz Qoraboev
shunchaki
Commits
4df4226d
Commit
4df4226d
authored
Jan 06, 2022
by
shohboz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPD]
MUS-312
Feature, card screens updated
parent
2b2592ce
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1513 additions
and
33 deletions
+1513
-33
.name
.idea/.name
+1
-1
misc.xml
.idea/misc.xml
+13
-1
agr-sdk-pgw-core-release-1.7.0.aar
app/aars/agr-sdk-pgw-core-release-1.7.0.aar
+0
-0
build.gradle
app/build.gradle
+2
-0
SplashActivity.kt
...src/main/java/uz/mobiuz/mobiservice/dev/SplashActivity.kt
+14
-1
App.kt
app/src/main/java/uz/mobiuz/mobiservice/dev/app/App.kt
+8
-10
CardRepository.kt
...biuz/mobiservice/dev/network/repository/CardRepository.kt
+27
-0
CONSTANTS.kt
...ain/java/uz/mobiuz/mobiservice/dev/ui/global/CONSTANTS.kt
+1
-0
BillingFragment.kt
...java/uz/mobiuz/mobiservice/dev/ui/home/BillingFragment.kt
+12
-19
HomeFragment.kt
...in/java/uz/mobiuz/mobiservice/dev/ui/home/HomeFragment.kt
+7
-0
MonitoringLocalFragment.kt
.../mobiuz/mobiservice/dev/ui/sdk/MonitoringLocalFragment.kt
+78
-0
ReplenishBalanceFragment.kt
...mobiuz/mobiservice/dev/ui/sdk/ReplenishBalanceFragment.kt
+77
-0
AddCardFragment.kt
.../uz/mobiuz/mobiservice/dev/ui/sdk/card/AddCardFragment.kt
+194
-0
CardConfirmFragment.kt
...mobiuz/mobiservice/dev/ui/sdk/card/CardConfirmFragment.kt
+82
-0
CardDelegate.kt
...ava/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardDelegate.kt
+106
-0
CardViewModel.kt
...va/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardViewModel.kt
+51
-0
CardsListAdapter.kt
...uz/mobiuz/mobiservice/dev/ui/sdk/card/CardsListAdapter.kt
+89
-0
CardsListFragment.kt
...z/mobiuz/mobiservice/dev/ui/sdk/card/CardsListFragment.kt
+165
-0
LayoutContainer.kt
...n/java/uz/mobiuz/mobiservice/dev/utils/LayoutContainer.kt
+8
-0
fragment_add_card.xml
app/src/main/res/layout/fragment_add_card.xml
+132
-0
fragment_card_confirm.xml
app/src/main/res/layout/fragment_card_confirm.xml
+182
-0
fragment_cards_list.xml
app/src/main/res/layout/fragment_cards_list.xml
+62
-0
fragment_monitoring_local.xml
app/src/main/res/layout/fragment_monitoring_local.xml
+14
-0
fragment_replenish_balance.xml
app/src/main/res/layout/fragment_replenish_balance.xml
+14
-0
mobi_uz_item_card.xml
app/src/main/res/layout/mobi_uz_item_card.xml
+147
-0
nav_graph_home.xml
app/src/main/res/navigation/nav_graph_home.xml
+27
-1
No files found.
.idea/.name
View file @
4df4226d
MobiUz-Android
Mobiuz
\ No newline at end of file
\ No newline at end of file
.idea/misc.xml
View file @
4df4226d
...
@@ -4,10 +4,13 @@
...
@@ -4,10 +4,13 @@
<option
name=
"filePathToZoomLevelMap"
>
<option
name=
"filePathToZoomLevelMap"
>
<map>
<map>
<entry
key=
"../../../../layout/custom_preview.xml"
value=
"0.3527777777777778"
/>
<entry
key=
"../../../../layout/custom_preview.xml"
value=
"0.3527777777777778"
/>
<entry
key=
"../../.gradle/caches/transforms-3/272c6ad3bc9f3b40802fd3a427796f36/transformed/jetified-agr-sdk-mobi-uz-release-1.0.0/res/layout/agr_layout_empty.xml"
value=
"0.25625"
/>
<entry
key=
"../../.gradle/caches/transforms-3/eea77424a90e1e1097be3e7a9314e37d/transformed/jetified-mobi_uz/res/layout/agr_fragment_fast_pay.xml"
value=
"0.25"
/>
<entry
key=
"../../.gradle/caches/transforms-3/eea77424a90e1e1097be3e7a9314e37d/transformed/jetified-mobi_uz/res/layout/agr_fragment_fast_pay.xml"
value=
"0.25"
/>
<entry
key=
"../../.gradle/caches/transforms-3/fd180e2afb980e83e4951f5e21e58af5/transformed/jetified-agr-sdk-coreui-release-1.7.0/res/layout/agr_core_ui_layout_zero.xml"
value=
"0.25625"
/>
<entry
key=
"..\:/Users/NEW AGE/StudioProjects/shunchaki/app/src/main/res/layout/fragment_billing.xml"
value=
"0.20520833333333333"
/>
<entry
key=
"..\:/Users/NEW AGE/StudioProjects/shunchaki/app/src/main/res/layout/fragment_billing.xml"
value=
"0.20520833333333333"
/>
<entry
key=
"app/src/main/res/drawable/bgn_avatar.xml"
value=
"0.25069444444444444"
/>
<entry
key=
"app/src/main/res/drawable/bgn_avatar.xml"
value=
"0.25069444444444444"
/>
<entry
key=
"app/src/main/res/drawable/bgn_lang.xml"
value=
"0.2796296296296296"
/>
<entry
key=
"app/src/main/res/drawable/bgn_lang.xml"
value=
"0.2796296296296296"
/>
<entry
key=
"app/src/main/res/drawable/bgn_layer.xml"
value=
"0.15"
/>
<entry
key=
"app/src/main/res/drawable/bgn_pin_btn.xml"
value=
"0.26525096525096525"
/>
<entry
key=
"app/src/main/res/drawable/bgn_pin_btn.xml"
value=
"0.26525096525096525"
/>
<entry
key=
"app/src/main/res/drawable/bgn_pin_checked.xml"
value=
"0.26525096525096525"
/>
<entry
key=
"app/src/main/res/drawable/bgn_pin_checked.xml"
value=
"0.26525096525096525"
/>
<entry
key=
"app/src/main/res/drawable/bgn_user_phone.xml"
value=
"0.24791666666666667"
/>
<entry
key=
"app/src/main/res/drawable/bgn_user_phone.xml"
value=
"0.24791666666666667"
/>
...
@@ -35,8 +38,10 @@
...
@@ -35,8 +38,10 @@
<entry
key=
"app/src/main/res/drawable/ic_fingerprint.xml"
value=
"0.26525096525096525"
/>
<entry
key=
"app/src/main/res/drawable/ic_fingerprint.xml"
value=
"0.26525096525096525"
/>
<entry
key=
"app/src/main/res/drawable/ic_group_12.xml"
value=
"0.2796296296296296"
/>
<entry
key=
"app/src/main/res/drawable/ic_group_12.xml"
value=
"0.2796296296296296"
/>
<entry
key=
"app/src/main/res/drawable/ic_image_only_finger.xml"
value=
"0.26525096525096525"
/>
<entry
key=
"app/src/main/res/drawable/ic_image_only_finger.xml"
value=
"0.26525096525096525"
/>
<entry
key=
"app/src/main/res/drawable/ic_logo.xml"
value=
"0.2578125"
/>
<entry
key=
"app/src/main/res/drawable/ic_mobiuz_logo.xml"
value=
"0.26180555555555557"
/>
<entry
key=
"app/src/main/res/drawable/ic_mobiuz_logo.xml"
value=
"0.26180555555555557"
/>
<entry
key=
"app/src/main/res/drawable/ic_pinger_print.xml"
value=
"0.2590277777777778"
/>
<entry
key=
"app/src/main/res/drawable/ic_pinger_print.xml"
value=
"0.2590277777777778"
/>
<entry
key=
"app/src/main/res/drawable/ic_placeholder.xml"
value=
"0.21666666666666667"
/>
<entry
key=
"app/src/main/res/drawable/ic_russia.xml"
value=
"0.2796296296296296"
/>
<entry
key=
"app/src/main/res/drawable/ic_russia.xml"
value=
"0.2796296296296296"
/>
<entry
key=
"app/src/main/res/drawable/ic_safety.xml"
value=
"0.2590277777777778"
/>
<entry
key=
"app/src/main/res/drawable/ic_safety.xml"
value=
"0.2590277777777778"
/>
<entry
key=
"app/src/main/res/drawable/ic_vector_error.xml"
value=
"0.20694444444444443"
/>
<entry
key=
"app/src/main/res/drawable/ic_vector_error.xml"
value=
"0.20694444444444443"
/>
...
@@ -58,10 +63,13 @@
...
@@ -58,10 +63,13 @@
<entry
key=
"app/src/main/res/layout/bottom_sheet_ussd.xml"
value=
"0.266796875"
/>
<entry
key=
"app/src/main/res/layout/bottom_sheet_ussd.xml"
value=
"0.266796875"
/>
<entry
key=
"app/src/main/res/layout/button_selector.xml"
value=
"0.33242753623188404"
/>
<entry
key=
"app/src/main/res/layout/button_selector.xml"
value=
"0.33242753623188404"
/>
<entry
key=
"app/src/main/res/layout/fragment_action.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_action.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_add_card.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_base.xml"
value=
"0.23497267759562843"
/>
<entry
key=
"app/src/main/res/layout/fragment_base.xml"
value=
"0.23497267759562843"
/>
<entry
key=
"app/src/main/res/layout/fragment_billing.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_billing.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_biometric.xml"
value=
"0.23497267759562843"
/>
<entry
key=
"app/src/main/res/layout/fragment_biometric.xml"
value=
"0.23497267759562843"
/>
<entry
key=
"app/src/main/res/layout/fragment_blank.xml"
value=
"0.18385416666666668"
/>
<entry
key=
"app/src/main/res/layout/fragment_blank.xml"
value=
"0.18385416666666668"
/>
<entry
key=
"app/src/main/res/layout/fragment_card_confirm.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_cards_list.xml"
value=
"0.244921875"
/>
<entry
key=
"app/src/main/res/layout/fragment_change_password.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_change_password.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_check_phone.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_check_phone.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_confirm_new_pin.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_confirm_new_pin.xml"
value=
"0.25625"
/>
...
@@ -77,6 +85,8 @@
...
@@ -77,6 +85,8 @@
<entry
key=
"app/src/main/res/layout/fragment_main.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_main.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_main_ussd.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_main_ussd.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_minutes.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_minutes.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_monitoring_local.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_motion.xml"
value=
"0.1"
/>
<entry
key=
"app/src/main/res/layout/fragment_my_verification.xml"
value=
"0.1265625"
/>
<entry
key=
"app/src/main/res/layout/fragment_my_verification.xml"
value=
"0.1265625"
/>
<entry
key=
"app/src/main/res/layout/fragment_new_password.xml"
value=
"0.245703125"
/>
<entry
key=
"app/src/main/res/layout/fragment_new_password.xml"
value=
"0.245703125"
/>
<entry
key=
"app/src/main/res/layout/fragment_new_pin.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_new_pin.xml"
value=
"0.25625"
/>
...
@@ -92,6 +102,7 @@
...
@@ -92,6 +102,7 @@
<entry
key=
"app/src/main/res/layout/fragment_safety.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_safety.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_security.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_security.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_service.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_service.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_services.xml"
value=
"0.24795081967213115"
/>
<entry
key=
"app/src/main/res/layout/fragment_support.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_support.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_tarifs.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_tarifs.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_ussd.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/fragment_ussd.xml"
value=
"0.25625"
/>
...
@@ -100,7 +111,7 @@
...
@@ -100,7 +111,7 @@
<entry
key=
"app/src/main/res/layout/home_motion.xml"
value=
"0.10951008645533142"
/>
<entry
key=
"app/src/main/res/layout/home_motion.xml"
value=
"0.10951008645533142"
/>
<entry
key=
"app/src/main/res/layout/item_action.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/item_action.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/item_confirm.xml"
value=
"0.23497267759562843"
/>
<entry
key=
"app/src/main/res/layout/item_confirm.xml"
value=
"0.23497267759562843"
/>
<entry
key=
"app/src/main/res/layout/item_home.xml"
value=
"0.2
9936594202898553
"
/>
<entry
key=
"app/src/main/res/layout/item_home.xml"
value=
"0.2
2
"
/>
<entry
key=
"app/src/main/res/layout/item_pin.xml"
value=
"0.23497267759562843"
/>
<entry
key=
"app/src/main/res/layout/item_pin.xml"
value=
"0.23497267759562843"
/>
<entry
key=
"app/src/main/res/layout/item_service.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/item_service.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/item_ussd.xml"
value=
"0.22"
/>
<entry
key=
"app/src/main/res/layout/item_ussd.xml"
value=
"0.22"
/>
...
@@ -110,6 +121,7 @@
...
@@ -110,6 +121,7 @@
<entry
key=
"app/src/main/res/layout/layout_home_header.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/layout_home_header.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/layout_offline_bottom_sheet.xml"
value=
"0.266051912568306"
/>
<entry
key=
"app/src/main/res/layout/layout_offline_bottom_sheet.xml"
value=
"0.266051912568306"
/>
<entry
key=
"app/src/main/res/layout/layout_sender.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/layout_sender.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/mobi_uz_item_card.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/motion_layout.xml"
value=
"0.266796875"
/>
<entry
key=
"app/src/main/res/layout/motion_layout.xml"
value=
"0.266796875"
/>
<entry
key=
"app/src/main/res/menu/bottom_nav_menu.xml"
value=
"0.3416666666666667"
/>
<entry
key=
"app/src/main/res/menu/bottom_nav_menu.xml"
value=
"0.3416666666666667"
/>
<entry
key=
"app/src/main/res/xml/layout_description.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/xml/layout_description.xml"
value=
"0.25625"
/>
...
...
app/aars/agr-sdk-pgw-core-release-1.7.0.aar
0 → 100644
View file @
4df4226d
File added
app/build.gradle
View file @
4df4226d
...
@@ -2,6 +2,7 @@ plugins {
...
@@ -2,6 +2,7 @@ plugins {
id
'com.android.application'
id
'com.android.application'
id
'kotlin-android'
id
'kotlin-android'
id
'kotlin-kapt'
id
'kotlin-kapt'
id
'kotlin-android-extensions'
id
'dagger.hilt.android.plugin'
id
'dagger.hilt.android.plugin'
id
'androidx.navigation.safeargs.kotlin'
id
'androidx.navigation.safeargs.kotlin'
id
'com.google.firebase.crashlytics'
id
'com.google.firebase.crashlytics'
...
@@ -58,6 +59,7 @@ dependencies {
...
@@ -58,6 +59,7 @@ dependencies {
api
(
name:
'agr-sdk-core-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-coreui-release-1.7.0'
,
ext:
'aar'
)
api
(
name:
'agr-sdk-mobi-uz-release-1.0.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
'androidx.core:core-ktx:1.7.0'
implementation
'androidx.core:core-ktx:1.7.0'
implementation
'androidx.appcompat:appcompat:1.3.1'
implementation
'androidx.appcompat:appcompat:1.3.1'
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/SplashActivity.kt
View file @
4df4226d
...
@@ -94,6 +94,19 @@ class SplashActivity : AppCompatActivity() {
...
@@ -94,6 +94,19 @@ class SplashActivity : AppCompatActivity() {
}
}
/**
* CardsListFragment
*
*
* MonitoringLocalFragment
*
*
*
* ReplenishBalanceFragment
*
*
*/
fun
navigate
()
{
fun
navigate
()
{
when
{
when
{
...
@@ -110,7 +123,7 @@ class SplashActivity : AppCompatActivity() {
...
@@ -110,7 +123,7 @@ class SplashActivity : AppCompatActivity() {
}
}
else
->
{
else
->
{
startActivity
(
Intent
(
this
@SplashActivity
,
Language
Activity
::
class
.
java
))
startActivity
(
Intent
(
this
@SplashActivity
,
Main
Activity
::
class
.
java
))
}
}
}
}
finish
()
finish
()
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/app/App.kt
View file @
4df4226d
...
@@ -3,20 +3,17 @@ package uz.mobiuz.mobiservice.dev.app
...
@@ -3,20 +3,17 @@ package uz.mobiuz.mobiservice.dev.app
import
android.content.Context
import
android.content.Context
import
androidx.multidex.MultiDex
import
androidx.multidex.MultiDex
import
androidx.multidex.MultiDexApplication
import
androidx.multidex.MultiDexApplication
import
uz.mobiuz.mobiservice.dev.BuildConfig
import
uz.mobiuz.mobiservice.dev.utils.LocaleHelper
import
dagger.hilt.android.HiltAndroidApp
import
dagger.hilt.android.HiltAndroidApp
import
ru.terrakok.cicerone.Router
import
timber.log.Timber
import
timber.log.Timber
import
toothpick.Toothpick
import
toothpick.Toothpick
import
toothpick.configuration.Configuration
import
toothpick.configuration.Configuration
import
uz.agr.mobiuz.AGRBilling
import
uz.agr.mobiuz.di.AppModule
import
uz.agr.sdk.core.di.DI
import
uz.agr.sdk.core.di.DI
import
uz.agr.sdk.core.di.module.CoreServerModule
import
uz.agr.sdk.core.di.module.CoreServerModule
import
uz.agr.sdk.core.model.system.LocaleManager
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.coreui.di.ServerModule
import
uz.agr.sdk.pgw_core.mobi.MobiUz
import
uz.mobiuz.mobiservice.dev.BuildConfig
import
uz.mobiuz.mobiservice.dev.utils.LocaleHelper
@HiltAndroidApp
@HiltAndroidApp
class
App
:
MultiDexApplication
()
{
class
App
:
MultiDexApplication
()
{
...
@@ -27,7 +24,8 @@ class App : MultiDexApplication() {
...
@@ -27,7 +24,8 @@ class App : MultiDexApplication() {
initToothpick
()
initToothpick
()
initAppScope
()
initAppScope
()
initLogger
()
initLogger
()
AGRBilling
.
init
(
this
)
// AGRBilling.init(this)
MobiUz
.
init
(
this
)
}
}
override
fun
attachBaseContext
(
base
:
Context
)
{
override
fun
attachBaseContext
(
base
:
Context
)
{
...
@@ -56,15 +54,15 @@ class App : MultiDexApplication() {
...
@@ -56,15 +54,15 @@ class App : MultiDexApplication() {
private
fun
initAppScope
()
{
private
fun
initAppScope
()
{
val
appScope
=
Toothpick
.
openScope
(
DI
.
APP_SCOPE
)
val
appScope
=
Toothpick
.
openScope
(
DI
.
APP_SCOPE
)
appScope
.
installModules
(
AppModule
())
//
appScope.installModules(AppModule())
appScope
.
installModules
(
CoreServerModule
(
"MOBIUZ"
))
appScope
.
installModules
(
CoreServerModule
(
"MOBIUZ"
))
appScope
.
installModules
(
FlowNavigationModule
(
appScope
.
getInstance
(
Router
::
class
.
java
)))
//
appScope.installModules(FlowNavigationModule(appScope.getInstance(Router::class.java)))
val
serverScope
=
Toothpick
.
openScopes
(
DI
.
APP_SCOPE
,
DI
.
SERVER_SCOPE
)
val
serverScope
=
Toothpick
.
openScopes
(
DI
.
APP_SCOPE
,
DI
.
SERVER_SCOPE
)
serverScope
.
installModules
(
ServerModule
())
serverScope
.
installModules
(
ServerModule
())
}
}
companion
object
{
companion
object
{
lateinit
var
INSTANCE
:
App
lateinit
var
INSTANCE
:
App
}
}
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/network/repository/CardRepository.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.network.repository
import
android.content.Context
import
dagger.hilt.android.qualifiers.ApplicationContext
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.withContext
import
uz.agr.sdk.core.entity.card.CardRegistration
import
uz.agr.sdk.pgw_core.mobi.BaseListener
import
uz.agr.sdk.pgw_core.mobi.MobiUz
import
uz.mobiuz.mobiservice.dev.model.SharedPref
import
uz.mobiuz.mobiservice.dev.network.api.ApiService
import
uz.mobiuz.mobiservice.dev.network.model.Customer
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
javax.inject.Inject
import
javax.inject.Singleton
@Singleton
class
CardRepository
@Inject
constructor
(
private
val
apiService
:
ApiService
,
private
val
pref
:
SharedPref
,
@ApplicationContext
val
context
:
Context
)
{
}
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/global/CONSTANTS.kt
View file @
4df4226d
...
@@ -2,6 +2,7 @@ package uz.mobiuz.mobiservice.dev.ui.global
...
@@ -2,6 +2,7 @@ package uz.mobiuz.mobiservice.dev.ui.global
object
CONSTANTS
{
object
CONSTANTS
{
const
val
CARD_ID
=
"CARD_ID"
const
val
UNAUTHORIZED
=
"UNAUTHORIZED"
const
val
UNAUTHORIZED
=
"UNAUTHORIZED"
const
val
BASE_URL
=
"https://mobileapp.mobi.uz/api/v1/"
const
val
BASE_URL
=
"https://mobileapp.mobi.uz/api/v1/"
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/home/BillingFragment.kt
View file @
4df4226d
...
@@ -2,14 +2,15 @@ package uz.mobiuz.mobiservice.dev.ui.home
...
@@ -2,14 +2,15 @@ package uz.mobiuz.mobiservice.dev.ui.home
import
android.os.Bundle
import
android.os.Bundle
import
android.view.View
import
android.view.View
import
androidx.core.os.bundleOf
import
androidx.navigation.fragment.NavHostFragment
import
androidx.navigation.fragment.NavHostFragment
import
dagger.hilt.android.AndroidEntryPoint
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.databinding.FragmentBillingBinding
import
uz.mobiuz.mobiservice.dev.databinding.FragmentBillingBinding
import
uz.mobiuz.mobiservice.dev.model.SharedPref
import
uz.mobiuz.mobiservice.dev.model.SharedPref
import
uz.mobiuz.mobiservice.dev.ui.base.BaseFragment
import
uz.mobiuz.mobiservice.dev.ui.base.BaseFragment
import
uz.mobiuz.mobiservice.dev.ui.global.CONSTANTS
import
uz.mobiuz.mobiservice.dev.utils.extensions.showMessage
import
uz.mobiuz.mobiservice.dev.utils.extensions.showMessage
import
dagger.hilt.android.AndroidEntryPoint
import
uz.agr.mobiuz.AGRBilling
import
javax.inject.Inject
import
javax.inject.Inject
@AndroidEntryPoint
@AndroidEntryPoint
...
@@ -38,25 +39,19 @@ class BillingFragment : BaseFragment(R.layout.fragment_billing) {
...
@@ -38,25 +39,19 @@ class BillingFragment : BaseFragment(R.layout.fragment_billing) {
savedCards
.
setOnClickListener
{
savedCards
.
setOnClickListener
{
getPhoneNumber
(
object
:
LoadPhoneNumber
{
getPhoneNumber
(
object
:
LoadPhoneNumber
{
override
fun
invoke
(
phoneNumber
:
String
)
{
override
fun
invoke
(
phoneNumber
:
String
)
{
pref
.
isShowPin
=
false
// pref.isShowPin = false
startActivity
(
navController
.
navigate
(
R
.
id
.
cardsListFragment
,
bundleOf
(
CONSTANTS
.
PHONE
to
pref
.
userPhone
.
filter
{
it
.
isDigit
()
}))
AGRBilling
.
createCardsListIntent
(
requireContext
(),
pref
.
userPhone
.
filter
{
it
.
isDigit
()
})
// startActivity(
)
// AGRBilling.createCardsListIntent(requireContext(), pref.userPhone.filter { it.isDigit() })
// )
}
}
})
})
}
}
payments
.
setOnClickListener
{
/*
payments.setOnClickListener {
getPhoneNumber(object : LoadPhoneNumber {
getPhoneNumber(object : LoadPhoneNumber {
override fun invoke(phoneNumber: String) {
override fun invoke(phoneNumber: String) {
pref.isShowPin = false
pref.isShowPin = false
/*
startActivity(AGRBilling.createReplenishBalanceIntent(requireContext(), phoneNumber))
Vendor(
100082, "OOO UMS", "UMS", "https://agr.uz/application/resources/img/ums.jpg"
)
*/
startActivity
(
AGRBilling
.
createReplenishBalanceIntent
(
requireContext
(),
phoneNumber
)
)
}
}
})
})
}
}
...
@@ -64,12 +59,10 @@ class BillingFragment : BaseFragment(R.layout.fragment_billing) {
...
@@ -64,12 +59,10 @@ class BillingFragment : BaseFragment(R.layout.fragment_billing) {
getPhoneNumber(object : LoadPhoneNumber {
getPhoneNumber(object : LoadPhoneNumber {
override fun invoke(phoneNumber: String) {
override fun invoke(phoneNumber: String) {
pref.isShowPin = false
pref.isShowPin = false
startActivity
(
startActivity(AGRBilling.createHistoryIntent(requireContext(), phoneNumber))
AGRBilling
.
createHistoryIntent
(
requireContext
(),
phoneNumber
)
)
}
}
})
})
}
}
*/
}
}
}
}
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/home/HomeFragment.kt
View file @
4df4226d
...
@@ -52,6 +52,13 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) {
...
@@ -52,6 +52,13 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) {
private
lateinit
var
changedParam
:
FrameLayout
.
LayoutParams
private
lateinit
var
changedParam
:
FrameLayout
.
LayoutParams
private
val
navController
:
NavController
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
NavHostFragment
.
findNavController
(
this
)
}
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
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
viewModel
.
mainIndex
()
viewModel
.
mainIndex
()
...
...
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/MonitoringLocalFragment.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.ui.sdk
import
android.os.Bundle
import
androidx.fragment.app.Fragment
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
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
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.databinding.FragmentCardsListBinding
import
uz.mobiuz.mobiservice.dev.databinding.FragmentMonitoringLocalBinding
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.home.HomeViewModel
import
javax.inject.Inject
@AndroidEntryPoint
class
MonitoringLocalFragment
:
BaseFragment
(
R
.
layout
.
fragment_monitoring_local
)
{
@Inject
lateinit
var
pref
:
SharedPref
private
var
_bn
:
FragmentMonitoringLocalBinding
?
=
null
private
val
bn
get
()
=
_bn
?:
throw
NullPointerException
(
"cannot inflate"
)
private
val
viewModel
:
HomeViewModel
by
viewModels
()
private
val
navController
:
NavController
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
NavHostFragment
.
findNavController
(
this
)
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
_bn
=
FragmentMonitoringLocalBinding
.
bind
(
view
)
setUpUI
()
collects
()
}
override
fun
setUpUI
()
{
}
override
fun
collects
()
{
viewLifecycleOwner
.
lifecycleScope
.
launchWhenStarted
{
viewModel
.
mainIndexUiState
.
collect
{
when
(
it
)
{
is
UiStateObject
.
SUCCESS
->
{
}
is
UiStateObject
.
ERROR
->
{
}
is
UiStateObject
.
LOADING
->
{
}
else
->
Unit
}
}
}
}
override
fun
onDestroy
()
{
_bn
=
null
super
.
onDestroy
()
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/ReplenishBalanceFragment.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.ui.sdk
import
android.os.Bundle
import
androidx.fragment.app.Fragment
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
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
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.home.HomeViewModel
import
javax.inject.Inject
@AndroidEntryPoint
class
ReplenishBalanceFragment
:
BaseFragment
(
R
.
layout
.
fragment_replenish_balance
)
{
@Inject
lateinit
var
pref
:
SharedPref
private
var
_bn
:
FragmentReplenishBalanceBinding
?
=
null
private
val
bn
get
()
=
_bn
?:
throw
NullPointerException
(
"cannot inflate"
)
private
val
viewModel
:
HomeViewModel
by
viewModels
()
private
val
navController
:
NavController
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
NavHostFragment
.
findNavController
(
this
)
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
_bn
=
FragmentReplenishBalanceBinding
.
bind
(
view
)
setUpUI
()
collects
()
}
override
fun
setUpUI
()
{
}
override
fun
collects
()
{
viewLifecycleOwner
.
lifecycleScope
.
launchWhenStarted
{
viewModel
.
mainIndexUiState
.
collect
{
when
(
it
)
{
is
UiStateObject
.
SUCCESS
->
{
}
is
UiStateObject
.
ERROR
->
{
}
is
UiStateObject
.
LOADING
->
{
}
else
->
Unit
}
}
}
}
override
fun
onDestroy
()
{
_bn
=
null
super
.
onDestroy
()
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/card/AddCardFragment.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.ui.sdk.card
import
android.os.Bundle
import
android.text.method.DigitsKeyListener
import
android.util.Log
import
android.view.View
import
android.view.inputmethod.EditorInfo
import
androidx.core.os.bundleOf
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
uz.agr.mobiuz.ui.fast_action.animation.getColorCompat
import
uz.agr.sdk.core.entity.card.CardRegistration
import
uz.agr.sdk.coreui.extension.hideSoftInput
import
uz.agr.sdk.coreui.extension.showSoftInput
import
uz.agr.sdk.coreui.extension.visible
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.BaseListener
import
uz.agr.sdk.pgw_core.mobi.MobiUz
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.databinding.FragmentAddCardBinding
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.CONSTANTS
import
java.util.*
import
javax.inject.Inject
@AndroidEntryPoint
class
AddCardFragment
:
BaseFragment
(
R
.
layout
.
fragment_add_card
)
{
@Inject
lateinit
var
pref
:
SharedPref
private
var
_bn
:
FragmentAddCardBinding
?
=
null
private
val
bn
get
()
=
_bn
?:
throw
NullPointerException
(
"cannot inflate"
)
private
val
viewModel
:
CardViewModel
by
viewModels
()
private
val
navController
:
NavController
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
NavHostFragment
.
findNavController
(
this
)
}
private
var
cardNumberIsValid
=
false
private
var
cardExpiryIsValid
=
false
private
var
cardNumberValid
:
String
?
=
null
private
var
cardExpiryValid
:
String
?
=
null
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
_bn
=
FragmentAddCardBinding
.
bind
(
view
)
setUpUI
()
collects
()
}
override
fun
setUpUI
()
{
bn
.
apply
{
toolbar
.
setNavigationOnClickListener
{
navController
.
navigateUp
()
}
initInputCardNumber
()
initInputCardExpiry
()
btnContinue
.
setOnClickListener
(
object
:
ButtonClick
()
{
override
fun
onSingleClick
(
v
:
View
?)
{
if
(
cardNumberValid
!=
null
&&
cardExpiryValid
!=
null
)
{
viewModel
.
cardRegistration
(
pref
.
userPhone
.
filter
{
it
.
isDigit
()
},
cardNumberValid
!!
,
cardExpiryValid
!!
)
}
}
})
}
}
override
fun
collects
()
{
viewLifecycleOwner
.
lifecycleScope
.
launchWhenStarted
{
viewModel
.
cardRegistrationUiState
.
collect
{
when
(
it
)
{
is
UiStateObject
.
SUCCESS
->
{
showProgressDialog
(
false
)
showToastMessage
(
"success:${it.data.maskedPhoneNumber}"
)
navController
.
navigate
(
R
.
id
.
cardConfirmFragment
,
bundleOf
(
CONSTANTS
.
CARD_ID
to
it
.
data
.
cardId
))
}
is
UiStateObject
.
ERROR
->
{
showProgressDialog
(
false
)
showToastMessage
(
"error:${it.message}"
)
}
is
UiStateObject
.
LOADING
->
{
showProgressDialog
(
true
)
}
else
->
Unit
}
}
}
}
private
fun
initInputCardNumber
()
{
bn
.
apply
{
etCardNumber
.
keyListener
=
DigitsKeyListener
.
getInstance
(
"1234567890 "
)
etCardNumber
.
addTextChangedListener
(
CardNumberFormat
{
valid
,
number
->
cardNumberIsValid
=
valid
if
(
valid
)
{
etCardExpiry
.
requestFocus
()
cardNumberValid
=
number
}
if
(!(
number
.
startsWith
(
"8600"
)
||
number
.
startsWith
(
"9860"
))
||
number
.
filter
{
it
.
isDigit
()
}.
length
!=
16
)
{
tvErrorMsg
.
visible
(
true
)
tvErrorMsg
.
text
=
getString
(
uz
.
agr
.
mobiuz
.
R
.
string
.
agr_mobi_uz_card_format_error
)
}
if
(
valid
)
{
etCardNumber
.
setBackgroundResource
(
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_edit_text_unchecked
)
etCardNumber
.
setTextColor
(
getColorCompat
(
uz
.
agr
.
mobiuz
.
R
.
color
.
agr_text_color
))
tvErrorMsg
.
visible
(
false
)
}
else
{
etCardNumber
.
setBackgroundResource
(
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_edit_text_error
)
etCardNumber
.
setTextColor
(
getColorCompat
(
uz
.
agr
.
mobiuz
.
R
.
color
.
primary100
))
tvErrorMsg
.
visible
(
true
)
}
checkValidForm
()
})
activity
?.
showSoftInput
(
etCardNumber
)
}
}
private
fun
checkValidForm
()
{
bn
.
apply
{
btnContinue
.
isEnabled
=
cardNumberIsValid
&&
cardExpiryIsValid
if
(
btnContinue
.
isEnabled
)
activity
?.
hideSoftInput
()
}
}
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
()
if
(
inputMonth
>
12
||
inputMonth
==
0
)
checkValid
=
false
else
if
(
inputYY
<
currentYY
)
checkValid
=
false
else
if
(
inputYY
==
currentYY
)
{
if
(
inputMonth
<
currentMonth
)
checkValid
=
false
}
else
if
(
inputYY
>
currentYY
&&
inputYY
>
currentYY
+
5
)
checkValid
=
false
}
if
(
checkValid
)
{
cardExpiryValid
=
date
if
(!
cardNumberIsValid
)
{
etCardNumber
.
requestFocus
()
}
}
cardExpiryIsValid
=
checkValid
if
(
checkValid
)
{
etCardExpiry
.
setBackgroundResource
(
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_edit_text_unchecked
)
etCardExpiry
.
setTextColor
(
getColorCompat
(
uz
.
agr
.
mobiuz
.
R
.
color
.
agr_text_color
))
tvErrorMsgExpiry
.
visible
(
false
)
}
else
{
etCardExpiry
.
setBackgroundResource
(
uz
.
agr
.
mobiuz
.
R
.
drawable
.
agr_edit_text_error
)
etCardExpiry
.
setTextColor
(
getColorCompat
(
uz
.
agr
.
mobiuz
.
R
.
color
.
primary100
))
tvErrorMsgExpiry
.
visible
(
true
)
}
checkValidForm
()
})
etCardExpiry
.
setOnEditorActionListener
{
_
,
actionId
,
_
->
if
(
actionId
==
EditorInfo
.
IME_ACTION_DONE
)
{
if
(
btnContinue
.
isEnabled
)
{
btnContinue
.
callOnClick
()
}
!
btnContinue
.
isEnabled
}
else
false
}
}
}
override
fun
onDestroy
()
{
_bn
=
null
super
.
onDestroy
()
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardConfirmFragment.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.ui.sdk.card
import
android.os.Bundle
import
android.view.View
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
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.databinding.FragmentCardConfirmBinding
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.CONSTANTS
import
uz.mobiuz.mobiservice.dev.ui.home.HomeViewModel
import
javax.inject.Inject
@AndroidEntryPoint
class
CardConfirmFragment
:
BaseFragment
(
R
.
layout
.
fragment_card_confirm
)
{
@Inject
lateinit
var
pref
:
SharedPref
private
var
_bn
:
FragmentCardConfirmBinding
?
=
null
private
val
bn
get
()
=
_bn
?:
throw
NullPointerException
(
"cannot inflate"
)
private
val
viewModel
:
HomeViewModel
by
viewModels
()
private
val
navController
:
NavController
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
NavHostFragment
.
findNavController
(
this
)
}
private
var
cardId
=
""
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
arguments
?.
let
{
cardId
=
it
.
getString
(
CONSTANTS
.
CARD_ID
)
?:
""
}
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
_bn
=
FragmentCardConfirmBinding
.
bind
(
view
)
setUpUI
()
collects
()
}
override
fun
setUpUI
()
{
}
override
fun
collects
()
{
viewLifecycleOwner
.
lifecycleScope
.
launchWhenStarted
{
viewModel
.
mainIndexUiState
.
collect
{
when
(
it
)
{
is
UiStateObject
.
SUCCESS
->
{
}
is
UiStateObject
.
ERROR
->
{
}
is
UiStateObject
.
LOADING
->
{
}
else
->
Unit
}
}
}
}
override
fun
onDestroy
()
{
_bn
=
null
super
.
onDestroy
()
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardDelegate.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.ui.sdk.card
import
android.annotation.SuppressLint
import
android.app.AlertDialog
import
android.view.View
import
android.view.ViewGroup
import
androidx.recyclerview.widget.RecyclerView
import
com.hannesdorfmann.adapterdelegates4.AdapterDelegate
import
kotlinx.android.synthetic.main.mobi_uz_item_card.view.*
import
timber.log.Timber
import
uz.agr.sdk.core.entity.card.CardInfo
import
uz.agr.sdk.coreui.extension.*
import
uz.agr.sdk.coreui.model.storage.Prefs
import
uz.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.utils.LayoutContainer
class
CardDelegate
(
private
val
hideSettingsIcon
:
(
Boolean
),
private
val
clickListener
:
(
CardInfo
,
Int
)
->
Unit
)
:
AdapterDelegate
<
MutableList
<
Any
>>()
{
private
var
amount
:
Long
=
0L
private
var
cardsList
:
List
<
String
>
=
emptyList
()
override
fun
isForViewType
(
items
:
MutableList
<
Any
>,
position
:
Int
)
=
items
[
position
]
is
CardInfo
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
):
RecyclerView
.
ViewHolder
=
ViewHolder
(
parent
.
inflate
(
R
.
layout
.
mobi_uz_item_card
))
override
fun
onBindViewHolder
(
items
:
MutableList
<
Any
>,
position
:
Int
,
viewHolder
:
RecyclerView
.
ViewHolder
,
payloads
:
MutableList
<
Any
>
)
{
amount
=
if
(
amount
==
0L
)
Prefs
(
context
=
viewHolder
.
itemView
.
context
).
payAmount
else
amount
val
list
=
Prefs
(
viewHolder
.
itemView
.
context
).
supportedCards
if
(!
list
.
isNullOrEmpty
())
cardsList
=
list
.
split
(
','
)
return
(
viewHolder
as
ViewHolder
).
bind
(
items
[
position
]
as
CardInfo
,
position
)
}
private
inner
class
ViewHolder
(
override
val
containerView
:
View
)
:
RecyclerView
.
ViewHolder
(
containerView
),
LayoutContainer
{
private
lateinit
var
cardInfo
:
CardInfo
init
{
itemView
.
setOnClickListener
{
if
(
cardInfo
.
getExpiryValid
())
{
if
(
cardsList
.
isNotEmpty
())
{
val
result
=
cardsList
.
first
{
cardInfo
.
pan
.
startsWith
(
it
)
}
if
(
result
.
isNotEmpty
())
{
itemClicked
()
}
}
else
itemClicked
()
}
}
if
(!
hideSettingsIcon
)
{
containerView
.
btnSetting
.
setOnClickListener
{
clickListener
(
cardInfo
,
adapterPosition
)
}
}
containerView
.
btnSetting
.
visible
(!
hideSettingsIcon
)
}
@SuppressLint
(
"SetTextI18n"
)
fun
bind
(
cardInfo
:
CardInfo
,
position
:
Int
)
{
this
.
cardInfo
=
cardInfo
containerView
.
tvCardBalance
.
text
=
cardInfo
.
balance
.
formattedMoney
()
+
" "
+
containerView
.
context
.
getString
(
R
.
string
.
agr_mobi_uz_curr
)
containerView
.
tvCardPan
.
text
=
cardInfo
.
pan
.
formatToMaskedCardPan
()
containerView
.
tvCardExpire
.
text
=
cardInfo
.
getExpiryFormatted
()
containerView
.
tvCardHolderName
.
text
=
cardInfo
.
fullName
Timber
.
e
(
"PAN: ${cardInfo.pan}"
)
Timber
.
e
(
"EXpire: ${cardInfo.expiry}"
)
val
isUzCard
=
cardInfo
.
pan
.
startsWith
(
"8600"
)
val
isHumoCard
=
cardInfo
.
pan
.
startsWith
(
"9860"
)
if
(
isHumoCard
)
{
containerView
.
ivHumo
.
visible
(
true
)
containerView
.
ivUzCard
.
visible
(
false
)
}
else
{
containerView
.
ivHumo
.
visible
(
false
)
containerView
.
ivUzCard
.
visible
(
true
)
}
}
private
fun
itemClicked
()
{
if
(
amount
<=
cardInfo
.
balance
)
clickListener
(
cardInfo
,
adapterPosition
)
else
showError
()
}
private
fun
showError
()
{
AnimationUtil
().
Pulse
(
itemView
).
start
()
val
dialog
=
AlertDialog
.
Builder
(
itemView
.
context
)
dialog
.
setMessage
(
itemView
.
context
.
resources
.
getString
(
R
.
string
.
agr_not_emough_money
))
dialog
.
setPositiveButton
(
"ok"
)
{
dialogInterface
,
_
->
dialogInterface
.
dismiss
()
}
dialog
.
show
()
}
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardViewModel.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.ui.sdk.card
import
android.util.Log
import
androidx.lifecycle.ViewModel
import
androidx.lifecycle.viewModelScope
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.CardRegistration
import
uz.agr.sdk.pgw_core.mobi.BaseListener
import
uz.agr.sdk.pgw_core.mobi.MobiUz
import
uz.mobiuz.mobiservice.dev.network.model.UiStateObject
import
uz.mobiuz.mobiservice.dev.network.repository.MainRepository
import
javax.inject.Inject
@HiltViewModel
class
CardViewModel
@Inject
constructor
(
private
val
repository
:
MainRepository
)
:
ViewModel
()
{
private
val
_cardRegistrationUiState
=
MutableSharedFlow
<
UiStateObject
<
CardRegistration
>>()
val
cardRegistrationUiState
:
SharedFlow
<
UiStateObject
<
CardRegistration
>>
=
_cardRegistrationUiState
fun
cardRegistration
(
phone
:
String
,
card
:
String
,
expire
:
String
)
=
viewModelScope
.
launch
{
MobiUz
.
registerCard
(
phone
,
card
,
expire
,
object
:
BaseListener
<
CardRegistration
>
{
override
fun
error
(
message
:
String
)
{
Log
.
d
(
"TAG"
,
"error: "
)
viewModelScope
.
launch
{
_cardRegistrationUiState
.
emit
(
UiStateObject
.
ERROR
(
message
))
}
}
override
fun
loading
(
boolean
:
Boolean
)
{
Log
.
d
(
"TAG"
,
"loading: $boolean "
)
viewModelScope
.
launch
{
_cardRegistrationUiState
.
emit
(
UiStateObject
.
LOADING
)
}
}
override
fun
success
(
data
:
CardRegistration
)
{
Log
.
d
(
"TAG"
,
"success: ${data.maskedPhoneNumber} "
)
viewModelScope
.
launch
{
_cardRegistrationUiState
.
emit
(
UiStateObject
.
SUCCESS
(
data
))
}
}
})
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardsListAdapter.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.ui.sdk.card
import
androidx.recyclerview.widget.DiffUtil
import
com.hannesdorfmann.adapterdelegates4.ListDelegationAdapter
import
uz.agr.mobiuz.ui.card.select.CardDelegate
import
uz.agr.sdk.core.entity.card.CardInfo
import
uz.agr.sdk.coreui.ui.list.ProgressAdapterDelegate
import
uz.agr.sdk.coreui.ui.list.ProgressItem
import
uz.mobiuz.mobiservice.dev.utils.extensions.MultiBlock
import
uz.mobiuz.mobiservice.dev.utils.extensions.SingleBlock
class
CardsListAdapter
(
hideSettingsIcon
:
(
Boolean
),
clickListener
:
(
CardInfo
,
Int
)
->
Unit
)
:
ListDelegationAdapter
<
MutableList
<
Any
>>()
{
// private var listener: MultiBlock<CardInfo,Int>? = null
//
// fun setOnClickListener(block: MultiBlock<CardInfo,Int>){
// listener = block
// }
init
{
items
=
mutableListOf
()
delegatesManager
.
addDelegate
(
CardDelegate
(
hideSettingsIcon
,
clickListener
))
delegatesManager
.
addDelegate
(
ProgressAdapterDelegate
())
}
fun
setData
(
cardsList
:
List
<
CardInfo
>)
{
val
oldData
=
items
.
toList
()
val
progress
=
isProgress
()
items
.
clear
()
items
.
addAll
(
cardsList
)
if
(
progress
)
items
.
add
(
ProgressItem
())
//yes, on main thread...
DiffUtil
.
calculateDiff
(
DiffCallback
(
items
,
oldData
),
false
)
.
dispatchUpdatesTo
(
this
)
}
fun
showProgress
(
isVisible
:
Boolean
)
{
val
oldData
=
items
.
toList
()
val
currentProgress
=
isProgress
()
if
(
isVisible
&&
!
currentProgress
)
{
items
.
add
(
ProgressItem
())
notifyItemInserted
(
items
.
lastIndex
)
}
else
if
(!
isVisible
&&
currentProgress
)
{
items
.
remove
(
items
.
last
())
notifyItemRemoved
(
oldData
.
lastIndex
)
}
}
private
fun
isProgress
()
=
items
.
isNotEmpty
()
&&
items
.
last
()
is
ProgressItem
private
inner
class
DiffCallback
(
private
val
newItems
:
List
<
Any
>,
private
val
oldItems
:
List
<
Any
>
)
:
DiffUtil
.
Callback
()
{
override
fun
getOldListSize
()
=
oldItems
.
size
override
fun
getNewListSize
()
=
newItems
.
size
override
fun
areItemsTheSame
(
oldItemPosition
:
Int
,
newItemPosition
:
Int
):
Boolean
{
val
oldItem
=
oldItems
[
oldItemPosition
]
val
newItem
=
newItems
[
newItemPosition
]
return
if
(
newItem
is
CardInfo
&&
oldItem
is
CardInfo
)
{
newItem
.
id
==
oldItem
.
id
}
else
{
newItem
is
ProgressItem
&&
oldItem
is
ProgressItem
}
}
override
fun
areContentsTheSame
(
oldItemPosition
:
Int
,
newItemPosition
:
Int
):
Boolean
{
val
oldItem
=
oldItems
[
oldItemPosition
]
val
newItem
=
newItems
[
newItemPosition
]
return
if
(
newItem
is
CardInfo
&&
oldItem
is
CardInfo
)
{
newItem
.
status
==
oldItem
.
status
&&
newItem
.
balance
==
oldItem
.
balance
}
else
{
true
}
}
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/ui/sdk/card/CardsListFragment.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.ui.sdk.card
import
android.os.Bundle
import
android.util.Log
import
android.view.View
import
androidx.fragment.app.viewModels
import
androidx.lifecycle.lifecycleScope
import
androidx.navigation.NavController
import
androidx.navigation.fragment.NavHostFragment
import
dagger.hilt.android.AndroidEntryPoint
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.mobiuz.mobiservice.dev.R
import
uz.mobiuz.mobiservice.dev.databinding.FragmentCardsListBinding
import
uz.mobiuz.mobiservice.dev.model.SharedPref
import
uz.mobiuz.mobiservice.dev.ui.base.BaseFragment
import
uz.mobiuz.mobiservice.dev.ui.global.CONSTANTS
import
javax.inject.Inject
@AndroidEntryPoint
class
CardsListFragment
:
BaseFragment
(
R
.
layout
.
fragment_cards_list
)
{
@Inject
lateinit
var
pref
:
SharedPref
private
var
_bn
:
FragmentCardsListBinding
?
=
null
private
val
bn
get
()
=
_bn
?:
throw
NullPointerException
(
"cannot inflate"
)
private
val
viewModel
:
CardViewModel
by
viewModels
()
private
val
navController
:
NavController
by
lazy
(
LazyThreadSafetyMode
.
NONE
)
{
NavHostFragment
.
findNavController
(
this
)
}
private
var
phone
=
""
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
arguments
?.
let
{
phone
=
it
.
getString
(
CONSTANTS
.
PHONE
)
?:
""
}
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
_bn
=
FragmentCardsListBinding
.
bind
(
view
)
setUpUI
()
collects
()
}
override
fun
setUpUI
()
{
bn
.
apply
{
toolbar
.
setNavigationOnClickListener
{
navController
.
navigateUp
()
}
btnAddCard
.
setOnClickListener
{
// addCard()
navController
.
navigate
(
R
.
id
.
addCardFragment
)
}
}
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
>)
{
}
override
fun
server
(
serverData
:
List
<
CardInfo
>)
{
}
})
}
private
fun
addCard
()
{
MobiUz
.
registerCard
(
"998990552109"
,
"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.mainIndexUiState.collect {
// when (it) {
// is UiStateObject.SUCCESS -> {
//
//
// }
// is UiStateObject.ERROR -> {
//
//
// }
// is UiStateObject.LOADING -> {
//
//
// }
// else -> Unit
// }
// }
}
}
override
fun
onDestroy
()
{
_bn
=
null
super
.
onDestroy
()
}
}
\ No newline at end of file
app/src/main/java/uz/mobiuz/mobiservice/dev/utils/LayoutContainer.kt
0 → 100644
View file @
4df4226d
package
uz.mobiuz.mobiservice.dev.utils
import
android.view.View
public
interface
LayoutContainer
{
/** Returns the root holder view. */
public
val
containerView
:
View
?
}
\ No newline at end of file
app/src/main/res/layout/fragment_add_card.xml
0 → 100644
View file @
4df4226d
<?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:layout_width=
"match_parent"
android:fitsSystemWindows=
"true"
android:layout_height=
"match_parent"
android:background=
"@color/agr_white"
android:orientation=
"vertical"
>
<com.google.android.material.appbar.MaterialToolbar
android:id=
"@+id/toolbar"
style=
"@style/agr_ToolbarStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:elevation=
"0dp"
app:navigationIcon=
"@drawable/agr_ic_arrow_blue"
/>
<TextView
style=
"@style/TitleTextStyle"
android:id=
"@+id/toolbar_title"
android:layout_marginTop=
"30dp"
android:text=
"@string/agr_mobi_uz_add_card_title"
/>
<TextView
android:id=
"@+id/txt_hint_amount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"24dp"
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_marginLeft=
"16dp"
android:layout_marginTop=
"4dp"
android:layout_marginRight=
"16dp"
android:background=
"@drawable/agr_edit_text_unchecked"
android:gravity=
"center|start"
android:hint=
"0000 0000 0000 0000"
android:imeOptions=
"actionNext"
android:inputType=
"number"
android:maxLength=
"19"
android:paddingVertical=
"12dp"
android:paddingHorizontal=
"16dp"
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_marginLeft=
"16dp"
android:layout_marginTop=
"6dp"
android:layout_marginRight=
"16dp"
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"
tools:visibility=
"visible"
app:drawableStartCompat=
"@drawable/agr_mobi_uz_ic_error"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginLeft=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginRight=
"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_marginLeft=
"16dp"
android:layout_marginTop=
"4dp"
android:layout_marginRight=
"16dp"
android:background=
"@drawable/agr_edit_text_unchecked"
android:gravity=
"center|start"
android:hint=
"ММ/ГГ"
android:imeOptions=
"actionDone"
android:inputType=
"number"
android:maxLength=
"5"
android:paddingVertical=
"12dp"
android:paddingStart=
"16dp"
android:paddingEnd=
"16dp"
android:textColor=
"@color/agr_text_color"
android:textSize=
"15sp"
tools:ignore=
"Autofill,HardcodedText"
/>
<TextView
android:id=
"@+id/tvErrorMsgExpiry"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"16dp"
android:layout_marginTop=
"6dp"
android:layout_marginRight=
"16dp"
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"
tools:visibility=
"visible"
app:drawableStartCompat=
"@drawable/agr_mobi_uz_ic_error"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
<Button
android:id=
"@+id/btnContinue"
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_add_card"
android:textStyle=
"bold"
/>
</LinearLayout>
app/src/main/res/layout/fragment_card_confirm.xml
0 → 100644
View file @
4df4226d
<?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:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/toolbar"
style=
"@style/agr_ToolbarStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:elevation=
"0dp"
app:navigationIcon=
"@drawable/agr_ic_arrow_blue"
/>
<TextView
android:id=
"@+id/txtEnterPhone"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/_16sdp"
android:layout_marginTop=
"@dimen/_14sdp"
android:text=
"@string/agr_mobi_uz_enter_confirmation"
android:textColor=
"@color/agr_black80"
android:textSize=
"29sp"
android:textStyle=
"bold"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/toolbar"
/>
<TextView
android:id=
"@+id/tvInfo"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"24dp"
android:layout_marginTop=
"26dp"
android:layout_marginRight=
"24dp"
android:gravity=
"center"
android:textSize=
"14sp"
android:visibility=
"gone"
tools:text=
"@string/agr_card_sms_code_confirm_info"
/>
<TextView
android:id=
"@+id/txtErrorCode"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"32dp"
android:text=
"@string/agr_mobi_uz_error_code"
android:textColor=
"@color/primary100"
android:textSize=
"17sp"
android:textStyle=
"bold"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
<FrameLayout
android:id=
"@+id/pinViewGroup"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginHorizontal=
"12dp"
android:layout_marginTop=
"80dp"
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/pinView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:gravity=
"center"
>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/pin1"
style=
"@style/PinStyle"
android:background=
"@drawable/agr_bgn_ver_unchecked"
android:inputType=
"number"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/pin2"
style=
"@style/PinStyle"
android:background=
"@drawable/agr_bgn_ver_unchecked"
android:inputType=
"number"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/pin3"
style=
"@style/PinStyle"
android:background=
"@drawable/agr_bgn_ver_unchecked"
android:inputType=
"number"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/pin4"
style=
"@style/PinStyle"
android:background=
"@drawable/agr_bgn_ver_unchecked"
android:inputType=
"number"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/pin5"
style=
"@style/PinStyle"
android:background=
"@drawable/agr_bgn_ver_unchecked"
android:inputType=
"number"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/pin6"
style=
"@style/PinStyle"
android:background=
"@drawable/agr_bgn_ver_unchecked"
android:imeOptions=
"actionDone"
android:inputType=
"number"
/>
</LinearLayout>
<FrameLayout
android:id=
"@+id/frame"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:visibility=
"visible"
/>
</FrameLayout>
<EditText
android:id=
"@+id/etConfirmCode"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"20dp"
android:layout_marginTop=
"48dp"
android:layout_marginRight=
"20dp"
android:gravity=
"center_horizontal"
android:imeOptions=
"actionDone"
android:inputType=
"number"
android:maxLength=
"6"
android:textSize=
"18sp"
android:visibility=
"gone"
tools:ignore=
"Autofill,LabelFor"
/>
<TextView
android:id=
"@+id/tvTimeOut"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"32dp"
android:layout_marginTop=
"64dp"
android:layout_marginRight=
"32dp"
android:gravity=
"center"
android:textColor=
"@color/agr_grey110"
android:textSize=
"14sp"
tools:text=
"@string/agr_mobi_uz_sms_time_out_info"
/>
<Button
android:id=
"@+id/btnConfirm"
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:layout_gravity=
"bottom"
android:layout_marginHorizontal=
"16dp"
android:layout_marginTop=
"51dp"
android:background=
"@drawable/button_selector"
android:enabled=
"false"
android:text=
"@string/agr_mobi_uz_next"
android:textAllCaps=
"false"
android:textColor=
"@color/agr_white"
android:textSize=
"15sp"
android:textStyle=
"bold"
/>
<Button
android:id=
"@+id/btnResend"
style=
"@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width=
"match_parent"
android:layout_height=
"56dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"16dp"
android:text=
"@string/agr_mobi_uz_sms_resend"
android:textAllCaps=
"false"
android:textColor=
"@color/primary100"
android:textSize=
"14sp"
android:textStyle=
"bold"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
</LinearLayout>
app/src/main/res/layout/fragment_cards_list.xml
0 → 100644
View file @
4df4226d
<?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:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"true"
android:background=
"@color/agr_white"
android:orientation=
"vertical"
>
<com.google.android.material.appbar.MaterialToolbar
android:id=
"@+id/toolbar"
style=
"@style/agr_ToolbarStyle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:elevation=
"0dp"
app:title=
"@string/agr_mobi_uz_save_cards"
app:layout_constraintTop_toTopOf=
"parent"
app:navigationIcon=
"@drawable/agr_ic_arrow_blue"
/>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:background=
"@color/agr_white"
>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id=
"@+id/swipeToRefresh"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:listitem=
"@layout/agr_item_card"
tools:paddingTop=
"@dimen/agr_card_list_start_offset"
/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<include
layout=
"@layout/agr_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: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"
/>
</LinearLayout>
app/src/main/res/layout/fragment_monitoring_local.xml
0 → 100644
View file @
4df4226d
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".ui.sdk.MonitoringLocalFragment"
>
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:text=
"@string/hello_blank_fragment"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_replenish_balance.xml
0 → 100644
View file @
4df4226d
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".ui.sdk.ReplenishBalanceFragment"
>
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:text=
"@string/hello_blank_fragment"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/layout/mobi_uz_item_card.xml
0 → 100644
View file @
4df4226d
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
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=
"180dp"
android:layout_marginStart=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginBottom=
"@dimen/_8sdp"
app:cardCornerRadius=
"@dimen/_6sdp"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/agr_card_background"
>
<TextView
android:id=
"@+id/tvCardHolderName"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"16dp"
android:textAllCaps=
"true"
android:textColor=
"@color/agr_white"
android:textSize=
"10sp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"SmallSp"
tools:text=
"Ibragimov Dostonbek"
/>
<ImageView
android:id=
"@+id/ivHumo"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:contentDescription=
"@null"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@drawable/ic_agr_humo_round"
/>
<ImageView
android:id=
"@+id/ivUzCard"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:contentDescription=
"@null"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@drawable/ic_agr_uz_card_round"
/>
<TextView
android:id=
"@+id/titleCardNumber"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/agr_mobi_uz_card_number"
android:textColor=
"@color/agr_grey60"
android:textSize=
"10sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"@id/tvCardHolderName"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.37"
tools:ignore=
"SmallSp"
/>
<TextView
android:id=
"@+id/tvCardPan"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:letterSpacing=
"0.02"
android:textColor=
"@color/agr_white"
android:textSize=
"14sp"
app:layout_constraintStart_toStartOf=
"@id/tvCardHolderName"
app:layout_constraintTop_toBottomOf=
"@id/titleCardNumber"
tools:ignore=
"SmallSp"
tools:text=
"8600 12** **** 1223"
/>
<TextView
android:id=
"@+id/titleCardBalance"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/agr_mobi_uz_card_balance"
android:textColor=
"@color/agr_grey60"
android:textSize=
"10sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"@id/tvCardHolderName"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.72"
tools:ignore=
"SmallSp"
/>
<TextView
android:id=
"@+id/tvCardBalance"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:letterSpacing=
"0.02"
android:textColor=
"@color/agr_white"
android:textSize=
"14sp"
android:textStyle=
"bold"
app:layout_constraintStart_toStartOf=
"@id/tvCardHolderName"
app:layout_constraintTop_toBottomOf=
"@id/titleCardBalance"
tools:ignore=
"SmallSp"
tools:text=
"25 120 450,00 UZC"
/>
<TextView
android:id=
"@+id/titleCardExpire"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"16dp"
android:text=
"@string/agr_mobi_uz_card_expire_1"
android:textColor=
"@color/agr_grey60"
android:textSize=
"10sp"
app:layout_constraintBottom_toBottomOf=
"@id/titleCardNumber"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/titleCardNumber"
tools:ignore=
"SmallSp"
/>
<TextView
android:id=
"@+id/tvCardExpire"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:letterSpacing=
"0.02"
android:textColor=
"@color/agr_white"
android:textSize=
"14sp"
app:layout_constraintStart_toStartOf=
"@id/titleCardExpire"
app:layout_constraintTop_toBottomOf=
"@id/titleCardExpire"
tools:ignore=
"SmallSp"
tools:text=
"01 / 22"
/>
<ImageView
android:id=
"@+id/btnSetting"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"20dp"
android:background=
"?selectableItemBackgroundBorderless"
android:contentDescription=
"@null"
android:padding=
"@dimen/_8sdp"
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"@id/tvCardBalance"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tvCardBalance"
app:srcCompat=
"@drawable/ic_mobi_uz_delete"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
app/src/main/res/navigation/nav_graph_home.xml
View file @
4df4226d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<navigation
xmlns:android=
"http://schemas.android.com/apk/res/android"
<navigation
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
app:startDestination=
"@id/
pin
Fragment"
app:startDestination=
"@id/
home
Fragment"
android:id=
"@+id/nav_graph_home"
>
android:id=
"@+id/nav_graph_home"
>
<fragment
<fragment
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
<fragment
<fragment
android:id=
"@+id/changePasswordFragment"
android:id=
"@+id/changePasswordFragment"
tools:layout=
"@layout/fragment_change_password"
android:name=
"uz.mobiuz.mobiservice.dev.ui.settings.security.ChangePasswordFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.settings.security.ChangePasswordFragment"
android:label=
"CurrentPasswordFragment"
/>
android:label=
"CurrentPasswordFragment"
/>
...
@@ -59,5 +60,30 @@
...
@@ -59,5 +60,30 @@
android:name=
"uz.mobiuz.mobiservice.dev.ui.home.MotionFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.home.MotionFragment"
android:label=
"fragment_motion"
android:label=
"fragment_motion"
tools:layout=
"@layout/fragment_motion"
/>
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"
/>
<fragment
android:id=
"@+id/monitoringLocalFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.MonitoringLocalFragment"
android:label=
"fragment_monitoring_local"
tools:layout=
"@layout/fragment_monitoring_local"
/>
<fragment
android:id=
"@+id/replenishBalanceFragment"
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.ReplenishBalanceFragment"
android:label=
"fragment_replenish_balance"
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"
/>
<fragment
android:id=
"@+id/cardConfirmFragment"
tools:layout=
""
android:name=
"uz.mobiuz.mobiservice.dev.ui.sdk.card.CardConfirmFragment"
android:label=
"CardConfirmFragment"
/>
</navigation>
</navigation>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment