Update support lib to 28.0.0-alpha3

This commit is contained in:
Mygod
2018-06-10 22:28:09 +08:00
parent 3fbca0abef
commit 814f42311b
15 changed files with 80 additions and 8 deletions

View File

@@ -13,6 +13,7 @@ import android.preference.PreferenceManager
import android.support.annotation.StringRes
import android.widget.Toast
import be.mygod.vpnhotspot.util.Event0
import be.mygod.vpnhotspot.util.systemService
class App : Application() {
companion object {
@@ -43,8 +44,8 @@ class App : Application() {
lateinit var deviceContext: Context
val handler = Handler()
val pref: SharedPreferences by lazy { PreferenceManager.getDefaultSharedPreferences(deviceContext) }
val connectivity by lazy { getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager }
val wifi by lazy { app.getSystemService(Context.WIFI_SERVICE) as WifiManager }
val connectivity by lazy { systemService<ConnectivityManager>() }
val wifi by lazy { systemService<WifiManager>() }
val operatingChannel: Int get() {
val result = pref.getString(KEY_OPERATING_CHANNEL, null)?.toIntOrNull() ?: 0