Skip to content

Commit

Permalink
Adjust navigation bar color
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Jul 3, 2024
1 parent cdabf4c commit 4703866
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/src/main/kotlin/app/fyreplace/fyreplace/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app.fyreplace.fyreplace

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -34,7 +35,12 @@ import app.fyreplace.fyreplace.ui.views.navigation.navigate
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
val statusColor = getColor(R.color.status)
val navigationColor = getColor(R.color.navigation)
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.auto(statusColor, statusColor),
navigationBarStyle = SystemBarStyle.auto(navigationColor, navigationColor),
)
setContent {
AppTheme {
MainContent()
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-v26/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="navigation">@android:color/transparent</color>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="seed">#FF8243</color>
<color name="status">@android:color/transparent</color>
<color name="navigation">@android:color/black</color>
</resources>

0 comments on commit 4703866

Please sign in to comment.