mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-27 13:33:00 +00:00
fixed network issue
This commit is contained in:
parent
91503cf66c
commit
f467c283fe
1 changed files with 18 additions and 21 deletions
|
@ -66,14 +66,13 @@ class HomeFragment : Home() {
|
|||
}
|
||||
|
||||
private fun checkNetwork() {
|
||||
val networkErrorLayout = view?.findViewById<MaterialCardView>(R.id.home_network_wrapper)
|
||||
|
||||
val networkErrorLayout = view?.findViewById<MaterialCardView>(R.id.home_network_wrapper)
|
||||
disposable = ReactiveNetwork.observeInternetConnectivity()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe { isConnectedToInternet ->
|
||||
if (isConnectedToInternet) {
|
||||
if (networkErrorLayout?.visibility != View.GONE) {
|
||||
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0f, 0.3f)
|
||||
val oa3 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, -1f)
|
||||
|
||||
|
@ -84,9 +83,7 @@ class HomeFragment : Home() {
|
|||
})
|
||||
start()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (networkErrorLayout?.visibility != View.VISIBLE) {
|
||||
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", -1f, 0.3f)
|
||||
val oa3 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, 0f)
|
||||
|
||||
|
@ -97,7 +94,7 @@ class HomeFragment : Home() {
|
|||
start()
|
||||
}
|
||||
oa3.start()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue