Use the repository to fetch the api Version
This commit is contained in:
parent
dbbc191704
commit
da088ec89e
@ -213,7 +213,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
|
||||
|
||||
handleSettings()
|
||||
|
||||
getApiMajorVersion()
|
||||
apiVersionMajor = repository.apiMajorVersion
|
||||
|
||||
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() {
|
||||
super.onResume()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user