Merge pull request #48 from weidsom/patch-1

Little dumb fix to a bug on custom colors
This commit is contained in:
Kiva 2019-10-09 12:46:05 +08:00 committed by GitHub
commit c2a0fd43cd
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)
}
}