removed ui blocking methods in changelogs
This commit is contained in:
parent
f03e681ea8
commit
bce75c1b22
|
@ -8,8 +8,9 @@ import android.widget.TextView
|
|||
import androidx.fragment.app.Fragment
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.utils.InternetTools
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
class ManagerChangelogFragment : Fragment() {
|
||||
|
||||
|
@ -22,11 +23,9 @@ class ManagerChangelogFragment : Fragment() {
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
runBlocking {
|
||||
launch {
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
val changelog = InternetTools.getObjectFromJson("https://x1nto.github.io/VancedFiles/manager.json", "changelog")
|
||||
view.findViewById<TextView>(R.id.manager_changelog).text = changelog
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,9 @@ import androidx.fragment.app.Fragment
|
|||
import androidx.preference.PreferenceManager
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.utils.InternetTools
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
class MicrogChangelogFragment : Fragment() {
|
||||
|
||||
|
@ -23,12 +24,9 @@ class MicrogChangelogFragment : Fragment() {
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
runBlocking {
|
||||
launch {
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
val baseUrl = PreferenceManager.getDefaultSharedPreferences(activity).getString("install_url", InternetTools.baseUrl)
|
||||
|
||||
view.findViewById<TextView>(R.id.microg_changelog).text = InternetTools.getObjectFromJson("$baseUrl/microg.json", "changelog")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,9 @@ import androidx.fragment.app.Fragment
|
|||
import androidx.preference.PreferenceManager
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.utils.InternetTools
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
class VancedChangelogFragment : Fragment() {
|
||||
|
||||
|
@ -23,8 +24,7 @@ class VancedChangelogFragment : Fragment() {
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
runBlocking {
|
||||
launch {
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
val vancedVersion = activity?.let { InternetTools.getJsonString("vanced.json", "version", it).replace('.', '_') }
|
||||
val baseUrl = PreferenceManager.getDefaultSharedPreferences(activity).getString("install_url", InternetTools.baseUrl)
|
||||
|
||||
|
@ -33,4 +33,3 @@ class VancedChangelogFragment : Fragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue