diff --git a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/apps/AppsFragment.kt b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/apps/AppsFragment.kt index 92bc3481..107c2e33 100644 --- a/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/apps/AppsFragment.kt +++ b/app/src/main/java/org/eu/exodus_privacy/exodusprivacy/fragments/apps/AppsFragment.kt @@ -41,6 +41,7 @@ class AppsFragment : Fragment(R.layout.fragment_apps) { reenterTransition = MaterialFadeThrough() returnTransition = MaterialFadeThrough() + val progressBar = binding.progress val updateReportsFab = binding.updateReportsFAB // Setup menu actions @@ -62,6 +63,11 @@ class AppsFragment : Fragment(R.layout.fragment_apps) { } true } + if(!ExodusUpdateService.IS_SERVICE_RUNNING){ + progressBar.visibility = View.GONE + } else { + progressBar.visibility = View.VISIBLE + } // Setup RecyclerView val appsRVAdapter = AppsRVAdapter(findNavController().currentDestination!!.id) @@ -94,7 +100,7 @@ class AppsFragment : Fragment(R.layout.fragment_apps) { if (!it.isNullOrEmpty()) { binding.swipeRefreshLayout.visibility = View.VISIBLE binding.shimmerLayout.visibility = View.GONE - binding.progress.visibility = View.GONE + progressBar.visibility = View.GONE appsRVAdapter.submitList(it) } else { binding.swipeRefreshLayout.visibility = View.VISIBLE @@ -105,10 +111,12 @@ class AppsFragment : Fragment(R.layout.fragment_apps) { binding.swipeRefreshLayout.setOnRefreshListener { binding.swipeRefreshLayout.isRefreshing = false updateReports(view.context) + progressBar.visibility = View.VISIBLE } updateReportsFab.setOnClickListener { updateReports(view.context) + progressBar.visibility = View.VISIBLE } } @@ -135,7 +143,6 @@ class AppsFragment : Fragment(R.layout.fragment_apps) { action = ExodusUpdateService.START_SERVICE activity?.startService(this) } - binding.progress.visibility = View.VISIBLE } } }