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
533c8c3a
Commit
533c8c3a
authored
Dec 18, 2021
by
shohboz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPD]
MUS-191
Feature, updated settings screens scrolling and home page scrolling
parent
f9d9b438
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
396 additions
and
334 deletions
+396
-334
build.gradle
app/build.gradle
+1
-1
HomeFragment.kt
app/src/main/java/com/mobiuz/app/dev/ui/home/HomeFragment.kt
+22
-24
ServiceFragment.kt
...ain/java/com/mobiuz/app/dev/ui/service/ServiceFragment.kt
+1
-1
UssdFragment.kt
...c/main/java/com/mobiuz/app/dev/ui/service/UssdFragment.kt
+87
-0
SupportFragment.kt
...in/java/com/mobiuz/app/dev/ui/settings/SupportFragment.kt
+0
-2
SafetyFragment.kt
...a/com/mobiuz/app/dev/ui/settings/safety/SafetyFragment.kt
+1
-21
fragment_action.xml
app/src/main/res/layout/fragment_action.xml
+2
-2
fragment_home.xml
app/src/main/res/layout/fragment_home.xml
+4
-3
fragment_language.xml
app/src/main/res/layout/fragment_language.xml
+107
-96
fragment_safety.xml
app/src/main/res/layout/fragment_safety.xml
+120
-177
fragment_support.xml
app/src/main/res/layout/fragment_support.xml
+2
-3
fragment_ussd.xml
app/src/main/res/layout/fragment_ussd.xml
+44
-0
nav_graph_offline.xml
app/src/main/res/navigation/nav_graph_offline.xml
+2
-2
nav_graph_profile.xml
app/src/main/res/navigation/nav_graph_profile.xml
+3
-2
No files found.
app/build.gradle
View file @
533c8c3a
...
...
@@ -123,6 +123,6 @@ dependencies {
implementation
'io.github.everythingme:overscroll-decor-android:1.1.1'
//
implementation 'com.github.woxingxiao:BounceScrollView:1.5-androidx'
implementation
'com.github.woxingxiao:BounceScrollView:1.5-androidx'
}
\ No newline at end of file
app/src/main/java/com/mobiuz/app/dev/ui/home/HomeFragment.kt
View file @
533c8c3a
...
...
@@ -18,6 +18,7 @@ import com.mobiuz.app.dev.network.model.Customer
import
com.mobiuz.app.dev.network.model.UiStateObject
import
com.mobiuz.app.dev.ui.base.BaseFragment
import
com.mobiuz.app.dev.utils.extensions.*
import
com.xw.repo.widget.BounceScrollView
import
dagger.hilt.android.AndroidEntryPoint
import
kotlinx.coroutines.flow.collect
import
me.everything.android.ui.overscroll.OverScrollDecoratorHelper
...
...
@@ -62,40 +63,40 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) {
btnAddSum
.
setOnClickListener
{
// navController.navigate(R.id.billingFragment)
}
txtMyNumber
.
text
=
pref
.
userPhone
.
customMasketHome
().
replace
(
"-"
,
" "
)
toolbarMyNumber
.
text
=
pref
.
userPhone
.
customMasketHome
().
replace
(
"-"
,
" "
)
toolbar
.
setNavigationOnClickListener
{
mainViewModel
.
openDrawer
(
System
.
currentTimeMillis
())
}
scrollView
.
viewTreeObserver
.
addOnScrollChangedListener
{
if
(
scrollView
.
scrollY
<
100
)
{
bounceScrollView
.
setOnOverScrollListener
{
fromStart
,
overScrolledDistance
->
if
(
overScrolledDistance
>
120.52632
)
{
if
(!
isProgressing
)
{
vibrate
(
requireContext
())
viewModel
.
mainIndex
()
}
}
}
bounceScrollView
.
setOnScrollListener
{
_
,
scrollY
->
if
(
scrollY
<
1.0
)
{
lottie
.
isVisible
=
false
}
if
(
scrollY
<
100
)
{
toolbarInsideLayout
.
isVisible
=
false
topDiv
.
setBackgroundColor
(
Color
.
TRANSPARENT
)
toolbar
.
setBackgroundColor
(
Color
.
TRANSPARENT
)
}
if
(
scroll
View
.
scroll
Y
>
20
)
{
if
(
scrollY
>
20
)
{
toolbar
.
setBackgroundColor
(
getColorCompat
(
R
.
color
.
primary100
))
topDiv
.
setBackgroundColor
(
getColorCompat
(
R
.
color
.
primary100
))
}
if
(
scroll
View
.
scrollY
>
10
0
)
{
if
(
scroll
Y
>
9
0
)
{
toolbarInsideLayout
.
isVisible
=
true
}
}
val
decor
=
OverScrollDecoratorHelper
.
setUpOverScroll
(
scrollView
)
decor
.
setOverScrollUpdateListener
{
_
,
_
,
offset
->
if
(
offset
>
150.52632
)
{
if
(!
isProgressing
)
{
vibrate
(
requireContext
())
viewModel
.
mainIndex
()
}
}
if
(
offset
<
1.0
)
{
lottie
.
isVisible
=
false
}
}
}
}
...
...
@@ -152,9 +153,6 @@ class HomeFragment : BaseFragment(R.layout.fragment_home) {
txtTypeSms
.
text
=
it
?.
ITEM
?.
unit
?:
"sms"
}
mainViewModel
.
setUserName
(
customer
?.
customer
?.
name
?:
"Unnamed User"
)
txtMyNumber
.
text
=
pref
.
userPhone
.
customMasketHome
().
replace
(
"-"
,
" "
)
toolbarMyNumber
.
text
=
pref
.
userPhone
.
customMasketHome
().
replace
(
"-"
,
" "
)
}
}
}
catch
(
e
:
Exception
)
{
...
...
app/src/main/java/com/mobiuz/app/dev/ui/service/ServiceFragment.kt
View file @
533c8c3a
...
...
@@ -96,7 +96,7 @@ class ServiceFragment : BaseFragment(R.layout.fragment_service) {
private
fun
navigateToServiceScreen
(
key
:
ServiceData
)
{
navController
.
navigate
(
R
.
id
.
servicesFragmentActivity
,
bundleOf
(
CONSTANTS
.
SERVICE
to
Gson
().
toJson
(
key
)))
navController
.
navigate
(
R
.
id
.
ussdFragment
,
bundleOf
(
CONSTANTS
.
SERVICE
to
Gson
().
toJson
(
key
)))
mainViewModel
.
bottomSheet
(
false
)
}
...
...
app/src/main/java/com/mobiuz/app/dev/ui/service/
ServicesFragmentActivity
.kt
→
app/src/main/java/com/mobiuz/app/dev/ui/service/
UssdFragment
.kt
View file @
533c8c3a
...
...
@@ -9,7 +9,7 @@ import com.google.android.material.tabs.TabLayout.MODE_SCROLLABLE
import
com.google.android.material.tabs.TabLayoutMediator
import
com.google.gson.Gson
import
com.mobiuz.app.R
import
com.mobiuz.app.databinding.
ActivityServices
Binding
import
com.mobiuz.app.databinding.
FragmentUssd
Binding
import
com.mobiuz.app.dev.model.ServiceData
import
com.mobiuz.app.dev.model.SharedPref
import
com.mobiuz.app.dev.ui.base.BaseFragment
...
...
@@ -19,9 +19,9 @@ import dagger.hilt.android.AndroidEntryPoint
import
javax.inject.Inject
@AndroidEntryPoint
class
ServicesFragmentActivity
:
BaseFragment
(
R
.
layout
.
activity_services
)
{
class
UssdFragment
:
BaseFragment
(
R
.
layout
.
fragment_ussd
)
{
private
var
_bn
:
ActivityServices
Binding
?
=
null
private
var
_bn
:
FragmentUssd
Binding
?
=
null
private
val
bn
get
()
=
_bn
?:
throw
NullPointerException
(
"cannot inflate"
)
@Inject
...
...
@@ -41,7 +41,7 @@ class ServicesFragmentActivity : BaseFragment(R.layout.activity_services) {
}
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
_bn
=
ActivityServices
Binding
.
bind
(
view
)
_bn
=
FragmentUssd
Binding
.
bind
(
view
)
setUpUI
()
collects
()
}
...
...
@@ -63,7 +63,7 @@ class ServicesFragmentActivity : BaseFragment(R.layout.activity_services) {
tabLayout
.
tabMode
=
MODE_SCROLLABLE
}
adapter
=
FragmentPagerAdapter
(
this
@
ServicesFragmentActivity
,
it
)
adapter
=
FragmentPagerAdapter
(
this
@
UssdFragment
,
it
)
viewPager
.
adapter
=
adapter
TabLayoutMediator
(
bn
.
tabLayout
,
bn
.
viewPager
)
{
tab
,
pos
->
...
...
app/src/main/java/com/mobiuz/app/dev/ui/settings/SupportFragment.kt
View file @
533c8c3a
...
...
@@ -39,8 +39,6 @@ class SupportFragment : BaseFragment(R.layout.fragment_support) {
navController
.
navigateUp
()
}
OverScrollDecoratorHelper
.
setUpOverScroll
(
bn
.
scrollView
)
txtPhone1
.
text
=
CONSTANTS
.
PHONE1
txtPhone2
.
text
=
CONSTANTS
.
PHONE2
txtPhone3
.
text
=
CONSTANTS
.
PHONE3
...
...
app/src/main/java/com/mobiuz/app/dev/ui/settings/safety/SafetyFragment.kt
View file @
533c8c3a
...
...
@@ -37,6 +37,7 @@ class SafetyFragment : BaseFragment(R.layout.fragment_safety) {
override
fun
setUpUI
()
{
bn
.
apply
{
toolbar
.
setNavigationOnClickListener
{
navController
.
navigateUp
()
}
...
...
@@ -63,27 +64,6 @@ class SafetyFragment : BaseFragment(R.layout.fragment_safety) {
navController
.
navigate
(
R
.
id
.
changePasswordFragment
,
bundleOf
(
CONSTANTS
.
TYPE_PASSWORD
to
CONSTANTS
.
CURRENT_PASSWORD
),
Utils
.
navOptions
())
}
})
btn4
.
setOnClickListener
(
object
:
ButtonClick
(){
override
fun
onSingleClick
(
v
:
View
?)
{
}
})
btn5
.
setOnClickListener
(
object
:
ButtonClick
(){
override
fun
onSingleClick
(
v
:
View
?)
{
}
})
seekbar
.
setOnSeekBarChangeListener
(
object
:
SeekBar
.
OnSeekBarChangeListener
{
override
fun
onProgressChanged
(
seekBar
:
SeekBar
?,
progress
:
Int
,
fromUser
:
Boolean
)
{
}
override
fun
onStartTrackingTouch
(
seekBar
:
SeekBar
?)
{
}
override
fun
onStopTrackingTouch
(
seekBar
:
SeekBar
?)
{
showMessage
(
"${seekBar}"
)
}
})
}
}
...
...
app/src/main/res/layout/fragment_action.xml
View file @
533c8c3a
<?xml version="1.0" encoding="utf-8"?>
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
com.xw.repo.widget.BounceScrollView
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"
...
...
@@ -16,4 +16,4 @@
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem=
"@layout/item_ussd"
/>
</LinearLayout>
\ No newline at end of file
</com.xw.repo.widget.BounceScrollView>
\ No newline at end of file
app/src/main/res/layout/fragment_home.xml
View file @
533c8c3a
...
...
@@ -75,8 +75,9 @@
app:lottie_rawRes=
"@raw/rifki_loading"
app:lottie_speed=
"1"
tools:ignore=
"ContentDescription"
/>
<ScrollView
android:id=
"@+id/scrollView"
<com.xw.repo.widget.BounceScrollView
android:id=
"@+id/bounce_scrollView"
android:clipToPadding=
"true"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
...
...
@@ -393,7 +394,7 @@
</LinearLayout>
</ScrollView>
</
com.xw.repo.widget.Bounce
ScrollView>
</FrameLayout>
...
...
app/src/main/res/layout/fragment_language.xml
View file @
533c8c3a
...
...
@@ -14,103 +14,114 @@
app:title=
"@string/language_app"
/>
<LinearLayout
android:id=
"@+id/uzbek_lang"
<com.xw.repo.widget.BounceScrollView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"27dp"
android:background=
"?android:selectableItemBackground"
android:paddingHorizontal=
"@dimen/_16sdp"
android:paddingVertical=
"@dimen/_12sdp"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_uzbekistan"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/_12sdp"
android:layout_weight=
"1"
android:text=
"@string/uzbek"
android:textColor=
"@color/black100"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/image_uzbek"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:src=
"@drawable/ic_vector_checked"
android:visibility=
"invisible"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/russian_lang"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginVertical=
"@dimen/_12sdp"
android:background=
"?android:selectableItemBackground"
android:paddingHorizontal=
"@dimen/_16sdp"
android:paddingVertical=
"@dimen/_12sdp"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_russia"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/_12sdp"
android:layout_weight=
"1"
android:text=
"@string/russian"
android:textColor=
"@color/black100"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/image_russian"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:src=
"@drawable/ic_vector_checked"
android:visibility=
"invisible"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/english_lang"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"?android:selectableItemBackground"
android:paddingHorizontal=
"@dimen/_16sdp"
android:paddingVertical=
"@dimen/_12sdp"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_united_kingdom"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/_12sdp"
android:layout_weight=
"1"
android:text=
"@string/english"
android:textColor=
"@color/black100"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/image_english"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:src=
"@drawable/ic_vector_checked"
android:visibility=
"invisible"
/>
</LinearLayout>
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/uzbek_lang"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"27dp"
android:background=
"?android:selectableItemBackground"
android:paddingHorizontal=
"@dimen/_16sdp"
android:paddingVertical=
"@dimen/_12sdp"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_uzbekistan"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/_12sdp"
android:layout_weight=
"1"
android:text=
"@string/uzbek"
android:textColor=
"@color/black100"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/image_uzbek"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:src=
"@drawable/ic_vector_checked"
android:visibility=
"invisible"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/russian_lang"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginVertical=
"@dimen/_12sdp"
android:background=
"?android:selectableItemBackground"
android:paddingHorizontal=
"@dimen/_16sdp"
android:paddingVertical=
"@dimen/_12sdp"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_russia"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/_12sdp"
android:layout_weight=
"1"
android:text=
"@string/russian"
android:textColor=
"@color/black100"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/image_russian"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:src=
"@drawable/ic_vector_checked"
android:visibility=
"invisible"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/english_lang"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"?android:selectableItemBackground"
android:paddingHorizontal=
"@dimen/_16sdp"
android:paddingVertical=
"@dimen/_12sdp"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_united_kingdom"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/_12sdp"
android:layout_weight=
"1"
android:text=
"@string/english"
android:textColor=
"@color/black100"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/image_english"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:src=
"@drawable/ic_vector_checked"
android:visibility=
"invisible"
/>
</LinearLayout>
</LinearLayout>
</com.xw.repo.widget.BounceScrollView>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/fragment_safety.xml
View file @
533c8c3a
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/fragment_support.xml
View file @
533c8c3a
...
...
@@ -15,9 +15,8 @@
app:navigationIcon=
"@drawable/ic_baseline_arrow_back"
/>
<ScrollView
<
com.xw.repo.widget.Bounce
ScrollView
android:layout_width=
"match_parent"
android:id=
"@+id/scrollView"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -223,7 +222,7 @@
</LinearLayout>
</LinearLayout>
</ScrollView>
</
com.xw.repo.widget.Bounce
ScrollView>
...
...
app/src/main/res/layout/
activity_services
.xml
→
app/src/main/res/layout/
fragment_ussd
.xml
View file @
533c8c3a
...
...
@@ -35,6 +35,8 @@
<androidx.viewpager2.widget.ViewPager2
android:id=
"@+id/view_pager"
android:scrollbars=
"none"
android:overScrollMode=
"never"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
...
...
app/src/main/res/navigation/nav_graph_offline.xml
View file @
533c8c3a
...
...
@@ -10,8 +10,8 @@
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:id=
"@+id/
ussdFragment
"
android:name=
"com.mobiuz.app.dev.ui.service.
UssdFragment
"
android:label=
"ServicesFragmentActivity"
/>
</navigation>
\ No newline at end of file
app/src/main/res/navigation/nav_graph_profile.xml
View file @
533c8c3a
...
...
@@ -11,8 +11,9 @@
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:id=
"@+id/ussdFragment"
tools:layout=
"@layout/fragment_ussd"
android:name=
"com.mobiuz.app.dev.ui.service.UssdFragment"
android:label=
"ServicesFragmentActivity"
/>
<fragment
...
...
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