Improve updates page UI + fix empty updates on refresh

This commit is contained in:
Rahul Patel
2024-07-20 23:55:51 +05:30
parent 8c7bf1b9bc
commit c406e56d6a
5 changed files with 26 additions and 19 deletions

View File

@@ -84,14 +84,14 @@ class AppUpdateView @JvmOverloads constructor(
context.getString(R.string.details_changelog_unavailable)
binding.headerIndicator.setOnClickListener {
if (binding.txtChangelog.isVisible) {
if (binding.cardChangelog.isVisible) {
binding.headerIndicator.icon =
ContextCompat.getDrawable(context, R.drawable.ic_arrow_down)
binding.txtChangelog.visibility = View.GONE
binding.cardChangelog.visibility = View.GONE
} else {
binding.headerIndicator.icon =
ContextCompat.getDrawable(context, R.drawable.ic_arrow_up)
binding.txtChangelog.visibility = View.VISIBLE
binding.cardChangelog.visibility = View.VISIBLE
}
}
}

View File

@@ -109,8 +109,6 @@ class UpdatesFragment : BaseFragment<FragmentUpdatesBinding>() {
viewModel.fetchingUpdates.collect {
binding.swipeRefreshLayout.isRefreshing = it
if (it && viewModel.updates.value.isNullOrEmpty()) {
updateController(null)
} else {
updateController(emptyMap())
}
}