redraw the main page only if the text color changed

This commit is contained in:
tibbi 2017-01-03 22:47:13 +01:00
parent 566646a1b9
commit 7ae2a0b8f0
1 changed files with 7 additions and 1 deletions

View File

@ -34,16 +34,21 @@ class MainActivity : SimpleActivity(), EventListFragment.DeleteListener {
private var mIsMonthSelected = false
private var mSnackbar: Snackbar? = null
private var mEventListFragment: EventListFragment? = null
private var mStoredTextColor = 0
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
calendar_fab.setOnClickListener { addNewEvent() }
updateViewPager()
mStoredTextColor = config.textColor
}
override fun onResume() {
super.onResume()
updateViewPager()
if (mStoredTextColor != config.textColor)
updateViewPager()
updateWidgets()
updateTextColors(calendar_coordinator)
}
@ -51,6 +56,7 @@ class MainActivity : SimpleActivity(), EventListFragment.DeleteListener {
override fun onPause() {
super.onPause()
checkDeleteEvents()
mStoredTextColor = config.textColor
}
override fun onDestroy() {