Skip to content

Commit

Permalink
Implement progress bar to know when app refresh reports (#358)
Browse files Browse the repository at this point in the history
* Add progress bar

* Improve visibility
  • Loading branch information
Jean-BaptisteC authored Dec 9, 2023
1 parent 1579260 commit 1f84898
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
}
}

Expand Down

0 comments on commit 1f84898

Please sign in to comment.