Use the repository to fetch the api Version

This commit is contained in:
davide 2022-07-24 03:45:54 +02:00
parent dbbc191704
commit da088ec89e

View File

@ -213,7 +213,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
handleSettings() handleSettings()
getApiMajorVersion() apiVersionMajor = repository.apiMajorVersion
getElementsAccordingToTab() getElementsAccordingToTab()
} }
@ -344,16 +344,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
} }
} }
private fun getApiMajorVersion() {
CoroutineScope(Dispatchers.IO).launch {
val version = api.version()
if (version != null) {
apiVersionMajor = version.getApiMajorVersion()
settings.putInt("apiVersionMajor", apiVersionMajor)
}
}
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()