Skip to content

Commit

Permalink
Improve visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-BaptisteC committed Nov 26, 2023
1 parent 5042615 commit c3236dc
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
}
}

Expand All @@ -135,7 +143,6 @@ class AppsFragment : Fragment(R.layout.fragment_apps) {
action = ExodusUpdateService.START_SERVICE
activity?.startService(this)
}
binding.progress.visibility = View.VISIBLE
}
}
}

0 comments on commit c3236dc

Please sign in to comment.