mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-19 09:45:10 +00:00
import cleanup
This commit is contained in:
parent
b8ac9c80a4
commit
5b9665a364
1 changed files with 2 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue