mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-24 19:04:38 -06:00
[UI] Fix status bar icon color in light theme, color&date picker dialogs crashing the app.
This commit is contained in:
parent
18d9471a94
commit
9500ba52fd
@ -30,6 +30,7 @@ import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem
|
||||
import pl.szczodrzynski.navlib.drawer.items.withAppTitle
|
||||
import pl.szczodrzynski.navlib.getColorFromAttr
|
||||
import androidx.appcompat.widget.PopupMenu
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import androidx.navigation.NavOptions
|
||||
import com.danimahardhika.cafebar.CafeBar
|
||||
import com.mikepenz.iconics.IconicsColor
|
||||
@ -239,6 +240,14 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
b.navView.configSystemBarsUtil(this)
|
||||
|
||||
// fix for setting status bar color to window color, outside of navlib
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
window.statusBarColor = statusBarColor
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ColorUtils.calculateLuminance(statusBarColor) > 0.6) {
|
||||
window.decorView.systemUiVisibility = window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
||||
}
|
||||
|
||||
// TODO fix navlib navbar detection, orientation change issues, status bar color setting if not fullscreen
|
||||
|
||||
commit()
|
||||
|
@ -95,8 +95,6 @@
|
||||
<item name="mal_color_secondary">?android:textColorSecondary</item>
|
||||
<item name="mal_card_background">?colorSurface</item>
|
||||
<item name="mal_divider_color">@color/dividerColor</item>
|
||||
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">?android:windowBackground</item>
|
||||
</style>
|
||||
<style name="AppTheme.Dark" parent="NavView.Dark">
|
||||
<item name="colorPrimary">#64b5f6</item>
|
||||
@ -121,8 +119,6 @@
|
||||
<item name="mal_color_secondary">@color/secondaryTextDark</item>
|
||||
<item name="mal_card_background">?colorSurface</item>
|
||||
<item name="mal_divider_color">@color/dividerColor</item>
|
||||
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">?android:windowBackground</item>
|
||||
</style>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user