Skip to content

Commit

Permalink
fix: [ANDROAPP-6673] Hide home filters if non are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimolloy committed Dec 18, 2024
1 parent 4ad76b9 commit af168a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/org/dhis2/usescases/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class MainActivity :
}

private fun setFilterButtonVisibility(showFilterButton: Boolean) {
binding.filterActionButton.visibility = if (showFilterButton) {
binding.filterActionButton.visibility = if (showFilterButton && presenter.hasFilters()) {
View.VISIBLE
} else {
View.GONE
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/org/dhis2/usescases/main/MainPresenter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,8 @@ class MainPresenter(
fun getSingleItemData(): HomeItemData? {
return repository.singleHomeItemData()
}

fun hasFilters(): Boolean {
return filterRepository.homeFilters().isNotEmpty()
}
}

0 comments on commit af168a0

Please sign in to comment.