Little dumb fix to a bug on custom colors

Maybe this is not the best way... i'm still learning the code of NeoTerm but someone can use it for now
This commit is contained in:
Weidsom Nascimento 2019-10-08 12:44:42 -03:00 committed by GitHub
parent 1a34e154da
commit 68b67eb1b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,6 +219,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
}
override fun onTabAdded(tabSwitcher: TabSwitcher, index: Int, tab: Tab, animation: Animation) {
update_colors()
}
override fun onTabRemoved(tabSwitcher: TabSwitcher, index: Int, tab: Tab, animation: Animation) {
@ -344,6 +345,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
return
}
enterMain()
update_colors()
}
}
@ -781,4 +783,19 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
switchToSession(tabSwitcher.getTab(nextIndex))
}
}
fun update_colors() {
// Simple fix to bug on custom color
Handler().postDelayed({
if (tabSwitcher.count > 0) {
val tab = tabSwitcher.selectedTab
if (tab is TermTab) {
tab.updateColorScheme()
}
}
}, 500)
}
}