fix #222, delay checking of the visible menu items a bit
This commit is contained in:
parent
670386f532
commit
197670b486
1 changed files with 2 additions and 1 deletions
|
|
@ -178,6 +178,7 @@ 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 currentFragment = getCurrentFragment()
|
val currentFragment = getCurrentFragment()
|
||||||
|
|
||||||
menu.apply {
|
menu.apply {
|
||||||
findItem(R.id.search).isVisible = currentFragment != groups_fragment && currentFragment != recents_fragment
|
findItem(R.id.search).isVisible = currentFragment != groups_fragment && currentFragment != recents_fragment
|
||||||
findItem(R.id.sort).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 {
|
main_tabs_holder.onGlobalLayout {
|
||||||
Handler().postDelayed({
|
Handler().postDelayed({
|
||||||
main_tabs_holder.getTabAt(config.lastUsedViewPagerPage)?.select()
|
main_tabs_holder.getTabAt(config.lastUsedViewPagerPage)?.select()
|
||||||
|
invalidateOptionsMenu()
|
||||||
}, 100L)
|
}, 100L)
|
||||||
}
|
}
|
||||||
|
|
||||||
main_tabs_holder.beVisibleIf(skippedTabs < 3)
|
main_tabs_holder.beVisibleIf(skippedTabs < 3)
|
||||||
invalidateOptionsMenu()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getTabIcon(position: Int): Drawable {
|
private fun getTabIcon(position: Int): Drawable {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue