WIP pure Follow system

This commit is contained in:
h4h13 2019-12-01 16:58:57 +05:30
parent 4da1f68617
commit bb72a16b84
73 changed files with 1135 additions and 1246 deletions

View file

@ -30,7 +30,7 @@
<activity <activity
android:name=".activities.MainActivity" android:name=".activities.MainActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/SplashTheme"> android:theme="@style/Theme.RetroMusic.FollowSystem">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MUSIC_PLAYER" /> <action android:name="android.intent.action.MUSIC_PLAYER" />

View file

@ -16,7 +16,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
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.appthemehelper.util.MaterialUtil
import code.name.monkey.retromusic.App import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity import code.name.monkey.retromusic.activities.base.AbsSlidingMusicPanelActivity
@ -192,14 +191,16 @@ class AlbumDetailsActivity : AbsSlidingMusicPanelActivity(), AlbumDetailsView, C
val themeColor = if (PreferenceUtil.getInstance(this).adaptiveColor) color val themeColor = if (PreferenceUtil.getInstance(this).adaptiveColor) color
else ThemeStore.accentColor(this) else ThemeStore.accentColor(this)
songTitle.setTextColor(themeColor) songTitle.setTextColor(ThemeStore.accentColor(this))
moreTitle.setTextColor(themeColor) moreTitle.setTextColor(ThemeStore.accentColor(this))
val buttonColor = if (PreferenceUtil.getInstance(this).adaptiveColor) color val buttonColor = if (PreferenceUtil.getInstance(this).adaptiveColor)
else ATHUtil.resolveColor(this, R.attr.cardBackgroundColor) color
else
ATHUtil.resolveColor(this, R.attr.cardBackgroundColor)
MaterialUtil.setTint(button = shuffleAction, color = buttonColor) //MaterialUtil.setTint(button = shuffleAction, color = buttonColor)
MaterialUtil.setTint(button = playAction, color = buttonColor) //MaterialUtil.setTint(button = playAction, color = buttonColor)
toolbar.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorPrimary)) toolbar.setBackgroundColor(ATHUtil.resolveColor(this, R.attr.colorPrimary))
setSupportActionBar(toolbar) setSupportActionBar(toolbar)

View file

@ -2,15 +2,22 @@ package code.name.monkey.retromusic.activities.base
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.graphics.* import android.graphics.Color
import android.graphics.Rect
import android.os.Bundle import android.os.Bundle
import android.view.* import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.view.ViewTreeObserver
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.extensions.* import code.name.monkey.retromusic.extensions.hide
import code.name.monkey.retromusic.fragments.* import code.name.monkey.retromusic.extensions.show
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.base.AbsPlayerFragment import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
import code.name.monkey.retromusic.fragments.player.adaptive.AdaptiveFragment import code.name.monkey.retromusic.fragments.player.adaptive.AdaptiveFragment
@ -28,330 +35,331 @@ import code.name.monkey.retromusic.fragments.player.plain.PlainPlayerFragment
import code.name.monkey.retromusic.fragments.player.simple.SimplePlayerFragment import code.name.monkey.retromusic.fragments.player.simple.SimplePlayerFragment
import code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment import code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.DensityUtil
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.card.MaterialCardView
import kotlinx.android.synthetic.main.sliding_music_panel_layout.* import kotlinx.android.synthetic.main.sliding_music_panel_layout.*
abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlayerFragment.Callbacks { abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlayerFragment.Callbacks {
companion object { companion object {
val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName
} }
private lateinit var bottomSheetBehavior: BottomSheetBehavior<MaterialCardView> private lateinit var bottomSheetBehavior: BottomSheetBehavior<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
private var navigationBarColor: Int = 0 private var navigationBarColor: Int = 0
private var taskColor: Int = 0 private var taskColor: Int = 0
private var lightStatusBar: Boolean = false private var lightStatusBar: Boolean = false
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 val panelState: Int private val panelState: Int
get() = bottomSheetBehavior.state get() = bottomSheetBehavior.state
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) {
setMiniPlayerAlphaProgress(slideOffset) setMiniPlayerAlphaProgress(slideOffset)
dimBackground.show() dimBackground.show()
dimBackground.alpha = slideOffset dimBackground.alpha = slideOffset
} }
override fun onStateChanged(bottomSheet: View, newState: Int) { override fun onStateChanged(bottomSheet: View, newState: Int) {
when (newState) { when (newState) {
BottomSheetBehavior.STATE_EXPANDED -> { BottomSheetBehavior.STATE_EXPANDED -> {
onPanelExpanded() onPanelExpanded()
} }
BottomSheetBehavior.STATE_COLLAPSED -> { BottomSheetBehavior.STATE_COLLAPSED -> {
onPanelCollapsed() onPanelCollapsed()
dimBackground.hide() dimBackground.hide()
} }
else -> { else -> {
} }
} }
} }
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(createContentView()) setContentView(createContentView())
chooseFragmentForTheme() chooseFragmentForTheme()
setupSlidingUpPanel() setupSlidingUpPanel()
updateTabs() updateTabs()
bottomSheetBehavior = BottomSheetBehavior.from(slidingPanel) bottomSheetBehavior = BottomSheetBehavior.from(slidingPanel)
val themeColor = ATHUtil.resolveColor(this, R.attr.colorPrimary, 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))
} }
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (currentNowPlayingScreen != PreferenceUtil.getInstance(this).nowPlayingScreen) { if (currentNowPlayingScreen != PreferenceUtil.getInstance(this).nowPlayingScreen) {
postRecreate() postRecreate()
} }
bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallbackList) bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallbackList)
if (bottomSheetBehavior.state == BottomSheetBehavior.STATE_EXPANDED) { if (bottomSheetBehavior.state == BottomSheetBehavior.STATE_EXPANDED) {
setMiniPlayerAlphaProgress(1f) setMiniPlayerAlphaProgress(1f)
} }
} }
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallbackList) bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallbackList)
if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel() // just in case if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel() // just in case
} }
protected fun wrapSlidingMusicPanel(@LayoutRes resId: Int): View { protected fun wrapSlidingMusicPanel(@LayoutRes resId: Int): View {
@SuppressLint("InflateParams") val slidingMusicPanelLayout = layoutInflater.inflate( @SuppressLint("InflateParams") val slidingMusicPanelLayout = layoutInflater.inflate(
R.layout.sliding_music_panel_layout, null R.layout.sliding_music_panel_layout, null
) )
val contentContainer = slidingMusicPanelLayout.findViewById<ViewGroup>(R.id.mainContentFrame) val contentContainer = slidingMusicPanelLayout.findViewById<ViewGroup>(R.id.mainContentFrame)
layoutInflater.inflate(resId, contentContainer) layoutInflater.inflate(resId, contentContainer)
return slidingMusicPanelLayout return slidingMusicPanelLayout
} }
private fun collapsePanel() { private fun collapsePanel() {
bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
} }
fun expandPanel() { fun expandPanel() {
bottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED bottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED
setMiniPlayerAlphaProgress(1f) setMiniPlayerAlphaProgress(1f)
} }
private fun setMiniPlayerAlphaProgress(progress: Float) { private fun setMiniPlayerAlphaProgress(progress: Float) {
if (miniPlayerFragment?.view == null) return if (miniPlayerFragment?.view == null) return
val alpha = 1 - progress val alpha = 1 - progress
miniPlayerFragment?.view?.alpha = alpha miniPlayerFragment?.view?.alpha = alpha
// necessary to make the views below clickable // necessary to make the views below clickable
miniPlayerFragment?.view?.visibility = if (alpha == 0f) View.GONE else View.VISIBLE miniPlayerFragment?.view?.visibility = if (alpha == 0f) View.GONE else View.VISIBLE
bottomNavigationView.translationY = progress * 500 bottomNavigationView.translationY = progress * 500
bottomNavigationView.alpha = alpha bottomNavigationView.alpha = alpha
} }
open fun onPanelCollapsed() { open fun onPanelCollapsed() {
// restore values // restore values
super.setLightStatusbar(lightStatusBar) super.setLightStatusbar(lightStatusBar)
super.setTaskDescriptionColor(taskColor) super.setTaskDescriptionColor(taskColor)
super.setNavigationbarColor(navigationBarColor) super.setNavigationbarColor(navigationBarColor)
super.setLightNavigationBar(lightNavigationBar) super.setLightNavigationBar(lightNavigationBar)
playerFragment?.setMenuVisibility(false) playerFragment?.setMenuVisibility(false)
playerFragment?.userVisibleHint = false playerFragment?.userVisibleHint = false
playerFragment?.onHide() playerFragment?.onHide()
} }
open fun onPanelExpanded() { open fun onPanelExpanded() {
val playerFragmentColor = playerFragment!!.paletteColor val playerFragmentColor = playerFragment!!.paletteColor
super.setTaskDescriptionColor(playerFragmentColor) super.setTaskDescriptionColor(playerFragmentColor)
playerFragment?.setMenuVisibility(true) playerFragment?.setMenuVisibility(true)
playerFragment?.userVisibleHint = true playerFragment?.userVisibleHint = true
playerFragment?.onShow() playerFragment?.onShow()
onPaletteColorChanged() onPaletteColorChanged()
} }
private fun setupSlidingUpPanel() { private fun setupSlidingUpPanel() {
slidingPanel.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { slidingPanel.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() { override fun onGlobalLayout() {
slidingPanel.viewTreeObserver.removeOnGlobalLayoutListener(this) slidingPanel.viewTreeObserver.removeOnGlobalLayoutListener(this)
if (currentNowPlayingScreen != PEAK) { if (currentNowPlayingScreen != PEAK) {
val params = slidingPanel.layoutParams as ViewGroup.LayoutParams val params = slidingPanel.layoutParams as ViewGroup.LayoutParams
params.height = ViewGroup.LayoutParams.MATCH_PARENT params.height = ViewGroup.LayoutParams.MATCH_PARENT
slidingPanel.layoutParams = params slidingPanel.layoutParams = params
} }
when (panelState) { when (panelState) {
BottomSheetBehavior.STATE_EXPANDED -> onPanelExpanded() BottomSheetBehavior.STATE_EXPANDED -> onPanelExpanded()
BottomSheetBehavior.STATE_COLLAPSED -> onPanelCollapsed() BottomSheetBehavior.STATE_COLLAPSED -> onPanelCollapsed()
else -> playerFragment!!.onHide() else -> playerFragment!!.onHide()
} }
} }
}) })
} }
fun toggleBottomNavigationView(toggle: Boolean) { fun toggleBottomNavigationView(toggle: Boolean) {
bottomNavigationView.visibility = if (toggle) View.GONE else View.VISIBLE bottomNavigationView.visibility = if (toggle) View.GONE else View.VISIBLE
} }
fun getBottomNavigationView(): BottomNavigationBarTinted { fun getBottomNavigationView(): BottomNavigationBarTinted {
return bottomNavigationView return bottomNavigationView
} }
private fun hideBottomBar(hide: Boolean) { private fun hideBottomBar(hide: Boolean) {
val heightOfBar = resources.getDimensionPixelSize(R.dimen.mini_player_height) val heightOfBar = resources.getDimensionPixelSize(R.dimen.mini_player_height)
val heightOfBarWithTabs = resources.getDimensionPixelSize(R.dimen.mini_player_height_expanded) val heightOfBarWithTabs = resources.getDimensionPixelSize(R.dimen.mini_player_height_expanded)
if (hide) { if (hide) {
bottomSheetBehavior.isHideable = true bottomSheetBehavior.isHideable = true
bottomSheetBehavior.peekHeight = 0 bottomSheetBehavior.peekHeight = 0
collapsePanel() collapsePanel()
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat() bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
} else { } else {
if (MusicPlayerRemote.playingQueue.isNotEmpty()) { if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
slidingPanel.cardElevation = DensityUtil.dip2px(this, 10f).toFloat() slidingPanel.cardElevation = DensityUtil.dip2px(this, 10f).toFloat()
bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat() bottomNavigationView.elevation = DensityUtil.dip2px(this, 10f).toFloat()
bottomSheetBehavior.isHideable = false bottomSheetBehavior.isHideable = false
bottomSheetBehavior.peekHeight = if (bottomNavigationView.visibility == View.VISIBLE) heightOfBarWithTabs else heightOfBar bottomSheetBehavior.peekHeight = if (bottomNavigationView.visibility == View.VISIBLE) heightOfBarWithTabs else heightOfBar
} }
} }
} }
fun setBottomBarVisibility(gone: Int) { fun setBottomBarVisibility(gone: Int) {
bottomNavigationView.visibility = gone bottomNavigationView.visibility = gone
hideBottomBar(false) hideBottomBar(false)
} }
private fun chooseFragmentForTheme() { private fun chooseFragmentForTheme() {
currentNowPlayingScreen = PreferenceUtil.getInstance(this).nowPlayingScreen currentNowPlayingScreen = PreferenceUtil.getInstance(this).nowPlayingScreen
val fragment: Fragment = when (currentNowPlayingScreen) { val fragment: Fragment = when (currentNowPlayingScreen) {
BLUR -> BlurPlayerFragment() BLUR -> BlurPlayerFragment()
ADAPTIVE -> AdaptiveFragment() ADAPTIVE -> AdaptiveFragment()
NORMAL -> PlayerFragment() NORMAL -> PlayerFragment()
CARD -> CardFragment() CARD -> CardFragment()
BLUR_CARD -> CardBlurFragment() BLUR_CARD -> CardBlurFragment()
FIT -> FitFragment() FIT -> FitFragment()
FLAT -> FlatPlayerFragment() FLAT -> FlatPlayerFragment()
FULL -> FullPlayerFragment() FULL -> FullPlayerFragment()
PLAIN -> PlainPlayerFragment() PLAIN -> PlainPlayerFragment()
SIMPLE -> SimplePlayerFragment() SIMPLE -> SimplePlayerFragment()
MATERIAL -> MaterialFragment() MATERIAL -> MaterialFragment()
COLOR -> ColorFragment() COLOR -> ColorFragment()
TINY -> TinyPlayerFragment() TINY -> TinyPlayerFragment()
PEAK -> PeakPlayerFragment() PEAK -> PeakPlayerFragment()
else -> PlayerFragment() else -> PlayerFragment()
} // must implement AbsPlayerFragment } // must implement AbsPlayerFragment
supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment) supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment)
.commit() .commit()
supportFragmentManager.executePendingTransactions() supportFragmentManager.executePendingTransactions()
playerFragment = supportFragmentManager.findFragmentById(R.id.playerFragmentContainer) as AbsPlayerFragment playerFragment = supportFragmentManager.findFragmentById(R.id.playerFragmentContainer) as AbsPlayerFragment
miniPlayerFragment = supportFragmentManager.findFragmentById(R.id.miniPlayerFragment) as MiniPlayerFragment miniPlayerFragment = supportFragmentManager.findFragmentById(R.id.miniPlayerFragment) as MiniPlayerFragment
miniPlayerFragment?.view?.setOnClickListener { expandPanel() } miniPlayerFragment?.view?.setOnClickListener { expandPanel() }
} }
override fun onServiceConnected() { override fun onServiceConnected() {
super.onServiceConnected() super.onServiceConnected()
if (MusicPlayerRemote.playingQueue.isNotEmpty()) { if (MusicPlayerRemote.playingQueue.isNotEmpty()) {
slidingPanel.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener { slidingPanel.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() { override fun onGlobalLayout() {
slidingPanel.viewTreeObserver.removeOnGlobalLayoutListener(this) slidingPanel.viewTreeObserver.removeOnGlobalLayoutListener(this)
hideBottomBar(false) hideBottomBar(false)
} }
}) })
} // don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout } // don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout
} }
override fun onQueueChanged() { override fun onQueueChanged() {
super.onQueueChanged() super.onQueueChanged()
hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty()) hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty())
} }
override fun onBackPressed() { override fun onBackPressed() {
if (!handleBackPress()) super.onBackPressed() if (!handleBackPress()) super.onBackPressed()
} }
open fun handleBackPress(): Boolean { open fun handleBackPress(): Boolean {
if (bottomSheetBehavior.peekHeight != 0 && playerFragment!!.onBackPressed()) return true if (bottomSheetBehavior.peekHeight != 0 && playerFragment!!.onBackPressed()) return true
if (panelState == BottomSheetBehavior.STATE_EXPANDED) { if (panelState == BottomSheetBehavior.STATE_EXPANDED) {
collapsePanel() collapsePanel()
return true return true
} }
return false return false
} }
override fun onPaletteColorChanged() { override fun onPaletteColorChanged() {
if (panelState == BottomSheetBehavior.STATE_EXPANDED) { if (panelState == BottomSheetBehavior.STATE_EXPANDED) {
val paletteColor = playerFragment!!.paletteColor val paletteColor = playerFragment!!.paletteColor
super.setTaskDescriptionColor(paletteColor) super.setTaskDescriptionColor(paletteColor)
val isColorLight = ColorUtil.isColorLight(paletteColor) val isColorLight = ColorUtil.isColorLight(paletteColor)
if (PreferenceUtil.getInstance(this).adaptiveColor && (currentNowPlayingScreen == NORMAL || currentNowPlayingScreen == FLAT)) { if (PreferenceUtil.getInstance(this).adaptiveColor && (currentNowPlayingScreen == NORMAL || currentNowPlayingScreen == FLAT)) {
super.setLightNavigationBar(true) super.setLightNavigationBar(true)
super.setLightStatusbar(isColorLight) super.setLightStatusbar(isColorLight)
} else if (currentNowPlayingScreen == FULL || currentNowPlayingScreen == CARD || currentNowPlayingScreen == FIT || currentNowPlayingScreen == BLUR || currentNowPlayingScreen == BLUR_CARD) { } else if (currentNowPlayingScreen == FULL || currentNowPlayingScreen == CARD || currentNowPlayingScreen == FIT || currentNowPlayingScreen == BLUR || currentNowPlayingScreen == BLUR_CARD) {
super.setLightStatusbar(false) super.setLightStatusbar(false)
super.setLightNavigationBar(true) super.setLightNavigationBar(true)
} else if (currentNowPlayingScreen == COLOR || currentNowPlayingScreen == TINY) { } else if (currentNowPlayingScreen == COLOR || currentNowPlayingScreen == TINY) {
super.setNavigationbarColor(paletteColor) super.setNavigationbarColor(paletteColor)
super.setLightNavigationBar(isColorLight) super.setLightNavigationBar(isColorLight)
super.setLightStatusbar(isColorLight) super.setLightStatusbar(isColorLight)
} else { } else {
super.setLightStatusbar( super.setLightStatusbar(
ColorUtil.isColorLight( ColorUtil.isColorLight(
ATHUtil.resolveColor( ATHUtil.resolveColor(
this, R.attr.colorPrimary this, R.attr.colorPrimary
) )
) )
) )
super.setLightNavigationBar(true) super.setLightNavigationBar(true)
} }
} }
} }
override fun setLightStatusbar(enabled: Boolean) { override fun setLightStatusbar(enabled: Boolean) {
lightStatusBar = enabled lightStatusBar = enabled
if (panelState == BottomSheetBehavior.STATE_COLLAPSED) { if (panelState == BottomSheetBehavior.STATE_COLLAPSED) {
super.setLightStatusbar(enabled) super.setLightStatusbar(enabled)
} }
} }
override fun setLightNavigationBar(enabled: Boolean) { override fun setLightNavigationBar(enabled: Boolean) {
lightNavigationBar = enabled lightNavigationBar = enabled
if (panelState == BottomSheetBehavior.STATE_COLLAPSED) { if (panelState == BottomSheetBehavior.STATE_COLLAPSED) {
super.setLightNavigationBar(enabled) super.setLightNavigationBar(enabled)
} }
} }
override fun setNavigationbarColor(color: Int) { override fun setNavigationbarColor(color: Int) {
navigationBarColor = color navigationBarColor = color
if (panelState == BottomSheetBehavior.STATE_COLLAPSED) { if (panelState == BottomSheetBehavior.STATE_COLLAPSED) {
if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel() if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel()
super.setNavigationbarColor(color) super.setNavigationbarColor(color)
} }
} }
override fun setTaskDescriptionColor(color: Int) { override fun setTaskDescriptionColor(color: Int) {
taskColor = color taskColor = color
if (panelState == BottomSheetBehavior.STATE_COLLAPSED) { if (panelState == BottomSheetBehavior.STATE_COLLAPSED) {
super.setTaskDescriptionColor(color) super.setTaskDescriptionColor(color)
} }
} }
private fun updateTabs() { private fun updateTabs() {
bottomNavigationView.menu.clear() bottomNavigationView.menu.clear()
val currentTabs = PreferenceUtil.getInstance(this).libraryCategoryInfos val currentTabs = PreferenceUtil.getInstance(this).libraryCategoryInfos
for (tab in currentTabs) { for (tab in currentTabs) {
if (tab.visible) { if (tab.visible) {
val menu = tab.category val menu = tab.category
bottomNavigationView.menu.add( bottomNavigationView.menu.add(
0, menu.id, 0, menu.stringRes 0, menu.id, 0, menu.stringRes
).setIcon(menu.icon) ).setIcon(menu.icon)
} }
} }
} }
override fun dispatchTouchEvent(ev: MotionEvent?): Boolean { override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
if (ev?.action == MotionEvent.ACTION_DOWN) { if (ev?.action == MotionEvent.ACTION_DOWN) {
if (panelState == BottomSheetBehavior.STATE_EXPANDED) { if (panelState == BottomSheetBehavior.STATE_EXPANDED) {
val outRect = Rect() val outRect = Rect()
slidingPanel.getGlobalVisibleRect(outRect) slidingPanel.getGlobalVisibleRect(outRect)
if (!outRect.contains(ev.rawX.toInt(), ev.rawY.toInt())) { if (!outRect.contains(ev.rawX.toInt(), ev.rawY.toInt())) {
bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
} }
} }
} }
return super.dispatchTouchEvent(ev) return super.dispatchTouchEvent(ev)
} }
} }

View file

@ -2,199 +2,201 @@ package code.name.monkey.retromusic.activities.base
import android.graphics.Color import android.graphics.Color
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.os.* import android.os.Bundle
import android.view.* import android.os.Handler
import android.view.KeyEvent
import android.view.View
import android.view.WindowManager
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.* import code.name.monkey.appthemehelper.ATH
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.common.ATHToolbarActivity import code.name.monkey.appthemehelper.common.ATHToolbarActivity
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.appthemehelper.util.VersionUtils
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.RetroUtil
import code.name.monkey.retromusic.util.ThemeManager
abstract class AbsThemeActivity : ATHToolbarActivity(), Runnable { abstract class AbsThemeActivity : ATHToolbarActivity(), Runnable {
private val handler = Handler() private val handler = Handler()
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
setTheme(ThemeManager.getThemeResValue(this)) setTheme(ThemeManager.getThemeResValue(this))
hideStatusBar() hideStatusBar()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setImmersiveFullscreen()
registerSystemUiVisibility()
toggleScreenOn()
}
changeBackgroundShape() private fun toggleScreenOn() {
setImmersiveFullscreen() if (PreferenceUtil.getInstance(this).isScreenOnEnabled) {
registerSystemUiVisibility() window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
toggleScreenOn() } else {
} window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}
}
private fun toggleScreenOn() { override fun onWindowFocusChanged(hasFocus: Boolean) {
if (PreferenceUtil.getInstance(this).isScreenOnEnabled) { super.onWindowFocusChanged(hasFocus)
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) if (hasFocus) {
} else { hideStatusBar()
window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) handler.removeCallbacks(this)
} handler.postDelayed(this, 300)
} } else {
handler.removeCallbacks(this)
}
}
override fun onWindowFocusChanged(hasFocus: Boolean) { fun hideStatusBar() {
super.onWindowFocusChanged(hasFocus) hideStatusBar(PreferenceUtil.getInstance(this).fullScreenMode)
if (hasFocus) { }
hideStatusBar()
handler.removeCallbacks(this)
handler.postDelayed(this, 300)
} else {
handler.removeCallbacks(this)
}
}
fun hideStatusBar() { private fun hideStatusBar(fullscreen: Boolean) {
hideStatusBar(PreferenceUtil.getInstance(this).fullScreenMode) val statusBar = window.decorView.rootView.findViewById<View>(R.id.status_bar)
} if (statusBar != null) {
statusBar.visibility = if (fullscreen) View.GONE else View.VISIBLE
}
}
private fun hideStatusBar(fullscreen: Boolean) { private fun changeBackgroundShape() {
val statusBar = window.decorView.rootView.findViewById<View>(R.id.status_bar) var background: Drawable? = if (PreferenceUtil.getInstance(this).isRoundCorners)
if (statusBar != null) { ContextCompat.getDrawable(this, R.drawable.round_window)
statusBar.visibility = if (fullscreen) View.GONE else View.VISIBLE else ContextCompat.getDrawable(this, R.drawable.square_window)
} background = TintHelper.createTintedDrawable(background, ATHUtil.resolveColor(this, android.R.attr.windowBackground))
} window.setBackgroundDrawable(background)
}
private fun changeBackgroundShape() { fun setDrawUnderStatusBar() {
var background: Drawable? = if (PreferenceUtil.getInstance(this).isRoundCorners) ContextCompat.getDrawable( RetroUtil.setAllowDrawUnderStatusBar(window)
this, }
R.drawable.round_window
)
else ContextCompat.getDrawable(this, R.drawable.square_window)
background = TintHelper.createTintedDrawable(
background,
ATHUtil.resolveColor(this, R.attr.colorPrimary)
)
window.setBackgroundDrawable(background)
}
fun setDrawUnderStatusBar() { fun setDrawUnderNavigationBar() {
RetroUtil.setAllowDrawUnderStatusBar(window) RetroUtil.setAllowDrawUnderNavigationBar(window)
} }
fun setDrawUnderNavigationBar() { /**
RetroUtil.setAllowDrawUnderNavigationBar(window) * This will set the color of the view with the id "status_bar" on KitKat and Lollipop. On
} * Lollipop if no such view is found it will set the statusbar color using the native method.
*
* @param color the new statusbar color (will be shifted down on Lollipop and above)
*/
fun setStatusbarColor(color: Int) {
val statusBar = window.decorView.rootView.findViewById<View>(R.id.status_bar)
if (statusBar != null) {
when {
VersionUtils.hasMarshmallow() -> window.statusBarColor = color
VersionUtils.hasLollipop() -> statusBar.setBackgroundColor(
ColorUtil.darkenColor(
color
)
)
else -> statusBar.setBackgroundColor(color)
}
} else {
when {
VersionUtils.hasMarshmallow() -> window.statusBarColor = color
else -> window.statusBarColor = ColorUtil.darkenColor(color)
}
}
setLightStatusbarAuto(color)
}
/** fun setStatusbarColorAuto() {
* This will set the color of the view with the id "status_bar" on KitKat and Lollipop. On // we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat
* Lollipop if no such view is found it will set the statusbar color using the native method. //setStatusbarColor(ATHUtil.resolveColor(this, android.R.attr.windowBackground))
* }
* @param color the new statusbar color (will be shifted down on Lollipop and above)
*/
fun setStatusbarColor(color: Int) {
val statusBar = window.decorView.rootView.findViewById<View>(R.id.status_bar)
if (statusBar != null) {
when {
VersionUtils.hasMarshmallow() -> window.statusBarColor = color
VersionUtils.hasLollipop() -> statusBar.setBackgroundColor(
ColorUtil.darkenColor(
color
)
)
else -> statusBar.setBackgroundColor(color)
}
} else {
when {
VersionUtils.hasMarshmallow() -> window.statusBarColor = color
else -> window.statusBarColor = ColorUtil.darkenColor(color)
}
}
setLightStatusbarAuto(color)
}
fun setStatusbarColorAuto() { open fun setTaskDescriptionColor(@ColorInt color: Int) {
// we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat ATH.setTaskDescriptionColor(this, color)
setStatusbarColor(ATHUtil.resolveColor(this, R.attr.colorPrimary)) }
}
open fun setTaskDescriptionColor(@ColorInt color: Int) { fun setTaskDescriptionColorAuto() {
ATH.setTaskDescriptionColor(this, color) setTaskDescriptionColor(ATHUtil.resolveColor(this, R.attr.colorPrimary))
} }
fun setTaskDescriptionColorAuto() { open fun setNavigationbarColor(color: Int) {
setTaskDescriptionColor(ATHUtil.resolveColor(this, R.attr.colorPrimary)) if (ThemeStore.coloredNavigationBar(this)) {
} ATH.setNavigationbarColor(this, color)
} else {
ATH.setNavigationbarColor(this, Color.BLACK)
}
}
open fun setNavigationbarColor(color: Int) { open fun setNavigationBarColorPrimary() {
if (ThemeStore.coloredNavigationBar(this)) { ATH.setNavigationbarColor(this, ATHUtil.resolveColor(this, R.attr.colorPrimary))
ATH.setNavigationbarColor(this, color) }
} else {
ATH.setNavigationbarColor(this, Color.BLACK)
}
}
open fun setNavigationBarColorPrimary() { fun setNavigationbarColorAuto() {
ATH.setNavigationbarColor(this, ATHUtil.resolveColor(this, R.attr.colorPrimary)) setNavigationbarColor(ATHUtil.resolveColor(this, R.attr.colorSecondary))
} }
fun setNavigationbarColorAuto() { open fun setLightStatusbar(enabled: Boolean) {
setNavigationbarColor(ATHUtil.resolveColor(this, R.attr.colorSecondary)) ATH.setLightStatusbar(this, enabled)
} }
open fun setLightStatusbar(enabled: Boolean) { fun setLightStatusbarAuto(bgColor: Int) {
ATH.setLightStatusbar(this, enabled) setLightStatusbar(ColorUtil.isColorLight(bgColor))
} }
fun setLightStatusbarAuto(bgColor: Int) { open fun setLightNavigationBar(enabled: Boolean) {
setLightStatusbar(ColorUtil.isColorLight(bgColor)) if (!ATHUtil.isWindowBackgroundDark(this) and ThemeStore.coloredNavigationBar(this)) {
} ATH.setLightNavigationbar(this, enabled)
}
}
open fun setLightNavigationBar(enabled: Boolean) { private fun registerSystemUiVisibility() {
if (!ATHUtil.isWindowBackgroundDark(this) and ThemeStore.coloredNavigationBar(this)) { val decorView = window.decorView
ATH.setLightNavigationbar(this, enabled) decorView.setOnSystemUiVisibilityChangeListener { visibility ->
} if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) {
} setImmersiveFullscreen()
}
}
}
private fun registerSystemUiVisibility() { private fun unregisterSystemUiVisibility() {
val decorView = window.decorView val decorView = window.decorView
decorView.setOnSystemUiVisibilityChangeListener { visibility -> decorView.setOnSystemUiVisibilityChangeListener(null)
if (visibility and View.SYSTEM_UI_FLAG_FULLSCREEN == 0) { }
setImmersiveFullscreen()
}
}
}
private fun unregisterSystemUiVisibility() { private fun setImmersiveFullscreen() {
val decorView = window.decorView val flags = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
decorView.setOnSystemUiVisibilityChangeListener(null)
}
private fun setImmersiveFullscreen() { if (PreferenceUtil.getInstance(this).fullScreenMode) {
val flags = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) window.decorView.systemUiVisibility = flags
}
}
if (PreferenceUtil.getInstance(this).fullScreenMode) { private fun exitFullscreen() {
window.decorView.systemUiVisibility = flags window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE
} }
}
private fun exitFullscreen() { override fun run() {
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE setImmersiveFullscreen()
} }
override fun run() { override fun onStop() {
setImmersiveFullscreen() handler.removeCallbacks(this)
} super.onStop()
}
override fun onStop() { public override fun onDestroy() {
handler.removeCallbacks(this) super.onDestroy()
super.onStop() unregisterSystemUiVisibility()
} exitFullscreen()
}
public override fun onDestroy() { override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
super.onDestroy() if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
unregisterSystemUiVisibility() handler.removeCallbacks(this)
exitFullscreen() handler.postDelayed(this, 500)
} }
return super.onKeyDown(keyCode, event)
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean { }
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
handler.removeCallbacks(this)
handler.postDelayed(this, 500)
}
return super.onKeyDown(keyCode, event)
}
} }

View file

@ -1,210 +1,201 @@
package code.name.monkey.retromusic.adapter package code.name.monkey.retromusic.adapter
import android.util.DisplayMetrics import android.util.DisplayMetrics
import android.view.* import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.IntDef import androidx.annotation.IntDef
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.AppCompatTextView import androidx.appcompat.widget.AppCompatTextView
import androidx.recyclerview.widget.* import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.adapter.album.AlbumFullWidthAdapter import code.name.monkey.retromusic.adapter.album.AlbumFullWidthAdapter
import code.name.monkey.retromusic.adapter.artist.ArtistAdapter import code.name.monkey.retromusic.adapter.artist.ArtistAdapter
import code.name.monkey.retromusic.adapter.song.SongAdapter import code.name.monkey.retromusic.adapter.song.SongAdapter
import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.extensions.show
import code.name.monkey.retromusic.loaders.PlaylistSongsLoader import code.name.monkey.retromusic.loaders.PlaylistSongsLoader
import code.name.monkey.retromusic.model.* import code.name.monkey.retromusic.model.Album
import code.name.monkey.retromusic.model.Artist
import code.name.monkey.retromusic.model.Home
import code.name.monkey.retromusic.model.Playlist
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import com.google.android.material.textview.MaterialTextView
class HomeAdapter( class HomeAdapter(
private val activity: AppCompatActivity, private val displayMetrics: DisplayMetrics private val activity: AppCompatActivity, private val displayMetrics: DisplayMetrics
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() { ) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private var list = ArrayList<Home>() private var list = ArrayList<Home>()
override fun getItemViewType(position: Int): Int { override fun getItemViewType(position: Int): Int {
return list[position].homeSection return list[position].homeSection
} }
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
val layout = LayoutInflater.from(activity) val layout = LayoutInflater.from(activity)
.inflate(R.layout.section_recycler_view, parent, false) .inflate(R.layout.section_recycler_view, parent, false)
return when (viewType) { return when (viewType) {
RECENT_ARTISTS, TOP_ARTISTS -> ArtistViewHolder(layout) RECENT_ARTISTS, TOP_ARTISTS -> ArtistViewHolder(layout)
PLAYLISTS -> PlaylistViewHolder(layout) PLAYLISTS -> PlaylistViewHolder(layout)
else -> { else -> {
AlbumViewHolder( AlbumViewHolder(LayoutInflater.from(activity).inflate(R.layout.metal_section_recycler_view, parent, false))
LayoutInflater.from(activity).inflate( }
R.layout.metal_section_recycler_view, parent, false }
) }
)
}
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
println("ViewType ${getItemViewType(position)}") println("ViewType ${getItemViewType(position)}")
when (getItemViewType(position)) { when (getItemViewType(position)) {
RECENT_ALBUMS -> { RECENT_ALBUMS -> {
val viewHolder = holder as AlbumViewHolder val viewHolder = holder as AlbumViewHolder
viewHolder.bindView( viewHolder.bindView(
list[position].arrayList.toAlbums(), list[position].arrayList.toAlbums(),
R.string.recent_albums, R.string.recent_albums,
R.string.recent_added_albums R.string.recent_added_albums
) )
} }
TOP_ALBUMS -> { TOP_ALBUMS -> {
val viewHolder = holder as AlbumViewHolder val viewHolder = holder as AlbumViewHolder
viewHolder.bindView( viewHolder.bindView(
list[position].arrayList.toAlbums(), list[position].arrayList.toAlbums(),
R.string.top_albums, R.string.top_albums,
R.string.most_played_albums R.string.most_played_albums
) )
} }
RECENT_ARTISTS -> { RECENT_ARTISTS -> {
val viewHolder = holder as ArtistViewHolder val viewHolder = holder as ArtistViewHolder
viewHolder.bindView( viewHolder.bindView(
list[position].arrayList.toArtists(), list[position].arrayList.toArtists(),
R.string.recent_artists, R.string.recent_artists,
R.string.recent_added_artists R.string.recent_added_artists
) )
} }
TOP_ARTISTS -> { TOP_ARTISTS -> {
val viewHolder = holder as ArtistViewHolder val viewHolder = holder as ArtistViewHolder
viewHolder.bindView( viewHolder.bindView(
list[position].arrayList.toArtists(), list[position].arrayList.toArtists(),
R.string.top_artists, R.string.top_artists,
R.string.most_played_artists R.string.most_played_artists
) )
} }
PLAYLISTS -> { PLAYLISTS -> {
val viewHolder = holder as PlaylistViewHolder val viewHolder = holder as PlaylistViewHolder
viewHolder.bindView( viewHolder.bindView(
list[position].arrayList.toPlaylist(), list[position].arrayList.toPlaylist(),
R.string.favorites, R.string.favorites,
R.string.favorites_songs R.string.favorites_songs
) )
} }
} }
} }
override fun getItemCount(): Int { override fun getItemCount(): Int {
return list.size return list.size
} }
fun swapData(sections: ArrayList<Home>) { fun swapData(sections: ArrayList<Home>) {
list = sections list = sections
notifyDataSetChanged() notifyDataSetChanged()
} }
companion object { companion object {
@IntDef(RECENT_ALBUMS, TOP_ALBUMS, RECENT_ARTISTS, TOP_ARTISTS, PLAYLISTS) @IntDef(RECENT_ALBUMS, TOP_ALBUMS, RECENT_ARTISTS, TOP_ARTISTS, PLAYLISTS)
@Retention(AnnotationRetention.SOURCE) @Retention(AnnotationRetention.SOURCE)
annotation class HomeSection annotation class HomeSection
const val RECENT_ALBUMS = 3 const val RECENT_ALBUMS = 3
const val TOP_ALBUMS = 1 const val TOP_ALBUMS = 1
const val RECENT_ARTISTS = 2 const val RECENT_ARTISTS = 2
const val TOP_ARTISTS = 0 const val TOP_ARTISTS = 0
const val PLAYLISTS = 4 const val PLAYLISTS = 4
} }
private inner class AlbumViewHolder(view: View) : AbsHomeViewItem(view) { private inner class AlbumViewHolder(view: View) : AbsHomeViewItem(view) {
fun bindView(list: ArrayList<Album>, titleRes: Int, subtitleRes: Int) { fun bindView(list: ArrayList<Album>, titleRes: Int, subtitleRes: Int) {
if (list.isNotEmpty()) { if (list.isNotEmpty()) {
recyclerView.apply { recyclerView.apply {
show() show()
adapter = AlbumFullWidthAdapter(activity, list, displayMetrics) adapter = AlbumFullWidthAdapter(activity, list, displayMetrics)
} }
titleContainer.show() title.text = activity.getString(titleRes)
title.text = activity.getString(titleRes) }
text.text = activity.getString(subtitleRes) }
} }
}
inner class ArtistViewHolder(view: View) : AbsHomeViewItem(view) {
fun bindView(list: ArrayList<Artist>, titleRes: Int, subtitleRes: Int) {
if (list.isNotEmpty()) {
recyclerView.apply {
show()
layoutManager = GridLayoutManager(
activity, 1, GridLayoutManager.HORIZONTAL, false
)
val artistAdapter = ArtistAdapter(
activity,
list,
PreferenceUtil.getInstance(activity).getHomeGridStyle(activity),
false,
null
)
adapter = artistAdapter
}
title.text = activity.getString(titleRes)
}
}
}
} private inner class PlaylistViewHolder(view: View) : AbsHomeViewItem(view) {
fun bindView(arrayList: ArrayList<Playlist>, titleRes: Int, subtitleRes: Int) {
if (arrayList.isNotEmpty()) {
val songs = PlaylistSongsLoader.getPlaylistSongList(activity, arrayList[0])
if (songs.isNotEmpty()) {
recyclerView.apply {
show()
val songAdapter = SongAdapter(
activity, songs, R.layout.item_album_card, false, null
)
layoutManager = GridLayoutManager(
activity, 1, GridLayoutManager.HORIZONTAL, false
)
adapter = songAdapter
inner class ArtistViewHolder(view: View) : AbsHomeViewItem(view) { }
fun bindView(list: ArrayList<Artist>, titleRes: Int, subtitleRes: Int) { title.text = activity.getString(titleRes)
if (list.isNotEmpty()) { }
recyclerView.apply { }
show() }
layoutManager = GridLayoutManager( }
activity, 1, GridLayoutManager.HORIZONTAL, false
)
val artistAdapter = ArtistAdapter(
activity,
list,
PreferenceUtil.getInstance(activity).getHomeGridStyle(activity),
false,
null
)
adapter = artistAdapter
}
titleContainer.show()
title.text = activity.getString(titleRes)
text.text = activity.getString(subtitleRes)
}
}
}
private inner class PlaylistViewHolder(view: View) : AbsHomeViewItem(view) { open inner class AbsHomeViewItem(itemView: View) : RecyclerView.ViewHolder(itemView) {
fun bindView(arrayList: ArrayList<Playlist>, titleRes: Int, subtitleRes: Int) { val recyclerView: RecyclerView = itemView.findViewById(R.id.recyclerView)
if (arrayList.isNotEmpty()) { val title: AppCompatTextView = itemView.findViewById(R.id.title)
val songs = PlaylistSongsLoader.getPlaylistSongList(activity, arrayList[0]) }
if (songs.isNotEmpty()) {
recyclerView.apply {
show()
val songAdapter = SongAdapter(
activity, songs, R.layout.item_album_card, false, null
)
layoutManager = GridLayoutManager(
activity, 1, GridLayoutManager.HORIZONTAL, false
)
adapter = songAdapter
}
titleContainer.show()
title.text = activity.getString(titleRes)
text.text = activity.getString(subtitleRes)
}
}
}
}
open inner class AbsHomeViewItem(itemView: View) : RecyclerView.ViewHolder(itemView) {
val recyclerView: RecyclerView = itemView.findViewById(R.id.recyclerView)
val titleContainer: View = itemView.findViewById(R.id.titleContainer)
val title: AppCompatTextView = itemView.findViewById(R.id.title)
val text: MaterialTextView = itemView.findViewById(R.id.text)
}
} }
private fun <E> ArrayList<E>.toAlbums(): ArrayList<Album> { private fun <E> ArrayList<E>.toAlbums(): ArrayList<Album> {
val arrayList = ArrayList<Album>() val arrayList = ArrayList<Album>()
for (x in this) { for (x in this) {
arrayList.add(x as Album) arrayList.add(x as Album)
} }
return arrayList; return arrayList;
} }
private fun <E> ArrayList<E>.toArtists(): ArrayList<Artist> { private fun <E> ArrayList<E>.toArtists(): ArrayList<Artist> {
val arrayList = ArrayList<Artist>() val arrayList = ArrayList<Artist>()
for (x in this) { for (x in this) {
arrayList.add(x as Artist) arrayList.add(x as Artist)
} }
return arrayList; return arrayList;
} }
private fun <E> ArrayList<E>.toPlaylist(): ArrayList<Playlist> { private fun <E> ArrayList<E>.toPlaylist(): ArrayList<Playlist> {
val arrayList = ArrayList<Playlist>() val arrayList = ArrayList<Playlist>()
for (x in this) { for (x in this) {
arrayList.add(x as Playlist) arrayList.add(x as Playlist)
} }
return arrayList; return arrayList;
} }

View file

@ -2,95 +2,94 @@ package code.name.monkey.retromusic.adapter.song
import android.app.ActivityOptions import android.app.ActivityOptions
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.view.* import android.view.MenuItem
import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.interfaces.CabHolder import code.name.monkey.retromusic.interfaces.CabHolder
import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.NavigationUtil
import code.name.monkey.retromusic.util.RetroColorUtil
import com.google.android.material.button.MaterialButton import com.google.android.material.button.MaterialButton
import java.util.* import java.util.*
open class PlaylistSongAdapter( open class PlaylistSongAdapter(
activity: AppCompatActivity, activity: AppCompatActivity,
dataSet: ArrayList<Song>, dataSet: ArrayList<Song>,
itemLayoutRes: Int, itemLayoutRes: Int,
usePalette: Boolean, usePalette: Boolean,
cabHolder: CabHolder? cabHolder: CabHolder?
) : AbsOffsetSongAdapter(activity, dataSet, itemLayoutRes, usePalette, cabHolder, false) { ) : AbsOffsetSongAdapter(activity, dataSet, itemLayoutRes, usePalette, cabHolder, false) {
init { init {
this.setMultiSelectMenuRes(R.menu.menu_cannot_delete_single_songs_playlist_songs_selection) this.setMultiSelectMenuRes(R.menu.menu_cannot_delete_single_songs_playlist_songs_selection)
} }
override fun createViewHolder(view: View): SongAdapter.ViewHolder { override fun createViewHolder(view: View): SongAdapter.ViewHolder {
return ViewHolder(view) return ViewHolder(view)
} }
override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) { override fun onBindViewHolder(holder: SongAdapter.ViewHolder, position: Int) {
if (holder.itemViewType == OFFSET_ITEM) { if (holder.itemViewType == OFFSET_ITEM) {
val buttonColor = RetroColorUtil.toolbarColor(activity) val buttonColor = RetroColorUtil.toolbarColor(activity)
val textColor = MaterialValueHelper.getPrimaryTextColor( val textColor = MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(buttonColor))
activity, ColorUtil.isColorLight( val viewHolder = holder as ViewHolder
buttonColor
)
)
val viewHolder = holder as ViewHolder
viewHolder.playAction?.let { viewHolder.playAction?.let {
it.backgroundTintList = ColorStateList.valueOf(buttonColor) it.backgroundTintList = ColorStateList.valueOf(buttonColor)
it.setTextColor(textColor) it.setTextColor(textColor)
it.iconTint = ColorStateList.valueOf(textColor) it.iconTint = ColorStateList.valueOf(textColor)
it.setOnClickListener { it.setOnClickListener {
MusicPlayerRemote.openQueue(dataSet, 0, true) MusicPlayerRemote.openQueue(dataSet, 0, true)
} }
} }
viewHolder.shuffleAction?.let { viewHolder.shuffleAction?.let {
it.backgroundTintList = ColorStateList.valueOf(buttonColor) it.backgroundTintList = ColorStateList.valueOf(buttonColor)
it.setTextColor(textColor) it.setTextColor(textColor)
it.iconTint = ColorStateList.valueOf(textColor) it.iconTint = ColorStateList.valueOf(textColor)
it.setOnClickListener { it.setOnClickListener {
MusicPlayerRemote.openAndShuffleQueue(dataSet, true) MusicPlayerRemote.openAndShuffleQueue(dataSet, true)
} }
} }
} else { } else {
super.onBindViewHolder(holder, position - 1) super.onBindViewHolder(holder, position - 1)
} }
} }
open inner class ViewHolder(itemView: View) : AbsOffsetSongAdapter.ViewHolder(itemView) { open inner class ViewHolder(itemView: View) : AbsOffsetSongAdapter.ViewHolder(itemView) {
val playAction: MaterialButton? = itemView.findViewById(R.id.playAction) val playAction: MaterialButton? = itemView.findViewById(R.id.playAction)
val shuffleAction: MaterialButton? = itemView.findViewById(R.id.shuffleAction) val shuffleAction: MaterialButton? = itemView.findViewById(R.id.shuffleAction)
override var songMenuRes: Int override var songMenuRes: Int
get() = R.menu.menu_item_cannot_delete_single_songs_playlist_song get() = R.menu.menu_item_cannot_delete_single_songs_playlist_song
set(value) { set(value) {
super.songMenuRes = value super.songMenuRes = value
} }
override fun onSongMenuItemClick(item: MenuItem): Boolean { override fun onSongMenuItemClick(item: MenuItem): Boolean {
if (item.itemId == R.id.action_go_to_album) { if (item.itemId == R.id.action_go_to_album) {
val activityOptions = ActivityOptions.makeSceneTransitionAnimation( val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
activity, image, activity.getString( activity, image, activity.getString(
R.string.transition_album_art R.string.transition_album_art
) )
) )
NavigationUtil.goToAlbumOptions( NavigationUtil.goToAlbumOptions(
activity, dataSet[adapterPosition - 1].albumId, activityOptions activity, dataSet[adapterPosition - 1].albumId, activityOptions
) )
return true return true
} }
return super.onSongMenuItemClick(item) return super.onSongMenuItemClick(item)
} }
} }
companion object { companion object {
val TAG: String = PlaylistSongAdapter::class.java.simpleName val TAG: String = PlaylistSongAdapter::class.java.simpleName
} }
} }

View file

@ -2,17 +2,25 @@ package code.name.monkey.retromusic.adapter.song
import android.app.ActivityOptions import android.app.ActivityOptions
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.view.* import android.view.LayoutInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import code.name.monkey.appthemehelper.util.*
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.adapter.base.* import code.name.monkey.retromusic.adapter.base.AbsMultiSelectAdapter
import code.name.monkey.retromusic.glide.* import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
import code.name.monkey.retromusic.helper.* import code.name.monkey.retromusic.glide.RetroMusicColoredTarget
import code.name.monkey.retromusic.helper.menu.* import code.name.monkey.retromusic.glide.SongGlideRequest
import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.helper.SortOrder
import code.name.monkey.retromusic.helper.menu.SongMenuHelper
import code.name.monkey.retromusic.helper.menu.SongsMenuHelper
import code.name.monkey.retromusic.interfaces.CabHolder import code.name.monkey.retromusic.interfaces.CabHolder
import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.NavigationUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import com.afollestad.materialcab.MaterialCab import com.afollestad.materialcab.MaterialCab
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
@ -79,20 +87,8 @@ open class SongAdapter(
private fun setColors(color: Int, holder: ViewHolder) { private fun setColors(color: Int, holder: ViewHolder) {
if (holder.paletteColorContainer != null) { if (holder.paletteColorContainer != null) {
holder.paletteColorContainer?.setBackgroundColor(color) holder.paletteColorContainer?.setBackgroundColor(color)
holder.title?.setTextColor( //holder.title?.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)))
MaterialValueHelper.getPrimaryTextColor( //holder.text?.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)))
activity, ColorUtil.isColorLight(
color
)
)
)
holder.text?.setTextColor(
MaterialValueHelper.getSecondaryTextColor(
activity, ColorUtil.isColorLight(
color
)
)
)
} }
} }

View file

@ -26,7 +26,6 @@ fun AppCompatActivity.applyToolbar(toolbar: Toolbar) {
setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp) setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp)
ToolbarContentTintHelper.colorBackButton(toolbar) ToolbarContentTintHelper.colorBackButton(toolbar)
setBackgroundColor(ATHUtil.resolveColor(this@applyToolbar, R.attr.colorPrimary)) setBackgroundColor(ATHUtil.resolveColor(this@applyToolbar, R.attr.colorPrimary))
} }
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
} }

View file

@ -49,18 +49,16 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
setUpMiniPlayer() setUpMiniPlayer()
if (RetroUtil.isTablet()) { if (RetroUtil.isTablet()) {
actionNext.visibility = View.VISIBLE actionNext?.visibility = View.VISIBLE
actionPrevious.visibility = View.VISIBLE actionPrevious?.visibility = View.VISIBLE
actionPlayingQueue.visibility = View.VISIBLE actionPlayingQueue.visibility = View.VISIBLE
} else { } else {
actionNext.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.VISIBLE else View.GONE
actionPlayingQueue.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.GONE else View.VISIBLE actionPlayingQueue.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.GONE else View.VISIBLE
actionPrevious.visibility = if (PreferenceUtil.getInstance(requireContext()).isExtraControls) View.VISIBLE else View.GONE
} }
actionPlayingQueue.setOnClickListener(this) actionPlayingQueue.setOnClickListener(this)
actionNext.setOnClickListener(this) actionNext?.setOnClickListener(this)
actionPrevious.setOnClickListener(this) actionPrevious?.setOnClickListener(this)
} }

View file

@ -1,129 +1,127 @@
package code.name.monkey.retromusic.fragments.base package code.name.monkey.retromusic.fragments.base
import android.os.Bundle import android.os.Bundle
import android.view.* import android.view.LayoutInflater
import androidx.annotation.* import android.view.View
import android.view.ViewGroup
import androidx.annotation.NonNull
import androidx.annotation.StringRes
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.util.* import code.name.monkey.retromusic.util.DensityUtil
import code.name.monkey.retromusic.util.ViewUtil
import com.google.android.material.appbar.AppBarLayout import com.google.android.material.appbar.AppBarLayout
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.* import kotlinx.android.synthetic.main.fragment_main_activity_recycler_view.*
abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : RecyclerView.LayoutManager> : AbsLibraryPagerFragment(), AppBarLayout.OnOffsetChangedListener { abstract class AbsLibraryPagerRecyclerViewFragment<A : RecyclerView.Adapter<*>, LM : RecyclerView.LayoutManager> : AbsLibraryPagerFragment(), AppBarLayout.OnOffsetChangedListener {
protected var adapter: A? = null protected var adapter: A? = null
protected var layoutManager: LM? = null protected var layoutManager: LM? = null
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View? { ): View? {
val view = inflater.inflate( return inflater.inflate(R.layout.fragment_main_activity_recycler_view, container, false)
R.layout.fragment_main_activity_recycler_view, container, false }
);
return view
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
libraryFragment.addOnAppBarOffsetChangedListener(this) libraryFragment.addOnAppBarOffsetChangedListener(this)
initLayoutManager() initLayoutManager()
initAdapter() initAdapter()
setUpRecyclerView() setUpRecyclerView()
} }
private fun setUpRecyclerView() { private fun setUpRecyclerView() {
if (recyclerView is FastScrollRecyclerView) { if (recyclerView is FastScrollRecyclerView) {
ViewUtil.setUpFastScrollRecyclerViewColor( ViewUtil.setUpFastScrollRecyclerViewColor(requireActivity(), recyclerView as FastScrollRecyclerView)
requireActivity(), recyclerView as FastScrollRecyclerView }
) recyclerView.layoutManager = layoutManager
} recyclerView.adapter = adapter
recyclerView.layoutManager = layoutManager }
recyclerView.adapter = adapter
}
private fun initAdapter() { private fun initAdapter() {
adapter = createAdapter() adapter = createAdapter()
adapter?.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() { adapter?.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
override fun onChanged() { override fun onChanged() {
super.onChanged() super.onChanged()
checkIsEmpty() checkIsEmpty()
checkForPadding() checkForPadding()
} }
}) })
} }
protected open val emptyMessage: Int protected open val emptyMessage: Int
@StringRes get() = R.string.empty @StringRes get() = R.string.empty
private fun getEmojiByUnicode(unicode: Int): String { private fun getEmojiByUnicode(unicode: Int): String {
return String(Character.toChars(unicode)) return String(Character.toChars(unicode))
} }
private fun checkIsEmpty() { private fun checkIsEmpty() {
emptyEmoji.text = getEmojiByUnicode(0x1F631) emptyEmoji.text = getEmojiByUnicode(0x1F631)
emptyText.setText(emptyMessage) emptyText.setText(emptyMessage)
empty.visibility = if (adapter!!.itemCount == 0) View.VISIBLE else View.GONE empty.visibility = if (adapter!!.itemCount == 0) View.VISIBLE else View.GONE
} }
private fun checkForPadding() { private fun checkForPadding() {
val itemCount: Int = adapter?.itemCount ?: 0 val itemCount: Int = adapter?.itemCount ?: 0
val params = container.layoutParams as ViewGroup.MarginLayoutParams val params = container.layoutParams as ViewGroup.MarginLayoutParams
if (itemCount > 0 && MusicPlayerRemote.playingQueue.isNotEmpty()) { if (itemCount > 0 && MusicPlayerRemote.playingQueue.isNotEmpty()) {
val height = DensityUtil.dip2px(requireContext(), 104f) val height = DensityUtil.dip2px(requireContext(), 104f)
params.bottomMargin = height params.bottomMargin = height
} else { } else {
val height = DensityUtil.dip2px(requireContext(), 52f) val height = DensityUtil.dip2px(requireContext(), 52f)
params.bottomMargin = height params.bottomMargin = height
} }
} }
private fun initLayoutManager() { private fun initLayoutManager() {
layoutManager = createLayoutManager() layoutManager = createLayoutManager()
} }
protected abstract fun createLayoutManager(): LM protected abstract fun createLayoutManager(): LM
@NonNull @NonNull
protected abstract fun createAdapter(): A protected abstract fun createAdapter(): A
override fun onOffsetChanged(p0: AppBarLayout?, i: Int) { override fun onOffsetChanged(p0: AppBarLayout?, i: Int) {
container.setPadding( container.setPadding(
container.paddingLeft, container.paddingLeft,
container.paddingTop, container.paddingTop,
container.paddingRight, container.paddingRight,
libraryFragment.totalAppBarScrollingRange + i libraryFragment.totalAppBarScrollingRange + i)
) }
}
override fun onQueueChanged() { override fun onQueueChanged() {
super.onQueueChanged() super.onQueueChanged()
checkForPadding() checkForPadding()
} }
override fun onServiceConnected() { override fun onServiceConnected() {
super.onServiceConnected() super.onServiceConnected()
checkForPadding() checkForPadding()
} }
protected fun invalidateLayoutManager() { protected fun invalidateLayoutManager() {
initLayoutManager() initLayoutManager()
recyclerView.layoutManager = layoutManager recyclerView.layoutManager = layoutManager
} }
protected fun invalidateAdapter() { protected fun invalidateAdapter() {
initAdapter() initAdapter()
checkIsEmpty() checkIsEmpty()
recyclerView.adapter = adapter recyclerView.adapter = adapter
} }
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
libraryFragment.removeOnAppBarOffsetChangedListener(this) libraryFragment.removeOnAppBarOffsetChangedListener(this)
} }
fun recyclerView(): RecyclerView { fun recyclerView(): RecyclerView {
return recyclerView return recyclerView
} }
} }

View file

@ -26,11 +26,11 @@ abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
mainActivity.setBottomBarVisibility(View.VISIBLE) mainActivity.setBottomBarVisibility(View.VISIBLE)
} }
private fun setStatusbarColor(view: View, color: Int) { private fun setStatusBarColor(view: View, color: Int) {
val statusBar = view.findViewById<View>(R.id.status_bar) val statusBar = view.findViewById<View>(R.id.status_bar)
if (statusBar != null) { if (statusBar != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
statusBar.setBackgroundColor(color) //statusBar.setBackgroundColor(color)
mainActivity.setLightStatusbarAuto(color) mainActivity.setLightStatusbarAuto(color)
} else { } else {
statusBar.setBackgroundColor(color) statusBar.setBackgroundColor(color)
@ -38,13 +38,13 @@ abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
} }
} }
fun setStatusbarColorAuto(view: View) { fun setStatusBarColorAuto(view: View) {
val colorPrimary = ATHUtil.resolveColor(requireContext(), R.attr.colorPrimary) val colorPrimary = ATHUtil.resolveColor(requireContext(), android.R.attr.windowBackground)
// we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat // we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat
if (VersionUtils.hasMarshmallow()) { if (VersionUtils.hasMarshmallow()) {
setStatusbarColor(view, colorPrimary) setStatusBarColor(view, colorPrimary)
} else { } else {
setStatusbarColor(view, ColorUtil.darkenColor(colorPrimary)) setStatusBarColor(view, ColorUtil.darkenColor(colorPrimary))
} }
} }

View file

@ -108,7 +108,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
@Override @Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
setStatusbarColorAuto(view); setStatusBarColorAuto(view);
setupToolbar(); setupToolbar();
inflateFragment(); inflateFragment();
} }
@ -149,7 +149,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
getMainActivity().setSupportActionBar(toolbar); getMainActivity().setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(v -> showMainMenu(OptionsSheetDialogFragment.LIBRARY)); toolbar.setNavigationOnClickListener(v -> showMainMenu(OptionsSheetDialogFragment.LIBRARY));
ToolbarContentTintHelper.colorBackButton(toolbar); ToolbarContentTintHelper.colorBackButton(toolbar);
toolbar.setTitleTextColor(ATHUtil.INSTANCE.resolveColor(requireContext(), R.attr.colorOnSecondary)); //toolbar.setTitleTextColor(ATHUtil.INSTANCE.resolveColor(requireContext(), R.attr.colorOnSecondary));
} }
private Fragment getCurrentFragment() { private Fragment getCurrentFragment() {

View file

@ -131,4 +131,4 @@ class SongsFragment : AbsLibraryPagerRecyclerViewCustomGridSizeFragment<SongAdap
return fragment return fragment
} }
} }
}// Required empty public constructor }

View file

@ -221,7 +221,7 @@ public class FoldersFragment extends AbsMainActivityFragment implements
@Override @Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
setStatusbarColorAuto(view); setStatusBarColorAuto(view);
setUpAppbarColor(); setUpAppbarColor();
setUpBreadCrumbs(); setUpBreadCrumbs();
setUpRecyclerView(); setUpRecyclerView();

View file

@ -80,7 +80,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
NavigationUtil.goToUserInfo(requireActivity(), options) NavigationUtil.goToUserInfo(requireActivity(), options)
} }
if (!PreferenceUtil.getInstance(requireContext()).isHomeBanner) if (!PreferenceUtil.getInstance(requireContext()).isHomeBanner)
setStatusbarColorAuto(view) setStatusBarColorAuto(view)
lastAdded.setOnClickListener { lastAdded.setOnClickListener {
NavigationUtil.goToPlaylistNew(requireActivity(), LastAddedPlaylist(requireActivity())) NavigationUtil.goToPlaylistNew(requireActivity(), LastAddedPlaylist(requireActivity()))

View file

@ -14,17 +14,17 @@ import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper 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.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
import code.name.monkey.retromusic.service.MusicService import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_card_blur_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_card_blur_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.media_button.*
import kotlinx.android.synthetic.main.player_time.*
class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() { class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
@ -33,7 +33,6 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
progressViewUpdateHelper = MusicProgressViewUpdateHelper(this) progressViewUpdateHelper = MusicProgressViewUpdateHelper(this)

View file

@ -40,7 +40,7 @@ abstract class AbsSettingsFragment : ATEPreferenceFragmentCompat() {
NavigationUtil.goToProVersion(requireActivity()) NavigationUtil.goToProVersion(requireActivity())
} }
internal fun setSummary(preference: Preference, value: Any) { internal fun setSummary(preference: Preference, value: Any?) {
val stringValue = value.toString() val stringValue = value.toString()
if (preference is ListPreference) { if (preference is ListPreference) {
val index = preference.findIndexOfValue(stringValue) val index = preference.findIndexOfValue(stringValue)
@ -52,10 +52,12 @@ abstract class AbsSettingsFragment : ATEPreferenceFragmentCompat() {
abstract fun invalidateSettings() abstract fun invalidateSettings()
protected fun setSummary(preference: Preference) { protected fun setSummary(preference: Preference?) {
setSummary(preference, PreferenceManager preference?.let {
.getDefaultSharedPreferences(preference.context) setSummary(it, PreferenceManager
.getString(preference.key, "")!!) .getDefaultSharedPreferences(it.context)
.getString(it.key, ""))
}
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

View file

@ -37,7 +37,7 @@ class MainSettingsFragment : Fragment(), View.OnClickListener {
R.id.generalSettings -> inflateFragment(ThemeSettingsFragment(), R.string.general_settings_title) R.id.generalSettings -> inflateFragment(ThemeSettingsFragment(), R.string.general_settings_title)
R.id.audioSettings -> inflateFragment(AudioSettings(), R.string.pref_header_audio) R.id.audioSettings -> inflateFragment(AudioSettings(), R.string.pref_header_audio)
R.id.nowPlayingSettings -> inflateFragment(NowPlayingSettingsFragment(), R.string.now_playing) R.id.nowPlayingSettings -> inflateFragment(NowPlayingSettingsFragment(), R.string.now_playing)
R.id.personalizeSettings -> inflateFragment(PersonaizeSettingsFragment(), R.string.personalize) R.id.personalizeSettings -> inflateFragment(PersonalizeSettingsFragment(), R.string.personalize)
R.id.imageSettings -> inflateFragment(ImageSettingFragment(), R.string.pref_header_images) R.id.imageSettings -> inflateFragment(ImageSettingFragment(), R.string.pref_header_images)
R.id.notificationSettings -> inflateFragment(NotificationSettingsFragment(), R.string.notification) R.id.notificationSettings -> inflateFragment(NotificationSettingsFragment(), R.string.notification)
R.id.otherSettings -> inflateFragment(OtherSettingsFragment(), R.string.others) R.id.otherSettings -> inflateFragment(OtherSettingsFragment(), R.string.others)

View file

@ -19,23 +19,14 @@ import android.os.Bundle
import android.view.View import android.view.View
import androidx.preference.Preference import androidx.preference.Preference
import androidx.preference.TwoStatePreference import androidx.preference.TwoStatePreference
import code.name.monkey.retromusic.App
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
class PersonaizeSettingsFragment : AbsSettingsFragment(), SharedPreferences.OnSharedPreferenceChangeListener { class PersonalizeSettingsFragment : AbsSettingsFragment(), SharedPreferences.OnSharedPreferenceChangeListener {
override fun invalidateSettings() { override fun invalidateSettings() {
val cornerWindow: TwoStatePreference = findPreference("corner_window")!!
cornerWindow.setOnPreferenceChangeListener { _, newValue ->
if (newValue as Boolean && !App.isProVersion()) {
showProToastAndNavigate(activity!!.getString(R.string.pref_title_round_corners))
return@setOnPreferenceChangeListener false
}
requireActivity().recreate()
return@setOnPreferenceChangeListener true
}
val toggleFullScreen: TwoStatePreference = findPreference("toggle_full_screen")!! val toggleFullScreen: TwoStatePreference = findPreference("toggle_full_screen")!!
toggleFullScreen.setOnPreferenceChangeListener { _, _ -> toggleFullScreen.setOnPreferenceChangeListener { _, _ ->
requireActivity().recreate() requireActivity().recreate()
@ -45,7 +36,6 @@ class PersonaizeSettingsFragment : AbsSettingsFragment(), SharedPreferences.OnSh
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.pref_ui) addPreferencesFromResource(R.xml.pref_ui)
addPreferencesFromResource(R.xml.pref_window)
addPreferencesFromResource(R.xml.pref_lockscreen) addPreferencesFromResource(R.xml.pref_lockscreen)
} }

View file

@ -15,7 +15,7 @@ object ThemeManager {
@StyleRes @StyleRes
fun getThemeResValue(context: Context): Int = when (PreferenceUtil.getInstance(context).generalThemeValue) { fun getThemeResValue(context: Context): Int = when (PreferenceUtil.getInstance(context).generalThemeValue) {
"light" -> R.style.Theme_RetroMusic_Light "light" -> R.style.Theme_RetroMusic_Light
"auto" -> if (isSystemDarkModeEnabled(context)) R.style.Theme_RetroMusic else R.style.Theme_RetroMusic_Light "auto" -> R.style.Theme_RetroMusic_FollowSystem
"black" -> R.style.Theme_RetroMusic_Black "black" -> R.style.Theme_RetroMusic_Black
else -> R.style.Theme_RetroMusic else -> R.style.Theme_RetroMusic
/** /**

View file

@ -14,119 +14,107 @@
package code.name.monkey.retromusic.util package code.name.monkey.retromusic.util
import android.animation.* import android.animation.Animator
import android.animation.ArgbEvaluator
import android.animation.ObjectAnimator
import android.content.Context import android.content.Context
import android.content.res.* import android.content.res.ColorStateList
import android.graphics.* import android.content.res.Resources
import android.graphics.Color
import android.graphics.PorterDuff
import android.graphics.drawable.LayerDrawable import android.graphics.drawable.LayerDrawable
import android.os.Build import android.os.Build
import android.view.View import android.view.View
import android.view.animation.PathInterpolator import android.view.animation.PathInterpolator
import android.widget.* import android.widget.ProgressBar
import android.widget.SeekBar
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.* import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView import com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
object ViewUtil { object ViewUtil {
const val RETRO_MUSIC_ANIM_TIME = 1000 const val RETRO_MUSIC_ANIM_TIME = 1000
fun setProgressDrawable(progressSlider: SeekBar, newColor: Int, thumbTint: Boolean = false) { fun setProgressDrawable(progressSlider: SeekBar, newColor: Int, thumbTint: Boolean = false) {
if (thumbTint) { if (thumbTint) {
progressSlider.thumbTintList = ColorStateList.valueOf(newColor) progressSlider.thumbTintList = ColorStateList.valueOf(newColor)
} }
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
val layerDrawable = progressSlider.progressDrawable as LayerDrawable val layerDrawable = progressSlider.progressDrawable as LayerDrawable
val progressDrawable = layerDrawable.findDrawableByLayerId(android.R.id.progress) val progressDrawable = layerDrawable.findDrawableByLayerId(android.R.id.progress)
progressDrawable.setColorFilter(newColor, PorterDuff.Mode.SRC_IN) progressDrawable.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
} else { } else {
progressSlider.progressTintList = ColorStateList.valueOf(newColor) progressSlider.progressTintList = ColorStateList.valueOf(newColor)
} }
} }
fun setProgressDrawable(progressSlider: ProgressBar, newColor: Int) { fun setProgressDrawable(progressSlider: ProgressBar, newColor: Int) {
val ld = progressSlider.progressDrawable as LayerDrawable val ld = progressSlider.progressDrawable as LayerDrawable
val progress = ld.findDrawableByLayerId(android.R.id.progress) val progress = ld.findDrawableByLayerId(android.R.id.progress)
progress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN) progress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val background = ld.findDrawableByLayerId(android.R.id.background) val background = ld.findDrawableByLayerId(android.R.id.background)
val primaryColor = ATHUtil.resolveColor(progressSlider.context, R.attr.colorPrimary) val primaryColor = ATHUtil.resolveColor(progressSlider.context, android.R.attr.windowBackground)
background.setColorFilter( background.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(progressSlider.context, ColorUtil.isColorLight(primaryColor)), PorterDuff.Mode.SRC_IN)
MaterialValueHelper.getPrimaryDisabledTextColor(
progressSlider.context, ColorUtil.isColorLight(
primaryColor
)
), PorterDuff.Mode.SRC_IN
)
val secondaryProgress = ld.findDrawableByLayerId(android.R.id.secondaryProgress) val secondaryProgress = ld.findDrawableByLayerId(android.R.id.secondaryProgress)
secondaryProgress?.setColorFilter( secondaryProgress?.setColorFilter(
ColorUtil.withAlpha(newColor, 0.65f), PorterDuff.Mode.SRC_IN ColorUtil.withAlpha(newColor, 0.65f), PorterDuff.Mode.SRC_IN
) )
} }
private fun createColorAnimator( private fun createColorAnimator(
target: Any, propertyName: String, @ColorInt startColor: Int, @ColorInt endColor: Int target: Any, propertyName: String, @ColorInt startColor: Int, @ColorInt endColor: Int
): Animator { ): Animator {
val animator: ObjectAnimator val animator: ObjectAnimator
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
animator = ObjectAnimator.ofArgb(target, propertyName, startColor, endColor) animator = ObjectAnimator.ofArgb(target, propertyName, startColor, endColor)
} else { } else {
animator = ObjectAnimator.ofInt(target, propertyName, startColor, endColor) animator = ObjectAnimator.ofInt(target, propertyName, startColor, endColor)
animator.setEvaluator(ArgbEvaluator()) animator.setEvaluator(ArgbEvaluator())
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
animator.interpolator = PathInterpolator(0.4f, 0f, 1f, 1f) animator.interpolator = PathInterpolator(0.4f, 0f, 1f, 1f)
} }
animator.duration = RETRO_MUSIC_ANIM_TIME.toLong() animator.duration = RETRO_MUSIC_ANIM_TIME.toLong()
return animator return animator
} }
fun hitTest(v: View, x: Int, y: Int): Boolean { fun hitTest(v: View, x: Int, y: Int): Boolean {
val tx = (ViewCompat.getTranslationX(v) + 0.5f).toInt() val tx = (ViewCompat.getTranslationX(v) + 0.5f).toInt()
val ty = (ViewCompat.getTranslationY(v) + 0.5f).toInt() val ty = (ViewCompat.getTranslationY(v) + 0.5f).toInt()
val left = v.left + tx val left = v.left + tx
val right = v.right + tx val right = v.right + tx
val top = v.top + ty val top = v.top + ty
val bottom = v.bottom + ty val bottom = v.bottom + ty
return x in left..right && y >= top && y <= bottom return x in left..right && y >= top && y <= bottom
} }
fun setUpFastScrollRecyclerViewColor( fun setUpFastScrollRecyclerViewColor(
context: Context, context: Context,
recyclerView: FastScrollRecyclerView, recyclerView: FastScrollRecyclerView,
accentColor: Int = ThemeStore.accentColor(context) accentColor: Int = ThemeStore.accentColor(context)
) { ) {
recyclerView.setPopupBgColor(accentColor) recyclerView.setPopupBgColor(accentColor)
recyclerView.setPopupTextColor( recyclerView.setPopupTextColor(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(accentColor)))
MaterialValueHelper.getPrimaryTextColor( recyclerView.setThumbColor(accentColor)
context, ColorUtil.isColorLight( recyclerView.setTrackColor(Color.TRANSPARENT)
accentColor recyclerView.setTrackColor(ColorUtil.withAlpha(ATHUtil.resolveColor(context, R.attr.colorControlNormal), 0.12f))
) }
)
)
recyclerView.setThumbColor(accentColor)
recyclerView.setTrackColor(Color.TRANSPARENT)
recyclerView.setTrackColor(
ColorUtil.withAlpha(
ATHUtil.resolveColor(
context, R.attr.colorControlNormal
), 0.12f
)
)
} fun convertDpToPixel(dp: Float, resources: Resources): Float {
val metrics = resources.displayMetrics
fun convertDpToPixel(dp: Float, resources: Resources): Float { return dp * metrics.density
val metrics = resources.displayMetrics }
return dp * metrics.density
}
} }

View file

@ -1,5 +1,5 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android" <ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/ripple_material_light"> android:color="?attr/colorOnSecondary">
<item <item
android:id="@android:id/mask" android:id="@android:id/mask"

View file

@ -1,5 +1,5 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android" <ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/ate_control_normal_light"> android:color="?attr/colorOnSecondary">
<item <item
android:id="@android:id/mask" android:id="@android:id/mask"

View file

@ -1,5 +1,5 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android" <ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/ripple_material_light"> android:color="?attr/colorOnSecondary">
<item <item
android:id="@android:id/mask" android:id="@android:id/mask"

View file

@ -1,5 +1,5 @@
<ripple xmlns:android="http://schemas.android.com/apk/res/android" <ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/ripple_material_dark"> android:color="?attr/colorOnSecondary">
<item <item
android:id="@android:id/mask" android:id="@android:id/mask"

View file

@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<corners android:radius="8dp" /> <corners android:radius="8dp" />
<solid android:color="?colorPrimary" /> <solid android:color="?attr/colorSurface" />
</shape> </shape>

View file

@ -19,7 +19,7 @@
android:thickness="3dp" android:thickness="3dp"
android:type="sweep" android:type="sweep"
android:useLevel="false"> android:useLevel="false">
<solid android:color="?colorOnSecondary" /> <solid android:color="?android:attr/textColorSecondary" />
</shape> </shape>
</item> </item>
<item android:id="@android:id/progress"> <item android:id="@android:id/progress">
@ -28,7 +28,7 @@
android:thickness="3dp" android:thickness="3dp"
android:type="sweep" android:type="sweep"
android:useLevel="true"> android:useLevel="true">
<solid android:color="?colorAccent" /> <solid android:color="?attr/colorAccent" />
</shape> </shape>
</item> </item>

View file

@ -11,7 +11,7 @@
android:id="@+id/imageContainer" android:id="@+id/imageContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="156dp" android:layout_height="156dp"
app:cardCornerRadius="12dp" app:cardCornerRadius="16dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView

View file

@ -11,7 +11,7 @@
android:id="@+id/imageContainer" android:id="@+id/imageContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="256dp" android:layout_height="256dp"
app:cardCornerRadius="12dp" app:cardCornerRadius="16dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView

View file

@ -29,6 +29,6 @@
android:maxLines="1" android:maxLines="1"
android:paddingTop="12dp" android:paddingTop="12dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
tools:text="Name" /> tools:text="Name" />
</LinearLayout> </LinearLayout>

View file

@ -11,7 +11,7 @@
android:id="@+id/imageContainer" android:id="@+id/imageContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="196dp" android:layout_height="196dp"
app:cardCornerRadius="12dp" app:cardCornerRadius="16dp"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="true">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView

View file

@ -114,7 +114,6 @@
android:gravity="center" android:gravity="center"
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="@string/last_added" android:text="@string/last_added"
android:textColor="?colorOnSecondary"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v2" app:layout_constraintTop_toBottomOf="@+id/v2"
@ -152,7 +151,6 @@
android:gravity="center" android:gravity="center"
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="@string/my_top_tracks" android:text="@string/my_top_tracks"
android:textColor="?colorOnSecondary"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v3" app:layout_constraintTop_toBottomOf="@+id/v3"
@ -190,7 +188,6 @@
android:gravity="center" android:gravity="center"
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="@string/shuffle" android:text="@string/shuffle"
android:textColor="?colorOnSecondary"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/v4" app:layout_constraintTop_toBottomOf="@+id/v4"

View file

@ -8,7 +8,6 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorPrimary"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar

View file

@ -20,6 +20,7 @@
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:background="?attr/colorPrimary"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:liftOnScroll="true"> app:liftOnScroll="true">
@ -32,6 +33,7 @@
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
style="@style/Toolbar" style="@style/Toolbar"
android:background="?attr/colorPrimary"
app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp" app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp"
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" /> app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" />

View file

@ -240,8 +240,7 @@
android:text="@string/save" android:text="@string/save"
app:cornerRadius="25dp" app:cornerRadius="25dp"
app:icon="@drawable/ic_save_white_24dp" app:icon="@drawable/ic_save_white_24dp"
app:iconGravity="textStart" app:iconGravity="textStart" />
tools:backgroundTint="@color/md_red_400" />
<ProgressBar <ProgressBar
android:id="@+id/progressBar" android:id="@+id/progressBar"

View file

@ -13,7 +13,7 @@
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
android:textSize="16sp" /> android:textSize="16sp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@ -24,7 +24,7 @@
android:paddingTop="16dp" android:paddingTop="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
android:textSize="16sp" /> android:textSize="16sp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@ -35,7 +35,7 @@
android:paddingTop="16dp" android:paddingTop="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
android:textSize="16sp" /> android:textSize="16sp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@ -46,7 +46,7 @@
android:paddingTop="16dp" android:paddingTop="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
android:textSize="16sp" /> android:textSize="16sp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@ -57,7 +57,7 @@
android:paddingTop="16dp" android:paddingTop="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
android:textSize="16sp" /> android:textSize="16sp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@ -68,7 +68,7 @@
android:paddingTop="16dp" android:paddingTop="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
android:textSize="16sp" /> android:textSize="16sp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@ -80,7 +80,7 @@
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingBottom="16dp" android:paddingBottom="16dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
android:textSize="16sp" /> android:textSize="16sp" />
</LinearLayout> </LinearLayout>

View file

@ -145,6 +145,12 @@
</RelativeLayout> </RelativeLayout>
<include layout="@layout/volume_controls" /> <FrameLayout
android:id="@+id/volumeFragmentContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingStart="8dp"
android:paddingEnd="8dp" />
</LinearLayout> </LinearLayout>

View file

@ -15,11 +15,48 @@
android:orientation="vertical" android:orientation="vertical"
tools:ignore="MissingPrefix"> tools:ignore="MissingPrefix">
<include layout="@layout/volume_controls" /> <FrameLayout
android:id="@+id/volumeFragmentContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:paddingEnd="8dp" />
<include layout="@layout/media_button" /> <include layout="@layout/media_button" />
<include layout="@layout/player_time" /> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/songCurrentProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:textAppearance="@style/TextViewOverline"
android:textStyle="bold"
tools:text="22.00" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/songTotalTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:textAppearance="@style/TextViewOverline"
android:textStyle="bold"
tools:text="22.00" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatSeekBar <androidx.appcompat.widget.AppCompatSeekBar
android:id="@+id/progressSlider" android:id="@+id/progressSlider"

View file

@ -93,5 +93,11 @@
<include layout="@layout/media_button" /> <include layout="@layout/media_button" />
<include layout="@layout/volume_controls" /> <FrameLayout
android:id="@+id/volumeFragmentContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingStart="8dp"
android:paddingEnd="8dp" />
</LinearLayout> </LinearLayout>

View file

@ -37,7 +37,7 @@
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?colorPrimary" android:background="@android:color/transparent"
app:liftOnScroll="true"> app:liftOnScroll="true">
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
@ -48,7 +48,6 @@
android:layout_marginTop="@dimen/toolbar_margin_vertical" android:layout_marginTop="@dimen/toolbar_margin_vertical"
android:layout_marginEnd="@dimen/toolbar_margin_horizontal" android:layout_marginEnd="@dimen/toolbar_margin_horizontal"
android:layout_marginBottom="@dimen/toolbar_margin_vertical" android:layout_marginBottom="@dimen/toolbar_margin_vertical"
app:cardBackgroundColor="?colorSurface"
app:cardCornerRadius="8dp" app:cardCornerRadius="8dp"
app:cardUseCompatPadding="true" app:cardUseCompatPadding="true"
app:layout_scrollFlags="scroll|enterAlways"> app:layout_scrollFlags="scroll|enterAlways">

View file

@ -40,7 +40,7 @@
android:layout_gravity="center" android:layout_gravity="center"
android:text="@string/empty" android:text="@string/empty"
android:textAppearance="@style/TextViewHeadline5" android:textAppearance="@style/TextViewHeadline5"
android:textColor="?colorOnSecondary" android:textColor="?attr/colorOnSecondary"
tools:visibility="visible" /> tools:visibility="visible" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View file

@ -5,7 +5,7 @@
android:id="@+id/miniPlayerContent" android:id="@+id/miniPlayerContent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:background="?colorSecondary" android:background="?attr/colorSurface"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
tools:ignore="UnusedAttribute"> tools:ignore="UnusedAttribute">
@ -26,9 +26,8 @@
android:layout_margin="16dp" android:layout_margin="16dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:srcCompat="@drawable/ic_keyboard_arrow_up_24dp" app:srcCompat="@drawable/ic_keyboard_arrow_up_24dp"
app:tint="?colorOnSecondary" app:tint="?attr/colorControlNormal"
tools:ignore="ContentDescription" tools:ignore="ContentDescription" />
tools:tint="?colorOnSurface" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/miniPlayerTitle" android:id="@+id/miniPlayerTitle"
@ -45,23 +44,13 @@
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnSurface" android:textColor="?android:attr/textColorPrimary"
tools:text="@tools:sample/lorem/random" /> tools:text="@tools:sample/lorem/random" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actionPrevious"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:background="?roundSelector"
android:padding="6dp"
app:srcCompat="@drawable/ic_skip_previous_white_24dp"
app:tint="?colorOnSecondary" />
<FrameLayout <FrameLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="center_vertical" android:layout_height="wrap_content"
android:layout_height="wrap_content"> android:layout_gravity="center_vertical">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/miniPlayerPlayPauseButton" android:id="@+id/miniPlayerPlayPauseButton"
@ -71,7 +60,7 @@
android:background="?roundSelector" android:background="?roundSelector"
android:scaleType="center" android:scaleType="center"
app:srcCompat="@drawable/ic_pause_white_24dp" app:srcCompat="@drawable/ic_pause_white_24dp"
app:tint="?colorOnSecondary" app:tint="?attr/colorControlNormal"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ProgressBar <ProgressBar
@ -79,26 +68,13 @@
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:layout_width="44dp" android:layout_width="44dp"
android:layout_height="44dp" android:layout_height="44dp"
android:rotation="270"
android:layout_gravity="center" android:layout_gravity="center"
android:progressTint="?colorAccent"
android:indeterminate="false" android:indeterminate="false"
android:progressDrawable="@drawable/circle_progress" android:progressDrawable="@drawable/circle_progress"
android:rotation="270"
tools:progress="80" /> tools:progress="80" />
</FrameLayout> </FrameLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actionNext"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:background="?roundSelector"
android:padding="6dp"
app:srcCompat="@drawable/ic_skip_next_white_24dp"
app:tint="?colorOnSecondary"
tools:tint="?colorOnSecondary" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/actionPlayingQueue" android:id="@+id/actionPlayingQueue"
android:layout_width="40dp" android:layout_width="40dp"
@ -107,10 +83,7 @@
android:background="?roundSelector" android:background="?roundSelector"
android:padding="6dp" android:padding="6dp"
app:srcCompat="@drawable/ic_playlist_play_white_24dp" app:srcCompat="@drawable/ic_playlist_play_white_24dp"
app:tint="?colorOnSecondary" app:tint="?attr/colorControlNormal" />
tools:tint="?colorOnSecondary" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View file

@ -91,7 +91,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextViewBody2" android:textAppearance="@style/TextViewBody2"
android:textColor="?colorOnSecondary" android:textColor="?attr/colorOnSecondary"
app:layout_constraintBottom_toBottomOf="@+id/imageContainer" app:layout_constraintBottom_toBottomOf="@+id/imageContainer"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/imageContainer" app:layout_constraintStart_toEndOf="@+id/imageContainer"

View file

@ -19,7 +19,7 @@
android:background="?roundSelector" android:background="?roundSelector"
android:padding="8dp" android:padding="8dp"
app:srcCompat="@drawable/ic_volume_down_white_24dp" app:srcCompat="@drawable/ic_volume_down_white_24dp"
app:tint="?colorOnBackground" /> app:tint="?attr/colorControlNormal" />
<androidx.appcompat.widget.AppCompatSeekBar <androidx.appcompat.widget.AppCompatSeekBar
android:id="@+id/volumeSeekBar" android:id="@+id/volumeSeekBar"
@ -31,7 +31,7 @@
android:maxHeight="2dp" android:maxHeight="2dp"
android:progressDrawable="@drawable/color_progress_seek" android:progressDrawable="@drawable/color_progress_seek"
tools:progress="20" tools:progress="20"
tools:progressTint="?colorControlNormal" /> tools:progressTint="?attr/colorControlNormal" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
@ -42,5 +42,5 @@
android:background="?roundSelector" android:background="?roundSelector"
android:padding="8dp" android:padding="8dp"
app:srcCompat="@drawable/ic_volume_up_white_24dp" app:srcCompat="@drawable/ic_volume_up_white_24dp"
app:tint="?colorOnBackground" /> app:tint="?attr/colorControlNormal" />
</LinearLayout> </LinearLayout>

View file

@ -33,7 +33,7 @@
android:paddingEnd="8dp" android:paddingEnd="8dp"
android:paddingBottom="4dp" android:paddingBottom="4dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="My top tracks" /> tools:text="My top tracks" />
</LinearLayout> </LinearLayout>

View file

@ -28,6 +28,6 @@
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
android:paddingTop="12dp" android:paddingTop="12dp"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
tools:text="Name" /> tools:text="Name" />
</LinearLayout> </LinearLayout>

View file

@ -33,7 +33,6 @@
android:maxLines="1" android:maxLines="1"
android:padding="8dp" android:padding="8dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary"
tools:text="@string/home" /> tools:text="@string/home" />
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>

View file

@ -52,6 +52,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold" android:textStyle="bold"
tools:text="@string/bug_report_summary" /> tools:text="@string/bug_report_summary" />
@ -61,7 +62,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="4dp" android:paddingTop="4dp"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewBody2" android:textColor="?android:attr/textColorSecondary"
tools:text="@string/bug_report_summary" /> tools:text="@string/bug_report_summary" />
</LinearLayout> </LinearLayout>

View file

@ -19,7 +19,7 @@
android:layout_gravity="center_vertical|start" android:layout_gravity="center_vertical|start"
android:visibility="gone" android:visibility="gone"
app:srcCompat="@drawable/ic_drag_vertical_white_24dp" app:srcCompat="@drawable/ic_drag_vertical_white_24dp"
app:tint="?colorOnBackground" app:tint="?attr/colorControlNormal"
tools:ignore="ContentDescription" tools:ignore="ContentDescription"
tools:visibility="visible" /> tools:visibility="visible" />
@ -80,7 +80,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textAppearance="@style/TextViewSubtitle1" android:textAppearance="@style/TextViewSubtitle1"
android:textColor="?colorOnPrimary" android:textColor="?android:attr/textColorPrimary"
tools:text="Song name" /> tools:text="Song name" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@ -89,7 +89,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textColor="?colorOnBackground" android:textColor="?android:attr/textColorSecondary"
tools:text="Song artist name " /> tools:text="Song artist name " />
</LinearLayout> </LinearLayout>
@ -98,6 +98,6 @@
style="@style/OverFlowButton" style="@style/OverFlowButton"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0" android:layout_weight="0"
app:tint="?colorOnBackground" /> app:tint="?attr/colorControlNormal" />
</LinearLayout> </LinearLayout>

View file

@ -31,7 +31,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0" android:layout_weight="0"
android:padding="14dp" android:padding="14dp"
app:tint="?colorOnBackground" app:tint="?attr/colorControlNormal"
tools:srcCompat="@drawable/ic_folder_white_24dp" /> tools:srcCompat="@drawable/ic_folder_white_24dp" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@ -41,6 +41,6 @@
android:layout_weight="1" android:layout_weight="1"
android:text="@string/folders" android:text="@string/folders"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?attr/colorOnPrimary"
android:textSize="16sp" /> android:textSize="16sp" />
</LinearLayout> </LinearLayout>

View file

@ -85,7 +85,7 @@
style="@style/OverFlowButton" style="@style/OverFlowButton"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="0" android:layout_weight="0"
app:tint="?colorOnBackground" /> app:tint="?attr/colorControlNormal" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>

View file

@ -14,8 +14,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0" android:layout_weight="0"
android:paddingEnd="8dp"
android:paddingStart="8dp" android:paddingStart="8dp"
android:paddingEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
@ -27,10 +27,10 @@
android:fontFeatureSettings="onum" android:fontFeatureSettings="onum"
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
tools:text="@tools:sample/date/hhmm"
android:minHeight="40dp" android:minHeight="40dp"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnSecondary" /> android:textColor="?attr/colorOnSecondary"
tools:text="@tools:sample/date/hhmm" />
</FrameLayout> </FrameLayout>
@ -55,7 +55,7 @@
android:layout_weight="0" android:layout_weight="0"
android:fontFeatureSettings="onum" android:fontFeatureSettings="onum"
android:padding="4dp" android:padding="4dp"
android:textColor="?colorOnSecondary" android:textColor="?attr/colorOnSecondary"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/menu" app:layout_constraintEnd_toStartOf="@+id/menu"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@ -72,6 +72,6 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:tint="?colorOnSecondary" app:tint="?attr/colorControlNormal"
tools:visibility="visible" /> tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -31,7 +31,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:tint="?colorOnSurface" app:tint="?attr/colorControlNormal"
tools:srcCompat="@drawable/ic_telegram_white" /> tools:srcCompat="@drawable/ic_telegram_white" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View file

@ -32,7 +32,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:tint="?colorOnSurface" app:tint="?attr/colorControlNormal"
tools:srcCompat="@drawable/ic_telegram_white" /> tools:srcCompat="@drawable/ic_telegram_white" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View file

@ -31,7 +31,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:tint="?colorOnSurface" app:tint="?attr/colorControlNormal"
tools:srcCompat="@drawable/ic_telegram_white" /> tools:srcCompat="@drawable/ic_telegram_white" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View file

@ -29,7 +29,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:tint="?colorOnSurface" app:tint="?attr/colorControlNormal"
tools:srcCompat="@drawable/ic_telegram_white" /> tools:srcCompat="@drawable/ic_telegram_white" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View file

@ -29,7 +29,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:tint="?colorOnSurface" app:tint="?attr/colorControlNormal"
tools:srcCompat="@drawable/ic_telegram_white" /> tools:srcCompat="@drawable/ic_telegram_white" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView

View file

@ -8,8 +8,7 @@
android:layoutDirection="ltr" android:layoutDirection="ltr"
android:paddingStart="4dp" android:paddingStart="4dp"
android:paddingEnd="4dp" android:paddingEnd="4dp"
tools:ignore="ContentDescription,UnusedAttribute" tools:ignore="ContentDescription,UnusedAttribute">
tools:showIn="@layout/fragment_player_playback_controls">
<androidx.appcompat.widget.AppCompatImageButton <androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/previousButton" android:id="@+id/previousButton"

View file

@ -7,57 +7,17 @@
android:orientation="vertical" android:orientation="vertical"
android:paddingBottom="12dp"> android:paddingBottom="12dp">
<LinearLayout <com.google.android.material.textview.MaterialTextView
android:id="@+id/titleContainer" android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?rectSelector" android:padding="16dp"
android:clickable="true" android:textAppearance="@style/TextViewHeadline6"
android:focusable="true" android:textStyle="bold"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible"> tools:text="@tools:sample/full_names" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextViewHeadline6"
android:textStyle="bold"
tools:text="@tools:sample/full_names" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextViewCaption"
android:visibility="gone"
tools:text="@tools:sample/full_names" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:padding="16dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
app:tint="?colorOnPrimary" />
</LinearLayout>
<code.name.monkey.retromusic.views.MetalRecyclerViewPager <code.name.monkey.retromusic.views.MetalRecyclerViewPager
android:id="@+id/recyclerView" android:id="@+id/recyclerView"
@ -68,6 +28,6 @@
app:itemMargin="28dp" app:itemMargin="28dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer" app:layout_constraintTop_toBottomOf="@+id/title"
tools:visibility="visible" /> tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -12,7 +12,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="172dp" android:layout_height="172dp"
android:layout_margin="8dp" android:layout_margin="8dp"
app:cardCornerRadius="12dp"> app:cardCornerRadius="16dp">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image" android:id="@+id/image"

View file

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/songCurrentProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:textAppearance="@style/TextViewOverline"
android:textStyle="bold"
tools:text="22.00" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/songTotalTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:textAppearance="@style/TextViewOverline"
android:textStyle="bold"
tools:text="22.00" />
</LinearLayout>

View file

@ -19,19 +19,16 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
android:focusable="true" android:focusable="true"
android:foreground="?attr/rectSelector" android:foreground="?rectSelector"
android:minHeight="@dimen/md_listitem_height"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingLeft="16dp" android:paddingEnd="0dp"
android:paddingEnd="16dp"
android:paddingRight="16dp"
tools:gravity="start|center_vertical"> tools:gravity="start|center_vertical">
<com.google.android.material.checkbox.MaterialCheckBox <com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/checkbox" android:id="@+id/checkbox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:background="@null" android:background="@null"
android:clickable="false" android:clickable="false"
android:focusable="false" android:focusable="false"
@ -51,21 +48,21 @@
android:paddingBottom="@dimen/md_listitem_vertical_margin_choice" android:paddingBottom="@dimen/md_listitem_vertical_margin_choice"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextViewNormal" android:textAppearance="@style/TextViewNormal"
android:textColor="?colorOnPrimary" android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/md_listitem_textsize" android:textSize="@dimen/md_listitem_textsize"
tools:text="Item" /> tools:text="Item" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/drag_view" android:id="@+id/drag_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical" android:layout_gravity="end|center_vertical"
android:clickable="false" android:clickable="false"
android:focusable="false" android:focusable="false"
android:minHeight="@dimen/md_listitem_height" android:padding="16dp"
android:tintMode="src_in" android:tintMode="src_in"
app:srcCompat="@drawable/ic_drag_vertical_white_24dp" app:srcCompat="@drawable/ic_drag_vertical_white_24dp"
app:tint="?colorOnSecondary" app:tint="?attr/colorControlNormal"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
</LinearLayout> </LinearLayout>

View file

@ -7,57 +7,19 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:id="@+id/titleContainer" <com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?rectSelector" android:padding="16dp"
android:clickable="true" android:textAppearance="@style/TextViewHeadline6"
android:focusable="true" android:textStyle="bold"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible"> tools:text="@tools:sample/full_names" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextViewHeadline6"
android:textStyle="bold"
tools:text="@tools:sample/full_names" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextViewCaption"
android:visibility="gone"
tools:text="@tools:sample/full_names" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:padding="16dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
app:tint="?colorOnPrimary" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView" android:id="@+id/recyclerView"
@ -67,7 +29,7 @@
android:visibility="gone" android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleContainer" app:layout_constraintTop_toBottomOf="@+id/title"
tools:visibility="visible" /> tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -25,7 +25,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:behavior_hideable="false" app:behavior_hideable="false"
app:behavior_peekHeight="0dp" app:behavior_peekHeight="0dp"
app:cardBackgroundColor="?colorSecondary" app:cardBackgroundColor="?attr/colorSurface"
app:cardCornerRadius="0dp" app:cardCornerRadius="0dp"
app:cardUseCompatPadding="false" app:cardUseCompatPadding="false"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
@ -51,7 +51,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:background="?colorSecondary" android:background="?attr/colorSurface"
android:elevation="0dp" android:elevation="0dp"
android:visibility="gone" android:visibility="gone"
app:itemBackground="@drawable/bottom_navigation_item_background" app:itemBackground="@drawable/bottom_navigation_item_background"

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/volumeFragmentContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:paddingStart="8dp"
android:paddingEnd="8dp" />

View file

@ -18,6 +18,12 @@
<item name="android:textViewStyle">@style/TextViewStyleIm</item> <item name="android:textViewStyle">@style/TextViewStyleIm</item>
</style> </style>
<style name="Theme.RetroMusic.FollowSystem" parent="Theme.RetroMusic.Base.Adaptive">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowSharedElementsUseOverlay">false</item>
<item name="android:textViewStyle">@style/TextViewStyleIm</item>
</style>
<style name="Theme.RetroMusic.Notification" parent="@android:style/TextAppearance.Material.Notification" /> <style name="Theme.RetroMusic.Notification" parent="@android:style/TextAppearance.Material.Notification" />
<style name="Theme.RetroMusic.Notification.Title" parent="@android:style/TextAppearance.Material.Notification.Title" /> <style name="Theme.RetroMusic.Notification.Title" parent="@android:style/TextAppearance.Material.Notification.Title" />

View file

@ -6,6 +6,8 @@
<style name="Theme.RetroMusic.Black" parent="Theme.RetroMusic.Base.Black" /> <style name="Theme.RetroMusic.Black" parent="Theme.RetroMusic.Base.Black" />
<style name="Theme.RetroMusic.FollowSystem" parent="Theme.RetroMusic.Base.Adaptive" />
<style name="Theme.RetroMusic.Notification" parent="@android:style/TextAppearance.StatusBar.EventContent" /> <style name="Theme.RetroMusic.Notification" parent="@android:style/TextAppearance.StatusBar.EventContent" />
<style name="Theme.RetroMusic.Notification.Title" parent="@android:style/TextAppearance.StatusBar.EventContent.Title" /> <style name="Theme.RetroMusic.Notification.Title" parent="@android:style/TextAppearance.StatusBar.EventContent.Title" />

View file

@ -1,6 +1,26 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"> <resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.RetroMusic.Base.Adaptive" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="md_font_title">@font/circular</item>
<item name="md_font_body">@font/circular</item>
<item name="md_font_button">@font/circular</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowActivityTransitions">true</item>
<item name="android:fontFamily">@font/circular</item>
<item name="windowActionBarOverlay">true</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<item name="materialAlertDialogTheme">@style/MaterialAlertDialogTheme</item>
<item name="materialButtonStyle">@style/MaterialButtonTheme</item>
<item name="roundSelector">@drawable/round_selector</item>
<item name="rectSelector">@drawable/rect_selector</item>
<item name="rectSelectorStrong">@drawable/rect_selector_strong</item>
</style>
<style name="Theme.RetroMusic.Base" parent="Theme.MaterialComponents.NoActionBar"> <style name="Theme.RetroMusic.Base" parent="Theme.MaterialComponents.NoActionBar">
@ -170,11 +190,13 @@
<style name="MaterialButtonTheme" parent="Widget.MaterialComponents.Button"> <style name="MaterialButtonTheme" parent="Widget.MaterialComponents.Button">
<item name="cornerRadius">8dp</item> <item name="cornerRadius">8dp</item>
<item name="iconGravity">textStart</item>
<item name="iconTint">?attr/colorControlNormal</item>
<item name="backgroundTint">?attr/colorSurface</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textAppearance">@style/TextViewNormal</item> <item name="android:textAppearance">@style/TextViewNormal</item>
<item name="android:textAllCaps">false</item> <item name="android:textAllCaps">false</item>
<item name="android:paddingTop">@dimen/button_padding_vertical</item> <item name="android:paddingTop">@dimen/button_padding_vertical</item>
<item name="android:paddingBottom">@dimen/button_padding_vertical</item> <item name="android:paddingBottom">@dimen/button_padding_vertical</item>
<item name="iconGravity">textStart</item>
<item name="backgroundTint">?colorSurface</item>
</style> </style>
</resources> </resources>

View file

@ -1,32 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title"
android:title="@string/pref_header_lockscreen">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:defaultValue="true"
android:key="album_art_on_lockscreen"
android:layout="@layout/list_item_view_switch"
android:summary="@string/pref_summary_album_art_on_lockscreen"
android:title="@string/pref_title_album_art_on_lockscreen"
app:enableCopying="true" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:defaultValue="false"
android:dependency="album_art_on_lockscreen"
android:key="blurred_album_art"
android:layout="@layout/list_item_view_switch"
android:summary="@string/pref_summary_blurred_album_art"
android:title="@string/pref_title_blurred_album_art"
app:enableCopying="true" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:defaultValue="false"
android:key="lock_screen"
android:layout="@layout/list_item_view_switch"
android:summary="@string/pref_summary_lock_screen"
android:title="@string/pref_title_lock_screen"
app:enableCopying="true" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
</androidx.preference.PreferenceScreen> </androidx.preference.PreferenceScreen>

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory <code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title" android:layout="@layout/preference_category_title"
app:title="@string/grid_style_label"> app:title="@string/grid_style_label">
@ -49,30 +48,70 @@
android:summary="@string/pref_summary_home_banner" android:summary="@string/pref_summary_home_banner"
android:title="@string/pref_title_home_banner" /> android:title="@string/pref_title_home_banner" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory </code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
android:layout="@layout/preference_category_title"
android:title="@string/pref_header_library">
<code.name.monkey.retromusic.preferences.LibraryPreference <code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:key="library_categories" android:layout="@layout/preference_category_title"
android:layout="@layout/list_item_view" android:title="@string/pref_header_library">
android:summary="@string/pref_summary_library_categories"
android:title="@string/library_categories"
app:enableCopying="true"
app:icon="@drawable/ic_library_music_white_24dp" />
<code.name.monkey.retromusic.preferences.MaterialListPreference <code.name.monkey.retromusic.preferences.LibraryPreference
android:defaultValue="0" android:key="library_categories"
android:entries="@array/pref_tab_text_mode_titles" android:layout="@layout/list_item_view"
android:entryValues="@array/pref_tab_text_mode_values" android:summary="@string/pref_summary_library_categories"
android:key="tab_text_mode" android:title="@string/library_categories"
android:layout="@layout/list_item_view" app:enableCopying="true"
android:negativeButtonText="@null" app:icon="@drawable/ic_library_music_white_24dp" />
android:positiveButtonText="@null"
android:title="@string/pref_title_tab_text_mode" <code.name.monkey.retromusic.preferences.MaterialListPreference
app:enableCopying="true" /> android:defaultValue="0"
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory> android:entries="@array/pref_tab_text_mode_titles"
android:entryValues="@array/pref_tab_text_mode_values"
android:key="tab_text_mode"
android:layout="@layout/list_item_view"
android:negativeButtonText="@null"
android:positiveButtonText="@null"
android:title="@string/pref_title_tab_text_mode"
app:enableCopying="true" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title"
android:title="@string/window">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:defaultValue="false"
android:key="toggle_full_screen"
android:layout="@layout/list_item_view_switch"
android:summary="@string/pref_summary_toggle_full_screen"
android:title="@string/pref_title_toggle_full_screen"
app:icon="@drawable/ic_cellphone_white_24dp" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title"
android:title="@string/pref_header_lockscreen">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:defaultValue="true"
android:key="album_art_on_lockscreen"
android:layout="@layout/list_item_view_switch"
android:summary="@string/pref_summary_album_art_on_lockscreen"
android:title="@string/pref_title_album_art_on_lockscreen"
app:enableCopying="true" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:defaultValue="false"
android:dependency="album_art_on_lockscreen"
android:key="blurred_album_art"
android:layout="@layout/list_item_view_switch"
android:summary="@string/pref_summary_blurred_album_art"
android:title="@string/pref_title_blurred_album_art"
app:enableCopying="true" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:defaultValue="false"
android:key="lock_screen"
android:layout="@layout/list_item_view_switch"
android:summary="@string/pref_summary_lock_screen"
android:title="@string/pref_title_lock_screen"
app:enableCopying="true" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory> </code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
</androidx.preference.PreferenceScreen> </androidx.preference.PreferenceScreen>

View file

@ -1,25 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory
android:layout="@layout/preference_category_title"
android:title="@string/window">
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:defaultValue="false"
android:key="corner_window"
android:layout="@layout/list_item_view_switch"
android:summary="@string/pref_summary_round_corners"
android:title="@string/pref_title_round_corners"
app:enableCopying="true"
app:icon="@drawable/ic_rounded_corner" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:defaultValue="false"
android:key="toggle_full_screen"
android:layout="@layout/list_item_view_switch"
android:summary="@string/pref_summary_toggle_full_screen"
android:title="@string/pref_title_toggle_full_screen"
app:icon="@drawable/ic_cellphone_white_24dp" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
</androidx.preference.PreferenceScreen> </androidx.preference.PreferenceScreen>

View file

@ -7,6 +7,8 @@ import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
import code.name.monkey.appthemehelper.ATHActivity; import code.name.monkey.appthemehelper.ATHActivity;
import code.name.monkey.appthemehelper.R;
import code.name.monkey.appthemehelper.util.ATHUtil;
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper; import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;

View file

@ -84,7 +84,7 @@ public final class ToolbarContentTintHelper {
} }
public static void colorBackButton(@NonNull Toolbar toolbar) { public static void colorBackButton(@NonNull Toolbar toolbar) {
int color = ATHUtil.INSTANCE.resolveColor(toolbar.getContext(), R.attr.colorOnPrimary); int color = ATHUtil.INSTANCE.resolveColor(toolbar.getContext(), R.attr.colorControlNormal);
final PorterDuffColorFilter colorFilter = new PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY); final PorterDuffColorFilter colorFilter = new PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY);
for (int i = 0; i < toolbar.getChildCount(); i++) { for (int i = 0; i < toolbar.getChildCount(); i++) {
final View backButton = toolbar.getChildAt(i); final View backButton = toolbar.getChildAt(i);