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
2fed12d2
Commit
2fed12d2
authored
Dec 17, 2021
by
shohboz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPD]
MUS-261
Feature, block app from 5 secund
parent
23e85d59
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
98 additions
and
71 deletions
+98
-71
misc.xml
.idea/misc.xml
+3
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+7
-2
MainActivity.kt
app/src/main/java/com/mobiuz/app/dev/MainActivity.kt
+3
-5
SharedPref.kt
app/src/main/java/com/mobiuz/app/dev/model/SharedPref.kt
+5
-0
CONSTANTS.kt
app/src/main/java/com/mobiuz/app/dev/ui/global/CONSTANTS.kt
+2
-0
HomeFragment.kt
app/src/main/java/com/mobiuz/app/dev/ui/home/HomeFragment.kt
+1
-3
StringExtension.kt
...va/com/mobiuz/app/dev/utils/extensions/StringExtension.kt
+18
-0
ic_dashboard_black_24dp.xml
app/src/main/res/drawable/ic_dashboard_black_24dp.xml
+9
-0
ic_home_black_24dp.xml
app/src/main/res/drawable/ic_home_black_24dp.xml
+9
-0
ic_notifications_black_24dp.xml
app/src/main/res/drawable/ic_notifications_black_24dp.xml
+9
-0
activity_settings.xml
app/src/main/res/layout/activity_settings.xml
+1
-1
nav_graph_home.xml
app/src/main/res/navigation/nav_graph_home.xml
+5
-7
nav_graph_offline.xml
app/src/main/res/navigation/nav_graph_offline.xml
+17
-0
nav_graph_settings.xml
app/src/main/res/navigation/nav_graph_settings.xml
+0
-52
dimens.xml
app/src/main/res/values/dimens.xml
+5
-0
strings.xml
app/src/main/res/values/strings.xml
+4
-0
No files found.
.idea/misc.xml
View file @
2fed12d2
...
...
@@ -40,9 +40,10 @@
<entry
key=
"app/src/main/res/drawable/ic_vector_error.xml"
value=
"0.20694444444444443"
/>
<entry
key=
"app/src/main/res/drawable/radius_top.xml"
value=
"0.25416666666666665"
/>
<entry
key=
"app/src/main/res/drawable/text_handle.xml"
value=
"1.4214285714285715"
/>
<entry
key=
"app/src/main/res/layout/activity_auth.xml"
value=
"0.
3416666666666667
"
/>
<entry
key=
"app/src/main/res/layout/activity_auth.xml"
value=
"0.
15853658536585366
"
/>
<entry
key=
"app/src/main/res/layout/activity_language.xml"
value=
"0.25"
/>
<entry
key=
"app/src/main/res/layout/activity_main.xml"
value=
"0.22"
/>
<entry
key=
"app/src/main/res/layout/activity_offline.xml"
value=
"0.244921875"
/>
<entry
key=
"app/src/main/res/layout/activity_pin.xml"
value=
"0.3052536231884058"
/>
<entry
key=
"app/src/main/res/layout/activity_services.xml"
value=
"0.25625"
/>
<entry
key=
"app/src/main/res/layout/activity_services2.xml"
value=
"0.266796875"
/>
...
...
@@ -53,6 +54,7 @@
<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_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_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_change_password.xml"
value=
"0.25625"
/>
...
...
app/src/main/AndroidManifest.xml
View file @
2fed12d2
...
...
@@ -12,9 +12,9 @@
<application
android:name=
".dev.app.App"
android:allowBackup=
"true"
android:hardwareAccelerated=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:hardwareAccelerated=
"true"
android:networkSecurityConfig=
"@xml/network_security_config"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
...
...
@@ -44,6 +44,12 @@
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"adjustResize"
/>
<activity
android:name=
".dev.OfflineActivity"
android:configChanges=
"orientation"
android:exported=
"false"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"adjustResize"
/>
<activity
android:name=
".dev.MainActivity"
android:configChanges=
"orientation"
android:exported=
"false"
...
...
@@ -55,7 +61,6 @@
android:exported=
"false"
android:screenOrientation=
"portrait"
android:windowSoftInputMode=
"adjustResize"
/>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/com/mobiuz/app/dev/MainActivity.kt
View file @
2fed12d2
...
...
@@ -165,6 +165,7 @@ class MainActivity : AppCompatActivity() {
override
fun
onStop
()
{
super
.
onStop
()
pref
.
blockedTime
=
System
.
currentTimeMillis
()
bn
.
drawerLayout
.
closeDrawer
(
GravityCompat
.
START
)
}
...
...
@@ -183,18 +184,15 @@ class MainActivity : AppCompatActivity() {
intent
?.
let
{
val
arg
=
it
.
getStringExtra
(
CONSTANTS
.
FIRST
)
?:
""
if
(
arg
.
isEmpty
())
{
val
dialog
=
FullScreenDialog
()
dialog
.
setOnPinDoneListener
{
showFullScreenDialog
{
finish
()
pref
.
clearUserData
()
val
intent
=
Intent
(
this
,
AuthActivity
::
class
.
java
)
intent
.
putExtra
(
CONSTANTS
.
TYPE_AUTH
,
CONSTANTS
.
LOGIN
)
intent
.
putExtra
(
CONSTANTS
.
PHONE
,
pref
.
userPhone
)
// intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_TASK_ON_HOME
startActivity
(
intent
)
dialog
.
dismiss
()
it
.
dismiss
()
}
dialog
.
show
(
supportFragmentManager
,
"tag"
)
}
it
.
removeExtra
(
CONSTANTS
.
FIRST
)
}
...
...
app/src/main/java/com/mobiuz/app/dev/model/SharedPref.kt
View file @
2fed12d2
...
...
@@ -79,4 +79,9 @@ class SharedPref @Inject constructor(@ApplicationContext context: Context) {
mySharedPref
.
edit
().
putBoolean
(
::
isShowPin
.
name
,
value
).
apply
()
}
var
blockedTime
:
Long
get
()
=
mySharedPref
.
getLong
(
::
blockedTime
.
name
,
0
)
set
(
value
)
{
mySharedPref
.
edit
().
putLong
(
::
blockedTime
.
name
,
value
).
apply
()
}
}
\ No newline at end of file
app/src/main/java/com/mobiuz/app/dev/ui/global/CONSTANTS.kt
View file @
2fed12d2
...
...
@@ -32,10 +32,12 @@ object CONSTANTS {
const
val
PHONE3
=
"+998 97 203 10 10"
const
val
SERVICE
=
"service"
const
val
TYPE_PASSWORD
=
"TYPE_PASSWORD"
const
val
OFFLINE
=
"offline"
const
val
CURRENT_PASSWORD
=
"CURRENT_PASSWORD"
const
val
NEW_PASSWORD
=
"NEW_PASSWORD"
const
val
CONFIRM_NEW_PASSWORD
=
"CONFIRM_NEW_PASSWORD"
const
val
DEFAULT_PHONE
=
"+998 97 999-99-99"
const
val
FULL_SCREEN_DIALOG
=
"full_screen_dialog"
const
val
LONGITUDE
=
69.2602108116081
const
val
LATITUDE
=
41.34823322480444
...
...
app/src/main/java/com/mobiuz/app/dev/ui/home/HomeFragment.kt
View file @
2fed12d2
...
...
@@ -60,9 +60,7 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) {
bn
.
apply
{
btnAddSum
.
setOnClickListener
{
navController
.
navigate
(
R
.
id
.
addFragment
)
// parentFragmentManager.beginTransaction().replace(R.id.nav_host_fragment,AddCardFragment)
// startActivity(Intent(requireContext()))
navController
.
navigate
(
R
.
id
.
billingFragment
)
}
toolbar
.
setNavigationOnClickListener
{
mainViewModel
.
mainIndex
(
System
.
currentTimeMillis
())
...
...
app/src/main/java/com/mobiuz/app/dev/utils/extensions/StringExtension.kt
View file @
2fed12d2
...
...
@@ -21,10 +21,12 @@ import androidx.recyclerview.widget.RecyclerView
import
com.google.android.material.textfield.TextInputEditText
import
com.google.gson.JsonSyntaxException
import
com.mobiuz.app.R
import
com.mobiuz.app.dev.model.SharedPref
import
com.mobiuz.app.dev.model.UzRuEn
import
com.mobiuz.app.dev.network.model.Errors
import
com.mobiuz.app.dev.ui.global.CONSTANTS
import
com.mobiuz.app.dev.ui.global.ExitDialog
import
com.mobiuz.app.dev.ui.global.FullScreenDialog
import
com.mobiuz.app.dev.ui.global.SenderDialog
import
retrofit2.HttpException
import
java.io.IOException
...
...
@@ -42,6 +44,22 @@ fun Fragment.showCustomDialog(description:String,status:Boolean, block: () -> Un
}
dialog
.
show
(
childFragmentManager
,
"tab"
)
}
fun
FragmentActivity
.
showFullScreenDialog
(
block
:
(
dialog
:
FullScreenDialog
)
->
Unit
){
val
time
=
SharedPref
(
this
).
blockedTime
if
(
time
<
System
.
currentTimeMillis
()
-
5000
){
val
fragment
=
supportFragmentManager
.
findFragmentByTag
(
CONSTANTS
.
FULL_SCREEN_DIALOG
)
if
(
fragment
==
null
){
val
dialog
=
FullScreenDialog
()
dialog
.
setOnPinDoneListener
{
block
(
dialog
)
}
dialog
.
show
(
supportFragmentManager
,
CONSTANTS
.
FULL_SCREEN_DIALOG
)
}
}
}
fun
Activity
.
showMessage
(
message
:
String
)
{
Toast
.
makeText
(
this
,
message
,
Toast
.
LENGTH_SHORT
).
show
()
}
...
...
app/src/main/res/drawable/ic_dashboard_black_24dp.xml
0 → 100644
View file @
2fed12d2
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z"
/>
</vector>
app/src/main/res/drawable/ic_home_black_24dp.xml
0 → 100644
View file @
2fed12d2
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"
/>
</vector>
app/src/main/res/drawable/ic_notifications_black_24dp.xml
0 → 100644
View file @
2fed12d2
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"
/>
</vector>
app/src/main/res/layout/activity_settings.xml
View file @
2fed12d2
...
...
@@ -12,7 +12,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:defaultNavHost=
"true"
app:navGraph=
"@navigation/nav_graph_
settings
"
app:navGraph=
"@navigation/nav_graph_
offline
"
tools:context=
".dev.ui.auth.AuthActivity"
/>
</LinearLayout>
app/src/main/res/navigation/nav_graph_home.xml
View file @
2fed12d2
...
...
@@ -11,13 +11,6 @@
android:label=
"fragment_home"
tools:layout=
"@layout/fragment_home"
/>
<fragment
android:id=
"@+id/addFragment"
android:name=
"uz.agr.delta.ui.card.add.AddCardFragment"
android:label=
"fragment_add"
tools:layout=
"@layout/agr_fragment_add_card"
/>
<fragment
android:id=
"@+id/languageFragment"
...
...
@@ -56,5 +49,10 @@
android:id=
"@+id/confirmNewPinFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.safety.pin.ConfirmNewPinFragment"
android:label=
"ConfirmNewPinFragment"
/>
<fragment
android:id=
"@+id/billingFragment"
android:name=
"com.mobiuz.app.BillingFragment"
android:label=
"fragment_billing"
tools:layout=
"@layout/fragment_billing"
/>
</navigation>
\ No newline at end of file
app/src/main/res/navigation/nav_graph_offline.xml
0 → 100644
View file @
2fed12d2
<?xml version="1.0" encoding="utf-8"?>
<navigation
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/nav_graph_settings"
app:startDestination=
"@id/serviceFragment"
>
<fragment
android:id=
"@+id/serviceFragment"
tools:layout=
"@layout/fragment_service"
android:name=
"com.mobiuz.app.dev.ui.service.ServiceFragment"
android:label=
"MotionFragment"
/>
<fragment
android:id=
"@+id/servicesFragmentActivity"
android:name=
"com.mobiuz.app.dev.ui.service.ServicesFragmentActivity"
android:label=
"ServicesFragmentActivity"
/>
</navigation>
\ No newline at end of file
app/src/main/res/navigation/nav_graph_settings.xml
deleted
100644 → 0
View file @
23e85d59
<?xml version="1.0" encoding="utf-8"?>
<navigation
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/nav_graph_settings"
app:startDestination=
"@id/languageFragment"
>
<fragment
android:id=
"@+id/languageFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.LanguageFragment"
android:label=
"fragment_language"
tools:layout=
"@layout/fragment_language"
/>
<fragment
android:id=
"@+id/supportFragment"
tools:layout=
"@layout/fragment_support"
android:name=
"com.mobiuz.app.dev.ui.settings.SupportFragment"
android:label=
"SupportFragment"
/>
<fragment
android:id=
"@+id/safetyFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.safety.SafetyFragment"
android:label=
"fragment_safety"
tools:layout=
"@layout/fragment_safety"
/>
<fragment
android:id=
"@+id/profileFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.ProfileFragment"
android:label=
"fragment_profile"
tools:layout=
"@layout/fragment_profile"
/>
<fragment
android:id=
"@+id/currentPasswordFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.safety.password.ChangePasswordFragment"
android:label=
"CurrentPasswordFragment"
/>
<fragment
android:id=
"@+id/newPasswordFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.safety.password.NewPasswordFragment"
android:label=
"NewPasswordFragment"
/>
<fragment
android:id=
"@+id/confirmPasswordFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.safety.password.ConfirmPasswordFragment"
android:label=
"ConfirmPasswordFragment"
/>
<fragment
android:id=
"@+id/oldPinFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.safety.pin.OldPinFragment"
android:label=
"OldPinFragment"
/>
<fragment
android:id=
"@+id/newPinFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.safety.pin.NewPinFragment"
android:label=
"NewPinFragment"
/>
<fragment
android:id=
"@+id/confirmNewPinFragment"
android:name=
"com.mobiuz.app.dev.ui.settings.safety.pin.ConfirmNewPinFragment"
android:label=
"ConfirmNewPinFragment"
/>
</navigation>
\ No newline at end of file
app/src/main/res/values/dimens.xml
0 → 100644
View file @
2fed12d2
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen
name=
"activity_horizontal_margin"
>
16dp
</dimen>
<dimen
name=
"activity_vertical_margin"
>
16dp
</dimen>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
2fed12d2
...
...
@@ -128,5 +128,9 @@
<string
name=
"close_process"
>
Закрыть
</string>
<string
name=
"popitok_error_password"
>
Вы ввели неправильный пароль 3 раза
</string>
<string
name=
"settings_safety"
>
Настройки безопасности действуют только для основного номера +998 97 999-99-99
</string>
<string
name=
"title_activity_offline"
>
OfflineActivity
</string>
<string
name=
"title_home"
>
Home
</string>
<string
name=
"title_dashboard"
>
Dashboard
</string>
<string
name=
"title_notifications"
>
Notifications
</string>
</resources>
\ 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