mirror of
https://github.com/openlibrecommunity/olcng.git
synced 2026-07-03 14:05:17 +02:00
feat(MainActivity): add subscription update before ping test with loading indicator
This commit is contained in:
@@ -221,9 +221,27 @@ class MainActivity : HelperBaseActivity(), NavigationView.OnNavigationItemSelect
|
||||
V2RayServiceManager.stopVService(this)
|
||||
}
|
||||
|
||||
showStatus("Выполняется замер задержки. Ожидаем завершения...")
|
||||
showStatus("Обновление профилей...")
|
||||
showLoading()
|
||||
isLiteTesting = true
|
||||
mainViewModel.testAllRealPing()
|
||||
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
val result = mainViewModel.updateConfigViaSubAll()
|
||||
delay(500L)
|
||||
launch(Dispatchers.Main) {
|
||||
if (result.configCount > 0) {
|
||||
mainViewModel.reloadServerList()
|
||||
showStatus("Обновлено ${result.configCount} профилей. Запуск теста...")
|
||||
} else {
|
||||
showStatus("Запуск теста...")
|
||||
}
|
||||
hideLoading()
|
||||
|
||||
delay(500L)
|
||||
showStatus("Выполняется замер задержки. Ожидаем завершения...")
|
||||
mainViewModel.testAllRealPing()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun startV2RayWithPermission() {
|
||||
|
||||
Reference in New Issue
Block a user