Update parseNumericAddress on Android Q
This commit is contained in:
@@ -9,8 +9,7 @@ if (!getGradle().getStartParameter().getTaskRequests().toString().contains("Fdro
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
buildToolsVersion "28.0.3"
|
compileSdkVersion 'android-Q'
|
||||||
compileSdkVersion 28
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility 1.8
|
sourceCompatibility 1.8
|
||||||
targetCompatibility 1.8
|
targetCompatibility 1.8
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package be.mygod.vpnhotspot.util
|
package be.mygod.vpnhotspot.util
|
||||||
|
|
||||||
import android.content.*
|
import android.content.*
|
||||||
|
import android.net.InetAddresses
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.text.Spannable
|
import android.text.Spannable
|
||||||
import android.text.SpannableString
|
import android.text.SpannableString
|
||||||
@@ -9,6 +10,7 @@ import android.view.View
|
|||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.annotation.DrawableRes
|
import androidx.annotation.DrawableRes
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
|
import androidx.core.os.BuildCompat
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.databinding.BindingAdapter
|
import androidx.databinding.BindingAdapter
|
||||||
import be.mygod.vpnhotspot.App.Companion.app
|
import be.mygod.vpnhotspot.App.Companion.app
|
||||||
@@ -76,7 +78,8 @@ private val parseNumericAddress by lazy {
|
|||||||
isAccessible = true
|
isAccessible = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fun parseNumericAddress(address: String) = parseNumericAddress.invoke(null, address) as InetAddress
|
fun parseNumericAddress(address: String) = if (BuildCompat.isAtLeastQ())
|
||||||
|
InetAddresses.parseNumericAddress(address) else parseNumericAddress.invoke(null, address) as InetAddress
|
||||||
|
|
||||||
fun Context.launchUrl(url: String) {
|
fun Context.launchUrl(url: String) {
|
||||||
if (app.hasTouch) try {
|
if (app.hasTouch) try {
|
||||||
|
|||||||
Reference in New Issue
Block a user