mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
commit
ea59effff8
@ -170,7 +170,7 @@ class PlayerFragment : Fragment() {
|
|||||||
autoRotationEnabled = PreferenceHelper.getBoolean(
|
autoRotationEnabled = PreferenceHelper.getBoolean(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
"auto_fullscreen",
|
"auto_fullscreen",
|
||||||
true
|
false
|
||||||
)
|
)
|
||||||
val mainActivity = activity as MainActivity
|
val mainActivity = activity as MainActivity
|
||||||
if (autoRotationEnabled) {
|
if (autoRotationEnabled) {
|
||||||
|
@ -9,6 +9,9 @@ object ConnectionHelper {
|
|||||||
fun isNetworkAvailable(context: Context): Boolean {
|
fun isNetworkAvailable(context: Context): Boolean {
|
||||||
val connectivityManager =
|
val connectivityManager =
|
||||||
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||||
|
|
||||||
|
// this seems to not recognize vpn connections
|
||||||
|
/*
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
val nw = connectivityManager.activeNetwork ?: return false
|
val nw = connectivityManager.activeNetwork ?: return false
|
||||||
val actNw = connectivityManager.getNetworkCapabilities(nw) ?: return false
|
val actNw = connectivityManager.getNetworkCapabilities(nw) ?: return false
|
||||||
@ -28,5 +31,8 @@ object ConnectionHelper {
|
|||||||
} else {
|
} else {
|
||||||
return connectivityManager.activeNetworkInfo?.isConnected ?: false
|
return connectivityManager.activeNetworkInfo?.isConnected ?: false
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
return connectivityManager.activeNetworkInfo?.isConnected ?: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user