Skip to content

Commit 68b67eb

Browse files
author
Weidsom Nascimento
authored
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
1 parent 1a34e15 commit 68b67eb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

app/src/main/java/io/neoterm/ui/term/NeoTermActivity.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
219219
}
220220

221221
override fun onTabAdded(tabSwitcher: TabSwitcher, index: Int, tab: Tab, animation: Animation) {
222+
update_colors()
222223
}
223224

224225
override fun onTabRemoved(tabSwitcher: TabSwitcher, index: Int, tab: Tab, animation: Animation) {
@@ -344,6 +345,7 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
344345
return
345346
}
346347
enterMain()
348+
update_colors()
347349
}
348350
}
349351

@@ -781,4 +783,19 @@ class NeoTermActivity : AppCompatActivity(), ServiceConnection, SharedPreference
781783
switchToSession(tabSwitcher.getTab(nextIndex))
782784
}
783785
}
786+
787+
fun update_colors() {
788+
// Simple fix to bug on custom color
789+
Handler().postDelayed({
790+
791+
if (tabSwitcher.count > 0) {
792+
val tab = tabSwitcher.selectedTab
793+
if (tab is TermTab) {
794+
tab.updateColorScheme()
795+
}
796+
}
797+
798+
}, 500)
799+
}
800+
784801
}

0 commit comments

Comments
 (0)