delay updating the options menu a bit, till the bubble disappears
This commit is contained in:
parent
03d5963bb9
commit
8016391989
|
@ -2,6 +2,7 @@ package com.simplemobiletools.calendar.activities
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.os.Handler
|
||||||
import android.support.v4.view.ViewPager
|
import android.support.v4.view.ViewPager
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
|
@ -73,7 +74,7 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
||||||
private fun updateView(view: Int) {
|
private fun updateView(view: Int) {
|
||||||
mConfig.view = view
|
mConfig.view = view
|
||||||
updateViewPager()
|
updateViewPager()
|
||||||
invalidateOptionsMenu()
|
Handler().postDelayed({ invalidateOptionsMenu() }, 500)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateViewPager() {
|
private fun updateViewPager() {
|
||||||
|
@ -119,7 +120,7 @@ class MainActivity : SimpleActivity(), NavigationListener {
|
||||||
view_pager.currentItem = years.size / 2
|
view_pager.currentItem = years.size / 2
|
||||||
|
|
||||||
title = "${getString(R.string.app_launcher_name)} - ${years[years.size / 2]}"
|
title = "${getString(R.string.app_launcher_name)} - ${years[years.size / 2]}"
|
||||||
view_pager.addOnPageChangeListener(object: ViewPager.OnPageChangeListener {
|
view_pager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
|
||||||
override fun onPageScrollStateChanged(state: Int) {
|
override fun onPageScrollStateChanged(state: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue