fix #222, delay checking of the visible menu items a bit

This commit is contained in:
tibbi 2018-08-11 09:52:13 +02:00
parent 670386f532
commit 197670b486
1 changed files with 2 additions and 1 deletions

View File

@ -178,6 +178,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu, menu)
val currentFragment = getCurrentFragment()
menu.apply {
findItem(R.id.search).isVisible = currentFragment != groups_fragment && currentFragment != recents_fragment
findItem(R.id.sort).isVisible = currentFragment != groups_fragment && currentFragment != recents_fragment
@ -363,11 +364,11 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
main_tabs_holder.onGlobalLayout {
Handler().postDelayed({
main_tabs_holder.getTabAt(config.lastUsedViewPagerPage)?.select()
invalidateOptionsMenu()
}, 100L)
}
main_tabs_holder.beVisibleIf(skippedTabs < 3)
invalidateOptionsMenu()
}
private fun getTabIcon(position: Int): Drawable {