From c3236dcf2902fc718651f2abae9562262ba64856 Mon Sep 17 00:00:00 2001 From: Jean-BaptisteC Date: Sun, 26 Nov 2023 17:32:05 +0100 Subject: [PATCH] Improve visibility --- .../exodusprivacy/fragments/apps/AppsFragment.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 } } }