Skip to content

Commit 082b781

Browse files
committed
Upload file
1 parent 087b57d commit 082b781

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

pio/src/main/java/com/projectkr/shell/MainActivity.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ class MainActivity : AppCompatActivity() {
4949
ThemeModeState.switchTheme(this)
5050
binding = ActivityMainBinding.inflate(layoutInflater)
5151
setContentView(binding.root)
52+
applyTheme()
5253

5354
val toolbar = findViewById<View>(R.id.toolbar) as Toolbar
5455
setSupportActionBar(toolbar)
5556
setTitle(R.string.app_name)
56-
5757
krScriptConfig = KrScriptConfig()
58-
5958
binding.mainTabhost.setup()
59+
6060
val tabIconHelper = TabIconHelper(binding.mainTabhost, this)
6161
if (tabIconHelper != null) {
6262
if (hasRoot && krScriptConfig.allowHomePage) {
@@ -125,6 +125,15 @@ class MainActivity : AppCompatActivity() {
125125
})
126126
}
127127

128+
private fun applyTheme() {
129+
WindowCompat.setDecorFitsSystemWindows(window, false)
130+
window.statusBarColor = Color.TRANSPARENT
131+
window.navigationBarColor = ContextCompat.getColor(this, R.color.splash_bg_color)
132+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
133+
WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightStatusBars = true
134+
}
135+
}
136+
128137
private fun getItems(pageNode: PageNode): ArrayList<NodeInfoBase>? {
129138
var items: ArrayList<NodeInfoBase>? = null
130139

0 commit comments

Comments
 (0)