Fixed navigation bar color pre Oreo
This commit is contained in:
parent
b68947c672
commit
a26f08127c
2 changed files with 8 additions and 11 deletions
|
@ -31,7 +31,6 @@ import androidx.core.view.isGone
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.commit
|
import androidx.fragment.app.commit
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.RetroBottomSheetBehavior
|
import code.name.monkey.retromusic.RetroBottomSheetBehavior
|
||||||
|
@ -83,6 +82,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
private var nowPlayingScreen: NowPlayingScreen? = null
|
private var nowPlayingScreen: NowPlayingScreen? = null
|
||||||
private var taskColor: Int = 0
|
private var taskColor: Int = 0
|
||||||
private var paletteColor: Int = Color.WHITE
|
private var paletteColor: Int = Color.WHITE
|
||||||
|
private var navigationBarColor = 0
|
||||||
protected abstract fun createContentView(): SlidingMusicPanelLayoutBinding
|
protected abstract fun createContentView(): SlidingMusicPanelLayoutBinding
|
||||||
private val panelState: Int
|
private val panelState: Int
|
||||||
get() = bottomSheetBehavior.state
|
get() = bottomSheetBehavior.state
|
||||||
|
@ -100,7 +100,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
argbEvaluator.evaluate(
|
argbEvaluator.evaluate(
|
||||||
slideOffset,
|
slideOffset,
|
||||||
surfaceColor(),
|
surfaceColor(),
|
||||||
playerFragment!!.paletteColor
|
navigationBarColor
|
||||||
) as Int
|
) as Int
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
updateColor()
|
updateColor()
|
||||||
binding.slidingPanel.backgroundTintList = ColorStateList.valueOf(darkAccentColor())
|
binding.slidingPanel.backgroundTintList = ColorStateList.valueOf(darkAccentColor())
|
||||||
bottomNavigationView.backgroundTintList = ColorStateList.valueOf(darkAccentColor())
|
bottomNavigationView.backgroundTintList = ColorStateList.valueOf(darkAccentColor())
|
||||||
|
navigationBarColor = surfaceColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupBottomSheet() {
|
private fun setupBottomSheet() {
|
||||||
|
@ -285,6 +286,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
|
|
||||||
private fun onPaletteColorChanged() {
|
private fun onPaletteColorChanged() {
|
||||||
if (panelState == STATE_EXPANDED) {
|
if (panelState == STATE_EXPANDED) {
|
||||||
|
navigationBarColor = surfaceColor()
|
||||||
setTaskDescColor(paletteColor)
|
setTaskDescColor(paletteColor)
|
||||||
val isColorLight = ColorUtil.isColorLight(paletteColor)
|
val isColorLight = ColorUtil.isColorLight(paletteColor)
|
||||||
if (PreferenceUtil.isAdaptiveColor && (nowPlayingScreen == Normal || nowPlayingScreen == Flat)) {
|
if (PreferenceUtil.isAdaptiveColor && (nowPlayingScreen == Normal || nowPlayingScreen == Flat)) {
|
||||||
|
@ -292,14 +294,17 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
setLightStatusBar(isColorLight)
|
setLightStatusBar(isColorLight)
|
||||||
} else if (nowPlayingScreen == Card || nowPlayingScreen == Blur || nowPlayingScreen == BlurCard) {
|
} else if (nowPlayingScreen == Card || nowPlayingScreen == Blur || nowPlayingScreen == BlurCard) {
|
||||||
animateNavigationBarColor(Color.BLACK)
|
animateNavigationBarColor(Color.BLACK)
|
||||||
|
navigationBarColor = Color.BLACK
|
||||||
setLightStatusBar(false)
|
setLightStatusBar(false)
|
||||||
setLightNavigationBar(true)
|
setLightNavigationBar(true)
|
||||||
} else if (nowPlayingScreen == Color || nowPlayingScreen == Tiny || nowPlayingScreen == Gradient) {
|
} else if (nowPlayingScreen == Color || nowPlayingScreen == Tiny || nowPlayingScreen == Gradient) {
|
||||||
animateNavigationBarColor(paletteColor)
|
animateNavigationBarColor(paletteColor)
|
||||||
|
navigationBarColor = paletteColor
|
||||||
setLightNavigationBar(isColorLight)
|
setLightNavigationBar(isColorLight)
|
||||||
setLightStatusBar(isColorLight)
|
setLightStatusBar(isColorLight)
|
||||||
} else if (nowPlayingScreen == Full) {
|
} else if (nowPlayingScreen == Full) {
|
||||||
animateNavigationBarColor(paletteColor)
|
animateNavigationBarColor(paletteColor)
|
||||||
|
navigationBarColor = paletteColor
|
||||||
setLightNavigationBar(isColorLight)
|
setLightNavigationBar(isColorLight)
|
||||||
setLightStatusBar(false)
|
setLightStatusBar(false)
|
||||||
} else if (nowPlayingScreen == Classic) {
|
} else if (nowPlayingScreen == Classic) {
|
||||||
|
@ -309,10 +314,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() {
|
||||||
} else {
|
} else {
|
||||||
setLightStatusBar(
|
setLightStatusBar(
|
||||||
ColorUtil.isColorLight(
|
ColorUtil.isColorLight(
|
||||||
ATHUtil.resolveColor(
|
surfaceColor()
|
||||||
this,
|
|
||||||
android.R.attr.windowBackground
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
setLightNavigationBar(true)
|
setLightNavigationBar(true)
|
||||||
|
|
|
@ -34,8 +34,6 @@ import android.view.View
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.Scroller
|
import android.widget.Scroller
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.content.res.ResourcesCompat
|
|
||||||
import code.name.monkey.retromusic.BuildConfig
|
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
@ -507,9 +505,6 @@ class CoverLrcView @JvmOverloads constructor(
|
||||||
y += ((mLrcEntryList[i - 1].height + mLrcEntryList[i].height shr 1)
|
y += ((mLrcEntryList[i - 1].height + mLrcEntryList[i].height shr 1)
|
||||||
+ mDividerHeight)
|
+ mDividerHeight)
|
||||||
}
|
}
|
||||||
if (BuildConfig.DEBUG) {
|
|
||||||
mLrcPaint.typeface = ResourcesCompat.getFont(context, R.font.sans)
|
|
||||||
}
|
|
||||||
if (i == mCurrentLine) {
|
if (i == mCurrentLine) {
|
||||||
mLrcPaint.textSize = mCurrentTextSize
|
mLrcPaint.textSize = mCurrentTextSize
|
||||||
mLrcPaint.color = mCurrentTextColor
|
mLrcPaint.color = mCurrentTextColor
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue