0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-19 09:45:10 +00:00

import cleanup

This commit is contained in:
X1nto 2020-07-04 19:16:46 +04:00
parent b8ac9c80a4
commit 5b9665a364

View file

@ -5,7 +5,6 @@ import android.content.Intent
import android.net.Uri import android.net.Uri
import androidx.browser.customtabs.CustomTabsIntent import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.preference.PreferenceManager
import androidx.preference.PreferenceManager.getDefaultSharedPreferences import androidx.preference.PreferenceManager.getDefaultSharedPreferences
import androidx.viewbinding.BuildConfig import androidx.viewbinding.BuildConfig
import com.dezlum.codelabs.getjson.GetJson import com.dezlum.codelabs.getjson.GetJson
@ -27,7 +26,7 @@ object InternetTools {
fun getFileNameFromUrl(url: String) = url.substring(url.lastIndexOf('/')+1, url.length) fun getFileNameFromUrl(url: String) = url.substring(url.lastIndexOf('/')+1, url.length)
fun displayJsonString(json: String, obj: String, context: Context): String { fun displayJsonString(json: String, obj: String, context: Context): String {
val installUrl = PreferenceManager.getDefaultSharedPreferences(context).getString("install_url", baseUrl) val installUrl = getDefaultSharedPreferences(context).getString("install_url", baseUrl)
return if (GetJson().isConnected(context)) return if (GetJson().isConnected(context))
GetJson().AsJSONObject("$installUrl/$json").get(obj).asString GetJson().AsJSONObject("$installUrl/$json").get(obj).asString
else else
@ -35,7 +34,7 @@ object InternetTools {
} }
fun displayJsonInt(json: String, obj: String, context: Context): Int { fun displayJsonInt(json: String, obj: String, context: Context): Int {
val installUrl = PreferenceManager.getDefaultSharedPreferences(context).getString("install_url", baseUrl) val installUrl = getDefaultSharedPreferences(context).getString("install_url", baseUrl)
return if (GetJson().isConnected(context)) return if (GetJson().isConnected(context))
GetJson().AsJSONObject("$installUrl/$json").get(obj).asInt GetJson().AsJSONObject("$installUrl/$json").get(obj).asInt
else else