Fixed translucent 2/3 button nav bar on android 10

This commit is contained in:
Jay 2020-05-03 13:01:51 -04:00
parent 5f78765ef6
commit c2bab110d6
2 changed files with 5 additions and 2 deletions

View File

@ -73,8 +73,10 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
backgroundTintList =
ColorStateList.valueOf(lerpColor(primary, fullPrimary, trueProgress))
chapter_recycler.alpha = trueProgress
if (activity.sheetManageNavColor) activity.window.navigationBarColor =
lerpColor(ColorUtils.setAlphaComponent(primary, 0), primary, trueProgress)
if (activity.sheetManageNavColor && progress > 0f) {
activity.window.navigationBarColor =
lerpColor(ColorUtils.setAlphaComponent(primary, 0), primary, trueProgress)
}
}
override fun onStateChanged(p0: View, state: Int) {

View File

@ -8,6 +8,7 @@
<style name="Theme.Base" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:forceDarkAllowed" tools:targetApi="29">false</item>
<item name="android:enforceNavigationBarContrast" tools:targetApi="29">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="colorPrimary">@color/app_color_primary</item>
<item name="colorPrimaryVariant">@color/colorPrimary</item>