From 1f8489834b1f8f302fc9c3cc9688964e4691db3e Mon Sep 17 00:00:00 2001 From: Jean-Baptiste <87148630+Jean-BaptisteC@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:56:47 +0100 Subject: [PATCH] Implement progress bar to know when app refresh reports (#358) * Add progress bar * Improve visibility --- .../exodusprivacy/fragments/apps/AppsFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) 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 0a78f996..bbcba021 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 @@ -42,6 +42,7 @@ class AppsFragment : Fragment(R.layout.fragment_apps) { reenterTransition = MaterialFadeThrough() returnTransition = MaterialFadeThrough() + val progressBar = binding.progress val updateReportsFab = binding.updateReportsFAB // Setup menu actions @@ -101,6 +102,7 @@ class AppsFragment : Fragment(R.layout.fragment_apps) { if (!it.isNullOrEmpty()) { binding.swipeRefreshLayout.visibility = View.VISIBLE binding.shimmerLayout.visibility = View.GONE + progressBar.visibility = View.GONE appsRVAdapter.submitList(it) } else { binding.swipeRefreshLayout.visibility = View.VISIBLE @@ -111,10 +113,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 } }