hide the Go To Today menu button if the search is open

This commit is contained in:
tibbi 2020-04-17 20:54:10 +02:00
parent 2cb5e02179
commit f264f0720a
1 changed files with 3 additions and 1 deletions

View File

@ -176,7 +176,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
menu.apply {
goToTodayButton = findItem(R.id.go_to_today)
findItem(R.id.filter).isVisible = mShouldFilterBeVisible
findItem(R.id.go_to_today).isVisible = shouldGoToTodayBeVisible || config.storedView == EVENTS_LIST_VIEW
findItem(R.id.go_to_today).isVisible = (shouldGoToTodayBeVisible || config.storedView == EVENTS_LIST_VIEW) && !mIsSearchOpen
findItem(R.id.go_to_date).isVisible = config.storedView != EVENTS_LIST_VIEW
}
@ -276,6 +276,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
search_holder.beVisible()
calendar_fab.beGone()
searchQueryChanged("")
invalidateOptionsMenu()
return true
}
@ -283,6 +284,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
mIsSearchOpen = false
search_holder.beGone()
calendar_fab.beVisibleIf(currentFragments.last() !is YearFragmentsHolder)
invalidateOptionsMenu()
return true
}
})