hide Search, Sort and Filter menu buttons on Groups tab

This commit is contained in:
tibbi 2018-03-21 22:44:45 +01:00
parent 1a54cefaf3
commit de5b0f6825
2 changed files with 9 additions and 2 deletions

View File

@ -154,6 +154,12 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu, menu)
val currentPage = viewpager?.currentItem
menu.apply {
findItem(R.id.search).isVisible = currentPage != LOCATION_GROUPS_TAB
findItem(R.id.sort).isVisible = currentPage != LOCATION_GROUPS_TAB
findItem(R.id.filter).isVisible = currentPage != LOCATION_GROUPS_TAB
}
setupSearch(menu)
return true
}

View File

@ -16,8 +16,9 @@ const val IS_PRIVATE = "is_private"
const val GROUP = "group"
const val FIRST_GROUP_ID = 10000
const val LOCATION_CONTACTS_TAB = 1
const val LOCATION_FAVORITES_TAB = 2
const val LOCATION_CONTACTS_TAB = 0
const val LOCATION_FAVORITES_TAB = 1
const val LOCATION_GROUPS_TAB = 2
const val LOCATION_GROUP_CONTACTS = 3
const val CONTACTS_TAB_MASK = 1