-
-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: incorrect navigation bar appearance in the activities of the app
refactor: slightly refactor to app theme scheme
- Loading branch information
1 parent
3f13fa8
commit 9aa9d0e
Showing
7 changed files
with
38 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.osfans.trime.util | ||
|
||
import android.app.Activity | ||
import android.graphics.Color | ||
import android.os.Build | ||
import androidx.core.view.WindowCompat | ||
|
||
fun Activity.applyTranslucentSystemBars() { | ||
WindowCompat.setDecorFitsSystemWindows(window, false) | ||
// windowLightNavigationBar is available for 27+ | ||
window.navigationBarColor = | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
Color.TRANSPARENT | ||
} else { | ||
// com.android.internal.R.color.system_bar_background_semi_transparent | ||
0x66000000 | ||
} | ||
WindowCompat.getInsetsController(window, window.decorView) | ||
.isAppearanceLightNavigationBars = !resources.configuration.isNightMode() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="toolbarForegroundColor">#FFFFFF</color> <!-- 工具栏前景色 --> | ||
<color name="windowBackground">#202020</color> | ||
</resources> | ||
<color name="colorOnSurface">#000000</color> | ||
<color name="colorBackground">#1E2B38</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources xmlns:tools="http://schemas.android.com/tools"> | ||
<style name="PreferenceTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> | ||
<style name="Theme.TrimeAppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> | ||
<item name="colorPrimary">@color/colorPrimary</item> | ||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||
<item name="colorAccent">@color/colorAccent</item> | ||
<item name="android:colorAccent" tools:targetApi="lollipop">@color/colorAccent</item> | ||
|
||
<item name="android:windowBackground">@color/windowBackground</item> | ||
<item name="android:colorBackground">@color/windowBackground</item> | ||
<item name="colorOnSurface">@color/colorOnSurface</item> | ||
<item name="android:colorBackground">@color/colorBackground</item> | ||
<item name="android:colorAccent" >@color/colorAccent</item> | ||
</style> | ||
</resources> | ||
</resources> |