0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-27 13:33:00 +00:00

fixed network issue

This commit is contained in:
X1nto 2020-05-24 19:15:17 +04:00
parent 91503cf66c
commit f467c283fe

View file

@ -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()
}
}
}
}