Fix colors in classic
This commit is contained in:
parent
d74ad32a38
commit
6e7d945fb1
11 changed files with 90 additions and 113 deletions
|
@ -6,25 +6,24 @@ import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.ViewTreeObserver
|
import android.view.ViewTreeObserver
|
||||||
import android.widget.FrameLayout
|
|
||||||
import androidx.annotation.LayoutRes
|
import androidx.annotation.LayoutRes
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
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.RetroBottomSheetBehavior
|
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
|
import code.name.monkey.retromusic.RetroBottomSheetBehavior
|
||||||
import code.name.monkey.retromusic.extensions.hide
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
import code.name.monkey.retromusic.extensions.show
|
import code.name.monkey.retromusic.extensions.show
|
||||||
import code.name.monkey.retromusic.fragments.MiniPlayerFragment
|
import code.name.monkey.retromusic.fragments.MiniPlayerFragment
|
||||||
import code.name.monkey.retromusic.fragments.NowPlayingScreen
|
import code.name.monkey.retromusic.fragments.NowPlayingScreen
|
||||||
import code.name.monkey.retromusic.fragments.NowPlayingScreen.*
|
import code.name.monkey.retromusic.fragments.NowPlayingScreen.*
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.classic.ClassicPlayerFragment
|
|
||||||
import code.name.monkey.retromusic.fragments.player.adaptive.AdaptiveFragment
|
import code.name.monkey.retromusic.fragments.player.adaptive.AdaptiveFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.blur.BlurPlayerFragment
|
import code.name.monkey.retromusic.fragments.player.blur.BlurPlayerFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.card.CardFragment
|
import code.name.monkey.retromusic.fragments.player.card.CardFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.cardblur.CardBlurFragment
|
import code.name.monkey.retromusic.fragments.player.cardblur.CardBlurFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.circle.CirclePlayerFragment
|
import code.name.monkey.retromusic.fragments.player.circle.CirclePlayerFragment
|
||||||
|
import code.name.monkey.retromusic.fragments.player.classic.ClassicPlayerFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.color.ColorFragment
|
import code.name.monkey.retromusic.fragments.player.color.ColorFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.fit.FitFragment
|
import code.name.monkey.retromusic.fragments.player.fit.FitFragment
|
||||||
import code.name.monkey.retromusic.fragments.player.flat.FlatPlayerFragment
|
import code.name.monkey.retromusic.fragments.player.flat.FlatPlayerFragment
|
||||||
|
@ -41,6 +40,9 @@ import code.name.monkey.retromusic.util.DensityUtil
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
import code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
|
import com.google.android.material.card.MaterialCardView
|
||||||
|
import com.google.android.material.shape.MaterialShapeDrawable
|
||||||
|
import com.google.android.material.shape.ShapeAppearanceModel
|
||||||
import kotlinx.android.synthetic.main.sliding_music_panel_layout.*
|
import kotlinx.android.synthetic.main.sliding_music_panel_layout.*
|
||||||
|
|
||||||
abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
|
@ -49,7 +51,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName
|
val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName
|
||||||
}
|
}
|
||||||
|
|
||||||
private lateinit var bottomSheetBehavior: RetroBottomSheetBehavior<FrameLayout>
|
private lateinit var bottomSheetBehavior: RetroBottomSheetBehavior<MaterialCardView>
|
||||||
private var miniPlayerFragment: MiniPlayerFragment? = null
|
private var miniPlayerFragment: MiniPlayerFragment? = null
|
||||||
private var playerFragment: AbsPlayerFragment? = null
|
private var playerFragment: AbsPlayerFragment? = null
|
||||||
private var currentNowPlayingScreen: NowPlayingScreen? = null
|
private var currentNowPlayingScreen: NowPlayingScreen? = null
|
||||||
|
@ -59,6 +61,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
private var lightNavigationBar: Boolean = false
|
private var lightNavigationBar: Boolean = false
|
||||||
private var navigationBarColorAnimator: ValueAnimator? = null
|
private var navigationBarColorAnimator: ValueAnimator? = null
|
||||||
protected abstract fun createContentView(): View
|
protected abstract fun createContentView(): View
|
||||||
|
private lateinit var shapeDrawable: MaterialShapeDrawable
|
||||||
private val panelState: Int
|
private val panelState: Int
|
||||||
get() = bottomSheetBehavior.state
|
get() = bottomSheetBehavior.state
|
||||||
|
|
||||||
|
@ -68,6 +71,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
setMiniPlayerAlphaProgress(slideOffset)
|
setMiniPlayerAlphaProgress(slideOffset)
|
||||||
dimBackground.show()
|
dimBackground.show()
|
||||||
dimBackground.alpha = slideOffset
|
dimBackground.alpha = slideOffset
|
||||||
|
shapeDrawable.interpolation = 1 - slideOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStateChanged(bottomSheet: View, newState: Int) {
|
override fun onStateChanged(bottomSheet: View, newState: Int) {
|
||||||
|
@ -97,11 +101,18 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
|
|
||||||
updateTabs()
|
updateTabs()
|
||||||
|
|
||||||
bottomSheetBehavior =
|
bottomSheetBehavior = BottomSheetBehavior.from(slidingPanel) as RetroBottomSheetBehavior
|
||||||
BottomSheetBehavior.from(slidingPanel) as RetroBottomSheetBehavior
|
|
||||||
|
|
||||||
val themeColor = ATHUtil.resolveColor(this, android.R.attr.windowBackground, Color.GRAY)
|
val themeColor = ATHUtil.resolveColor(this, android.R.attr.windowBackground, Color.GRAY)
|
||||||
dimBackground.setBackgroundColor(ColorUtil.withAlpha(themeColor, 0.5f))
|
dimBackground.setBackgroundColor(ColorUtil.withAlpha(themeColor, 0.5f))
|
||||||
|
shapeDrawable = MaterialShapeDrawable(
|
||||||
|
ShapeAppearanceModel.builder(
|
||||||
|
this,
|
||||||
|
R.style.ClassicThemeOverLay,
|
||||||
|
0
|
||||||
|
).build()
|
||||||
|
)
|
||||||
|
slidingPanel.background = shapeDrawable
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
@ -309,6 +320,8 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(),
|
||||||
super.setNavigationbarColor(paletteColor)
|
super.setNavigationbarColor(paletteColor)
|
||||||
super.setLightNavigationBar(isColorLight)
|
super.setLightNavigationBar(isColorLight)
|
||||||
super.setLightStatusbar(isColorLight)
|
super.setLightStatusbar(isColorLight)
|
||||||
|
} else if (currentNowPlayingScreen == CLASSIC) {
|
||||||
|
super.setLightStatusbar(false)
|
||||||
} else if (currentNowPlayingScreen == FIT) {
|
} else if (currentNowPlayingScreen == FIT) {
|
||||||
super.setLightStatusbar(false)
|
super.setLightStatusbar(false)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,23 +1,26 @@
|
||||||
package code.name.monkey.retromusic.fragments.player.classic
|
package code.name.monkey.retromusic.fragments.player.classic
|
||||||
|
|
||||||
|
import android.content.res.ColorStateList
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.PorterDuff
|
import android.graphics.PorterDuff
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.widget.LinearLayout
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.widget.Toolbar
|
import androidx.appcompat.widget.Toolbar
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||||
import code.name.monkey.appthemehelper.util.*
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
import code.name.monkey.retromusic.RetroBottomSheetBehavior
|
import code.name.monkey.appthemehelper.util.TintHelper
|
||||||
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
|
import code.name.monkey.retromusic.RetroBottomSheetBehavior
|
||||||
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
|
||||||
import code.name.monkey.retromusic.adapter.song.PlayingQueueAdapter
|
import code.name.monkey.retromusic.adapter.song.PlayingQueueAdapter
|
||||||
import code.name.monkey.retromusic.extensions.hide
|
import code.name.monkey.retromusic.extensions.hide
|
||||||
import code.name.monkey.retromusic.extensions.ripAlpha
|
|
||||||
import code.name.monkey.retromusic.extensions.show
|
import code.name.monkey.retromusic.extensions.show
|
||||||
import code.name.monkey.retromusic.fragments.VolumeFragment
|
import code.name.monkey.retromusic.fragments.VolumeFragment
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
|
||||||
|
@ -27,16 +30,20 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
|
||||||
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||||
import code.name.monkey.retromusic.model.Song
|
import code.name.monkey.retromusic.model.Song
|
||||||
import code.name.monkey.retromusic.service.MusicService
|
import code.name.monkey.retromusic.service.MusicService
|
||||||
|
import code.name.monkey.retromusic.util.DensityUtil
|
||||||
import code.name.monkey.retromusic.util.MusicUtil
|
import code.name.monkey.retromusic.util.MusicUtil
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.ViewUtil
|
import code.name.monkey.retromusic.util.ViewUtil
|
||||||
import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
import code.name.monkey.retromusic.util.color.MediaNotificationProcessor
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
import com.google.android.material.card.MaterialCardView
|
import com.google.android.material.card.MaterialCardView
|
||||||
|
import com.google.android.material.shape.MaterialShapeDrawable
|
||||||
|
import com.google.android.material.shape.ShapeAppearanceModel
|
||||||
import kotlinx.android.synthetic.main.fragment_clasic_player.*
|
import kotlinx.android.synthetic.main.fragment_clasic_player.*
|
||||||
import kotlinx.android.synthetic.main.fragment_classic_controls.*
|
import kotlinx.android.synthetic.main.fragment_classic_controls.*
|
||||||
import kotlinx.android.synthetic.main.status_bar.*
|
import kotlinx.android.synthetic.main.status_bar.*
|
||||||
|
|
||||||
|
|
||||||
class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
||||||
MusicProgressViewUpdateHelper.Callback {
|
MusicProgressViewUpdateHelper.Callback {
|
||||||
|
|
||||||
|
@ -46,7 +53,7 @@ class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
||||||
private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
|
private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
|
||||||
private lateinit var queueAdapter: PlayingQueueAdapter
|
private lateinit var queueAdapter: PlayingQueueAdapter
|
||||||
private var volumeFragment: VolumeFragment? = null
|
private var volumeFragment: VolumeFragment? = null
|
||||||
|
private lateinit var shapeDrawable: MaterialShapeDrawable
|
||||||
|
|
||||||
private val bottomSheetCallbackList = object : BottomSheetBehavior.BottomSheetCallback() {
|
private val bottomSheetCallbackList = object : BottomSheetBehavior.BottomSheetCallback() {
|
||||||
override fun onSlide(bottomSheet: View, slideOffset: Float) {
|
override fun onSlide(bottomSheet: View, slideOffset: Float) {
|
||||||
|
@ -59,6 +66,8 @@ class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
||||||
playerQueueSheet.contentPaddingRight,
|
playerQueueSheet.contentPaddingRight,
|
||||||
playerQueueSheet.contentPaddingBottom
|
playerQueueSheet.contentPaddingBottom
|
||||||
)
|
)
|
||||||
|
val corner = (1 - slideOffset) * DensityUtil.dip2px(requireContext(), 16f)
|
||||||
|
shapeDrawable.interpolation = 1 - slideOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStateChanged(bottomSheet: View, newState: Int) {
|
override fun onStateChanged(bottomSheet: View, newState: Int) {
|
||||||
|
@ -97,13 +106,20 @@ class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
||||||
|
|
||||||
getQueuePanel().addBottomSheetCallback(bottomSheetCallbackList)
|
getQueuePanel().addBottomSheetCallback(bottomSheetCallbackList)
|
||||||
|
|
||||||
|
|
||||||
playerQueueSheet.setOnTouchListener { _, _ ->
|
playerQueueSheet.setOnTouchListener { _, _ ->
|
||||||
(requireActivity() as AbsSlidingMusicPanelActivity).getBottomSheetBehavior()
|
(requireActivity() as AbsSlidingMusicPanelActivity).getBottomSheetBehavior()
|
||||||
.setAllowDragging(false)
|
.setAllowDragging(false)
|
||||||
getQueuePanel().setAllowDragging(true)
|
getQueuePanel().setAllowDragging(true)
|
||||||
return@setOnTouchListener false
|
return@setOnTouchListener false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shapeDrawable = MaterialShapeDrawable(
|
||||||
|
ShapeAppearanceModel.builder(
|
||||||
|
requireContext(),
|
||||||
|
R.style.ClassicThemeOverLay,
|
||||||
|
0
|
||||||
|
).build()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hideVolumeIfAvailable() {
|
private fun hideVolumeIfAvailable() {
|
||||||
|
@ -146,7 +162,6 @@ class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getQueuePanel(): RetroBottomSheetBehavior<MaterialCardView> {
|
private fun getQueuePanel(): RetroBottomSheetBehavior<MaterialCardView> {
|
||||||
playerQueueSheet as MaterialCardView
|
|
||||||
return RetroBottomSheetBehavior.from(playerQueueSheet) as RetroBottomSheetBehavior<MaterialCardView>
|
return RetroBottomSheetBehavior.from(playerQueueSheet) as RetroBottomSheetBehavior<MaterialCardView>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,48 +248,25 @@ class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
||||||
|
|
||||||
override fun onColorChanged(color: MediaNotificationProcessor) {
|
override fun onColorChanged(color: MediaNotificationProcessor) {
|
||||||
lastColor = color.backgroundColor
|
lastColor = color.backgroundColor
|
||||||
ToolbarContentTintHelper.colorizeToolbar(
|
lastPlaybackControlsColor = color.primaryTextColor
|
||||||
playerToolbar,
|
lastDisabledPlaybackControlsColor = ColorUtil.withAlpha(color.primaryTextColor, 0.3f)
|
||||||
Color.WHITE,
|
shapeDrawable.fillColor = ColorStateList.valueOf(color.backgroundColor)
|
||||||
requireActivity()
|
playerQueueSheet.background = shapeDrawable
|
||||||
)
|
|
||||||
|
|
||||||
if (!ATHUtil.isWindowBackgroundDark(requireContext())) {
|
title.setTextColor(color.primaryTextColor)
|
||||||
lastPlaybackControlsColor =
|
text.setTextColor(color.secondaryTextColor)
|
||||||
MaterialValueHelper.getSecondaryTextColor(requireContext(), true)
|
songInfo.setTextColor(color.secondaryTextColor)
|
||||||
lastDisabledPlaybackControlsColor =
|
|
||||||
MaterialValueHelper.getSecondaryDisabledTextColor(requireContext(), true)
|
|
||||||
} else {
|
|
||||||
lastPlaybackControlsColor =
|
|
||||||
MaterialValueHelper.getPrimaryTextColor(requireContext(), false)
|
|
||||||
lastDisabledPlaybackControlsColor =
|
|
||||||
MaterialValueHelper.getPrimaryDisabledTextColor(requireContext(), false)
|
|
||||||
}
|
|
||||||
|
|
||||||
val colorFinal = if (PreferenceUtil.getInstance(requireContext()).adaptiveColor) {
|
|
||||||
color.backgroundColor
|
|
||||||
} else {
|
|
||||||
ThemeStore.accentColor(requireContext())
|
|
||||||
}.ripAlpha()
|
|
||||||
|
|
||||||
TintHelper.setTintAuto(
|
|
||||||
playPauseButton,
|
|
||||||
MaterialValueHelper.getPrimaryTextColor(
|
|
||||||
requireContext(),
|
|
||||||
ColorUtil.isColorLight(colorFinal)
|
|
||||||
),
|
|
||||||
false
|
|
||||||
)
|
|
||||||
title.setTextColor(lastPlaybackControlsColor)
|
|
||||||
text.setTextColor(lastDisabledPlaybackControlsColor)
|
|
||||||
songInfo.setTextColor(lastDisabledPlaybackControlsColor)
|
|
||||||
songCurrentProgress.setTextColor(lastPlaybackControlsColor)
|
songCurrentProgress.setTextColor(lastPlaybackControlsColor)
|
||||||
songTotalTime.setTextColor(lastPlaybackControlsColor)
|
songTotalTime.setTextColor(lastPlaybackControlsColor)
|
||||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal, true)
|
|
||||||
player_queue_sub_header.setTextColor(colorFinal)
|
ViewUtil.setProgressDrawable(progressSlider, color.primaryTextColor, true)
|
||||||
volumeFragment?.setTintable(colorFinal)
|
volumeFragment?.setTintableColor(color.primaryTextColor)
|
||||||
TintHelper.setTintAuto(playPauseButton, colorFinal, true)
|
|
||||||
ViewUtil.setProgressDrawable(progressSlider, colorFinal, true)
|
player_queue_sub_header.setTextColor(color.secondaryTextColor)
|
||||||
|
|
||||||
|
TintHelper.setTintAuto(playPauseButton, color.primaryTextColor, true)
|
||||||
|
TintHelper.setTintAuto(playPauseButton, color.backgroundColor, false)
|
||||||
updateRepeatState()
|
updateRepeatState()
|
||||||
updateShuffleState()
|
updateShuffleState()
|
||||||
updatePrevNextColor()
|
updatePrevNextColor()
|
||||||
|
@ -410,6 +402,6 @@ class ClassicPlayerFragment : AbsPlayerFragment(), View.OnLayoutChangeListener,
|
||||||
val width = playerContainer.width
|
val width = playerContainer.width
|
||||||
val finalHeight = height - width
|
val finalHeight = height - width
|
||||||
val panel = getQueuePanel()
|
val panel = getQueuePanel()
|
||||||
panel.peekHeight = finalHeight
|
panel.peekHeight = finalHeight + DensityUtil.dip2px(requireContext(), 16f)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -499,10 +499,10 @@ public final class PreferenceUtil {
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public ThemeMode getGeneralThemeValue() {
|
public ThemeMode getGeneralThemeValue() {
|
||||||
if (isBlackMode()) {
|
String themeMode = mPreferences.getString(GENERAL_THEME, "dark");
|
||||||
|
if (isBlackMode() && themeMode.equals("dark")) {
|
||||||
return ThemeMode.BLACK;
|
return ThemeMode.BLACK;
|
||||||
} else {
|
} else {
|
||||||
String themeMode = mPreferences.getString(GENERAL_THEME, "dark");
|
|
||||||
switch (themeMode) {
|
switch (themeMode) {
|
||||||
case "light":
|
case "light":
|
||||||
return ThemeMode.LIGHT;
|
return ThemeMode.LIGHT;
|
||||||
|
@ -764,7 +764,7 @@ public final class PreferenceUtil {
|
||||||
return mPreferences.getBoolean(INTRO_SHOWN, false);
|
return mPreferences.getBoolean(INTRO_SHOWN, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBlackMode() {
|
private boolean isBlackMode() {
|
||||||
return mPreferences.getBoolean(BLACK_THEME, false);
|
return mPreferences.getBoolean(BLACK_THEME, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@ import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.util.PreferenceUtil
|
import code.name.monkey.retromusic.util.PreferenceUtil
|
||||||
import code.name.monkey.retromusic.util.theme.ThemeMode.*
|
import code.name.monkey.retromusic.util.theme.ThemeMode.*
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Paolo Valerdi
|
|
||||||
*/
|
|
||||||
object ThemeManager {
|
object ThemeManager {
|
||||||
|
|
||||||
@StyleRes
|
@StyleRes
|
||||||
|
|
|
@ -1,24 +1,5 @@
|
||||||
<!--
|
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||||
~ Copyright (c) 2019 Hemanth Savarala.
|
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||||
~
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
~ Licensed under the GNU General Public License v3
|
<path android:fillColor="#FF000000" android:pathData="M17.66,7.93L12,2.27 6.34,7.93c-3.12,3.12 -3.12,8.19 0,11.31C7.9,20.8 9.95,21.58 12,21.58c2.05,0 4.1,-0.78 5.66,-2.34 3.12,-3.12 3.12,-8.19 0,-11.31zM12,19.59c-1.6,0 -3.11,-0.62 -4.24,-1.76C6.62,16.69 6,15.19 6,13.59s0.62,-3.11 1.76,-4.24L12,5.1v14.49z"/>
|
||||||
~
|
|
||||||
~ This is free software: you can redistribute it and/or modify it under
|
|
||||||
~ the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
~ See the GNU General Public License for more details.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:tint="#FFFFFF"
|
|
||||||
android:viewportWidth="24.0"
|
|
||||||
android:viewportHeight="24.0">
|
|
||||||
<path
|
|
||||||
android:fillColor="#FF000000"
|
|
||||||
android:pathData="M6.34 7.93c-3.12 3.12-3.12 8.19 0 11.31C7.9 20.8 9.95 21.58 12 21.58s4.1-0.78 5.66-2.34c3.12-3.12 3.12-8.19 0-11.31l-4.95-4.95c-0.39-0.39-1.02-0.39-1.41 0L6.34 7.93zM12 19.59c-1.6 0-3.11-0.62-4.24-1.76C6.62 16.69 6 15.19 6 13.59s0.62-3.11 1.76-4.24L12 5.1v14.49z" />
|
|
||||||
</vector>
|
</vector>
|
||||||
|
|
|
@ -50,28 +50,22 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
android:orientation="vertical"
|
|
||||||
app:behavior_hideable="false"
|
app:behavior_hideable="false"
|
||||||
app:cardCornerRadius="0dp"
|
app:cardCornerRadius="0dp"
|
||||||
app:layout_behavior="code.name.monkey.retromusic.RetroBottomSheetBehavior">
|
app:cardElevation="12dp"
|
||||||
|
app:layout_behavior="code.name.monkey.retromusic.RetroBottomSheetBehavior"
|
||||||
|
app:shapeAppearance="@style/ClassicThemeOverLay">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/colorSurface"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<include
|
||||||
|
android:id="@+id/playerControlsContainer"
|
||||||
|
layout="@layout/fragment_classic_controls"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" />
|
||||||
app:cardCornerRadius="0dp">
|
|
||||||
|
|
||||||
<include
|
|
||||||
android:id="@+id/playerControlsContainer"
|
|
||||||
layout="@layout/fragment_classic_controls"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -95,6 +89,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/colorSurface"
|
android:background="?attr/colorSurface"
|
||||||
|
android:overScrollMode="never"
|
||||||
tools:listitem="@layout/item_list" />
|
tools:listitem="@layout/item_list" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingEnd="16dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="4dp"
|
||||||
android:scrollHorizontally="true"
|
android:scrollHorizontally="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextViewHeadline6"
|
android:textAppearance="@style/TextViewHeadline6"
|
||||||
|
@ -95,9 +95,9 @@
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="4dp"
|
||||||
android:paddingEnd="16dp"
|
android:paddingEnd="16dp"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="12dp"
|
||||||
android:textAppearance="@style/TextViewBody1"
|
android:textAppearance="@style/TextViewBody1"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
app:layout_constrainedWidth="true"
|
app:layout_constrainedWidth="true"
|
||||||
|
|
|
@ -19,14 +19,17 @@
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<FrameLayout
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/slidingPanel"
|
android:id="@+id/slidingPanel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/colorSurface"
|
android:gravity="bottom"
|
||||||
app:behavior_hideable="false"
|
app:behavior_hideable="false"
|
||||||
app:behavior_peekHeight="0dp"
|
app:behavior_peekHeight="0dp"
|
||||||
app:layout_behavior="code.name.monkey.retromusic.RetroBottomSheetBehavior">
|
app:cardCornerRadius="0dp"
|
||||||
|
app:cardElevation="12dp"
|
||||||
|
app:layout_behavior="code.name.monkey.retromusic.RetroBottomSheetBehavior"
|
||||||
|
app:shapeAppearance="@style/ClassicThemeOverLay">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/playerFragmentContainer"
|
android:id="@+id/playerFragmentContainer"
|
||||||
|
@ -40,7 +43,7 @@
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
tools:layout="@layout/fragment_mini_player" />
|
tools:layout="@layout/fragment_mini_player" />
|
||||||
|
|
||||||
</FrameLayout>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
<code.name.monkey.retromusic.views.BottomNavigationBarTinted
|
||||||
android:id="@+id/bottomNavigationView"
|
android:id="@+id/bottomNavigationView"
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
<dimen name="pref_title_padding">72dp</dimen>
|
<dimen name="pref_title_padding">72dp</dimen>
|
||||||
<dimen name="slider_thumb_radius">6dp</dimen>
|
<dimen name="slider_thumb_radius">6dp</dimen>
|
||||||
<dimen name="slider_track_height">3dp</dimen>
|
<dimen name="slider_track_height">3dp</dimen>
|
||||||
<dimen name="adaptive_icon_size">48dp</dimen>
|
<dimen name="adaptive_icon_size">46dp</dimen>
|
||||||
<dimen name="adaptive_icon_padding">12dp</dimen>
|
<dimen name="adaptive_icon_padding">12dp</dimen>
|
||||||
<dimen name="about_card_radius">16dp</dimen>
|
<dimen name="about_card_radius">16dp</dimen>
|
||||||
<dimen name="about_card_elevation">2dp</dimen>
|
<dimen name="about_card_elevation">2dp</dimen>
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ToolbarTextAppearanceNormal.Library" parent="ToolbarTextAppearanceNormal">
|
<style name="ToolbarTextAppearanceNormal.Library" parent="ToolbarTextAppearanceNormal">
|
||||||
<item name="android:textSize">24sp</item>
|
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Headline6</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="BigTitleTextAppearanceToolbar">
|
<style name="BigTitleTextAppearanceToolbar">
|
||||||
|
@ -175,9 +175,11 @@
|
||||||
<item name="cornerSizeTopRight">16dp</item>
|
<item name="cornerSizeTopRight">16dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ToolbarCornerCardView">
|
<style name="ClassicThemeOverLay">
|
||||||
<item name="cornerFamily">rounded</item>
|
<item name="cornerFamily">rounded</item>
|
||||||
<item name="cornerSize">8dp</item>
|
<item name="cornerSize">0dp</item>
|
||||||
|
<item name="cornerSizeTopRight">16dp</item>
|
||||||
|
<item name="cornerSizeTopLeft">16dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TopCornerCardViewStyle" parent="@style/Widget.MaterialComponents.CardView">
|
<style name="TopCornerCardViewStyle" parent="@style/Widget.MaterialComponents.CardView">
|
||||||
|
@ -219,4 +221,5 @@
|
||||||
<item name="android:background">@color/md_white_1000</item>
|
<item name="android:background">@color/md_white_1000</item>
|
||||||
<item name="android:textColor">@color/md_red_400</item>
|
<item name="android:textColor">@color/md_red_400</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -53,13 +53,6 @@
|
||||||
android:layout="@layout/list_item_view_switch"
|
android:layout="@layout/list_item_view_switch"
|
||||||
android:summary="@string/pref_summary_colored_app_shortcuts"
|
android:summary="@string/pref_summary_colored_app_shortcuts"
|
||||||
android:title="@string/pref_title_app_shortcuts" />
|
android:title="@string/pref_title_app_shortcuts" />
|
||||||
|
|
||||||
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="dominant_color"
|
|
||||||
android:layout="@layout/list_item_view_switch"
|
|
||||||
android:summary="@string/pref_summary_dominant_color"
|
|
||||||
android:title="@string/pref_title_toggle_dominant_color" />
|
|
||||||
|
|
||||||
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
|
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
|
||||||
</androidx.preference.PreferenceScreen>
|
</androidx.preference.PreferenceScreen>
|
Loading…
Reference in a new issue