hide Search, Sort and Filter menu buttons on Groups tab
This commit is contained in:
parent
1a54cefaf3
commit
de5b0f6825
2 changed files with 9 additions and 2 deletions
|
|
@ -154,6 +154,12 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||||
menuInflater.inflate(R.menu.menu, menu)
|
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)
|
setupSearch(menu)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,9 @@ const val IS_PRIVATE = "is_private"
|
||||||
const val GROUP = "group"
|
const val GROUP = "group"
|
||||||
const val FIRST_GROUP_ID = 10000
|
const val FIRST_GROUP_ID = 10000
|
||||||
|
|
||||||
const val LOCATION_CONTACTS_TAB = 1
|
const val LOCATION_CONTACTS_TAB = 0
|
||||||
const val LOCATION_FAVORITES_TAB = 2
|
const val LOCATION_FAVORITES_TAB = 1
|
||||||
|
const val LOCATION_GROUPS_TAB = 2
|
||||||
const val LOCATION_GROUP_CONTACTS = 3
|
const val LOCATION_GROUP_CONTACTS = 3
|
||||||
|
|
||||||
const val CONTACTS_TAB_MASK = 1
|
const val CONTACTS_TAB_MASK = 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue