Fix volume color, text style etc

This commit is contained in:
h4h13 2019-02-23 23:09:02 +05:30
parent 2c09074ad6
commit b9412c6ef6
81 changed files with 2028 additions and 305 deletions

View file

@ -32,8 +32,8 @@ android {
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic" applicationId "code.name.monkey.retromusic"
versionCode 289 versionCode 291
versionName '3.1.00' versionName '3.1.100'
multiDexEnabled true multiDexEnabled true
@ -159,7 +159,7 @@ dependencies {
implementation 'com.r0adkll:slidableactivity:2.0.6' implementation 'com.r0adkll:slidableactivity:2.0.6'
/*Backend all*/ /*Backend all*/
implementation project(':appthemehelper') implementation project(':appthemehelper')
implementation 'com.github.hannesa2:AndroidSlidingUpPanel:3.5.0' implementation 'com.github.kabouzeid:AndroidSlidingUpPanel:3.3.0-kmod3'
implementation 'com.github.AdrienPoupa:jaudiotagger:2.2.3' implementation 'com.github.AdrienPoupa:jaudiotagger:2.2.3'
implementation 'org.nanohttpd:nanohttpd:2.3.1' implementation 'org.nanohttpd:nanohttpd:2.3.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

View file

@ -1 +1 @@
<html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h4>v3.1.00</h4> <ul> <li>Added Filter song length</li> <li>Added Colorful settings icons</li> <li>Added Corners for dialog</li> </ul> <h4>v3.0.570</h4> <ul> <li>Fix Album/Artist square image</li> <li>Fix Delete dialog text format</li> <li>Fix Profile picture not showing after coming back from folders</li> <li>Fix Play button color i Simple and Plain themes</li> <li>Fix Sleep timer dialog crashing</li> <li>Fix Share song dialog title and text</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body> <html> <head> <style type="text/css"> * { word-wrap: break-word; } {style-placeholder} a { color: #{link-color}; } a:active { color: #{link-color-active}; } ul { list-style-position: outside; padding-left: 0; padding-right: 0; margin-left: 1em; } li { padding-top: 8px; } </style> </head> <body> <h4>v3.1.100</h4> <ul> <li>Fix Crash in Album tag editor while selecting options</li> <li>Added Classic theme</li> <li>Added Filter song length</li> <li>Added Favourites playlist icon will be accent color</li> <li>Added Colorful settings icons</li> <li>Added Corners for dialog</li> </ul> <h4>v3.0.570</h4> <ul> <li>Fix Album/Artist square image</li> <li>Fix Delete dialog text format</li> <li>Fix Profile picture not showing after coming back from folders</li> <li>Fix Play button color i Simple and Plain themes</li> <li>Fix Sleep timer dialog crashing</li> <li>Fix Share song dialog title and text</li> </ul> <p>If you see entire app white or dark or black select same theme in settings to fix </p> <p style="line-height:150%"><a href="https://github.com/h4h13/RetroMusicPlayer/wiki/FAQ">FAQ's</a> </p> <p style="line-height:150%">*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again. </p> </body>

View file

@ -1,9 +1,9 @@
package code.name.monkey.retromusic.model; package code.name.monkey.retromusic.model;
import androidx.annotation.StringRes;
import java.util.ArrayList; import java.util.ArrayList;
import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;
import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.HomeSection; import code.name.monkey.retromusic.ui.adapter.HomeAdapter.Companion.HomeSection;
public class Home { public class Home {
@ -13,14 +13,17 @@ public class Home {
int subtitle; int subtitle;
@HomeSection @HomeSection
int homeSection; int homeSection;
@DrawableRes
int icon;
ArrayList arrayList; ArrayList arrayList;
public Home(int title, int subtitle, ArrayList arrayList, @HomeSection int homeSection) { public Home(int title, int subtitle, ArrayList arrayList, @HomeSection int homeSection, @DrawableRes int icon) {
this.title = title; this.title = title;
this.subtitle = subtitle; this.subtitle = subtitle;
this.arrayList = arrayList; this.arrayList = arrayList;
this.homeSection = homeSection; this.homeSection = homeSection;
this.icon = icon;
} }
@HomeSection @HomeSection
@ -41,4 +44,9 @@ public class Home {
public ArrayList getArrayList() { public ArrayList getArrayList() {
return arrayList; return arrayList;
} }
@DrawableRes
public int getIcon() {
return icon;
}
} }

View file

@ -33,13 +33,13 @@ class HomePresenter(private val view: HomeContract.HomeView) : Presenter(), Home
topArtists: ArrayList<Artist>, genres: ArrayList<Genre>, topArtists: ArrayList<Artist>, genres: ArrayList<Genre>,
favoritePlaylist: ArrayList<Playlist> -> favoritePlaylist: ArrayList<Playlist> ->
val homes: ArrayList<Home> = ArrayList() val homes: ArrayList<Home> = ArrayList()
if (suggestions.isNotEmpty()) homes.add(Home(R.string.suggestion_songs, 0, suggestions, SUGGESTIONS)) if (suggestions.isNotEmpty()) homes.add(Home(R.string.suggestion_songs, 0, suggestions, SUGGESTIONS, R.drawable.ic_audiotrack_black_24dp))
if (recentArtists.isNotEmpty()) homes.add(Home(R.string.recent_artists, 0, recentArtists, RECENT_ARTISTS)) if (recentArtists.isNotEmpty()) homes.add(Home(R.string.recent_artists, 0, recentArtists, RECENT_ARTISTS, R.drawable.ic_artist_white_24dp))
if (recentAlbums.isNotEmpty()) homes.add(Home(R.string.recent_albums, 0, recentAlbums, RECENT_ALBUMS)) if (recentAlbums.isNotEmpty()) homes.add(Home(R.string.recent_albums, 0, recentAlbums, RECENT_ALBUMS, R.drawable.ic_album_white_24dp))
if (topArtists.isNotEmpty()) homes.add(Home(R.string.top_artists, 0, topArtists, TOP_ARTISTS)) if (topArtists.isNotEmpty()) homes.add(Home(R.string.top_artists, 0, topArtists, TOP_ARTISTS, R.drawable.ic_artist_white_24dp))
if (topAlbums.isNotEmpty()) homes.add(Home(R.string.top_albums, 0, topAlbums, TOP_ALBUMS)) if (topAlbums.isNotEmpty()) homes.add(Home(R.string.top_albums, 0, topAlbums, TOP_ALBUMS, R.drawable.ic_album_white_24dp))
if (favoritePlaylist.isNotEmpty()) homes.add(Home(R.string.favorites, 0, favoritePlaylist, PLAYLISTS)) if (favoritePlaylist.isNotEmpty()) homes.add(Home(R.string.favorites, 0, favoritePlaylist, PLAYLISTS, R.drawable.ic_favorite_white_24dp))
if (genres.isNotEmpty() && PreferenceUtil.getInstance().isGenreShown) homes.add(Home(R.string.genres, 0, genres, GENRES)) if (genres.isNotEmpty() && PreferenceUtil.getInstance().isGenreShown) homes.add(Home(R.string.genres, 0, genres, GENRES, R.drawable.ic_guitar_acoustic_white_24dp))
homes homes
}).subscribe({ homes -> }).subscribe({ homes ->
if (homes.isNotEmpty()) { if (homes.isNotEmpty()) {

View file

@ -10,9 +10,12 @@ import android.widget.ArrayAdapter
import android.widget.SeekBar import android.widget.SeekBar
import android.widget.TextView import android.widget.TextView
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
import code.name.monkey.retromusic.R import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.EqualizerHelper import code.name.monkey.retromusic.helper.EqualizerHelper
import code.name.monkey.retromusic.ui.activities.base.AbsMusicServiceActivity import code.name.monkey.retromusic.ui.activities.base.AbsMusicServiceActivity
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.activity_equalizer.* import kotlinx.android.synthetic.main.activity_equalizer.*
/** /**
@ -71,6 +74,7 @@ class EqualizerActivity : AbsMusicServiceActivity(), AdapterView.OnItemSelectedL
setupToolbar() setupToolbar()
equalizerSwitch.isChecked = EqualizerHelper.instance!!.equalizer.enabled equalizerSwitch.isChecked = EqualizerHelper.instance!!.equalizer.enabled
TintHelper.setTintAuto(equalizerSwitch, ThemeStore.accentColor(this), false)
equalizerSwitch.setOnCheckedChangeListener { buttonView, isChecked -> equalizerSwitch.setOnCheckedChangeListener { buttonView, isChecked ->
when (buttonView.id) { when (buttonView.id) {
R.id.equalizerSwitch -> { R.id.equalizerSwitch -> {
@ -86,9 +90,11 @@ class EqualizerActivity : AbsMusicServiceActivity(), AdapterView.OnItemSelectedL
presets.onItemSelectedListener = this presets.onItemSelectedListener = this
bassBoostStrength.progress = EqualizerHelper.instance!!.bassBoostStrength bassBoostStrength.progress = EqualizerHelper.instance!!.bassBoostStrength
ViewUtil.setProgressDrawable(bassBoostStrength, ThemeStore.accentColor(this))
bassBoostStrength.setOnSeekBarChangeListener(mSeekBarChangeListener) bassBoostStrength.setOnSeekBarChangeListener(mSeekBarChangeListener)
virtualizerStrength.progress = EqualizerHelper.instance!!.virtualizerStrength virtualizerStrength.progress = EqualizerHelper.instance!!.virtualizerStrength
ViewUtil.setProgressDrawable(virtualizerStrength, ThemeStore.accentColor(this))
virtualizerStrength.setOnSeekBarChangeListener(mSeekBarChangeListener) virtualizerStrength.setOnSeekBarChangeListener(mSeekBarChangeListener)
setupUI() setupUI()
@ -112,6 +118,7 @@ class EqualizerActivity : AbsMusicServiceActivity(), AdapterView.OnItemSelectedL
setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp) setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp)
setNavigationOnClickListener { onBackPressed() } setNavigationOnClickListener { onBackPressed() }
setSupportActionBar(this) setSupportActionBar(this)
ToolbarContentTintHelper.colorBackButton(this, ThemeStore.textColorSecondary(context))
} }
title = null title = null
} }
@ -149,6 +156,7 @@ class EqualizerActivity : AbsMusicServiceActivity(), AdapterView.OnItemSelectedL
maxDbTextView.text = String.format("%d dB", EqualizerHelper.instance!!.bandLevelHigh / 100) maxDbTextView.text = String.format("%d dB", EqualizerHelper.instance!!.bandLevelHigh / 100)
val bar = view.findViewById<SeekBar>(R.id.seekbar) val bar = view.findViewById<SeekBar>(R.id.seekbar)
ViewUtil.setProgressDrawable(bar, ThemeStore.accentColor(this))
bar.max = EqualizerHelper.instance!!.bandLevelHigh - EqualizerHelper.instance!! bar.max = EqualizerHelper.instance!!.bandLevelHigh - EqualizerHelper.instance!!
.bandLevelLow .bandLevelLow
bar.progress = EqualizerHelper.instance!!.getBandLevel(i) - EqualizerHelper.instance!! bar.progress = EqualizerHelper.instance!!.getBandLevel(i) - EqualizerHelper.instance!!

View file

@ -157,7 +157,7 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage
MaterialDialog(this).show { MaterialDialog(this).show {
title(text = "Add lyrics") title(text = "Add lyrics")
neutralButton(text = "Search") { RetroUtil.openUrl(this@LyricsActivity, googleSearchLrcUrl) } neutralButton(text = "Search") { RetroUtil.openUrl(this@LyricsActivity, getGoogleSearchUrl()) }
negativeButton(text = "Delete") { LyricUtil.deleteLrcFile(song.title, song.artistName) } negativeButton(text = "Delete") { LyricUtil.deleteLrcFile(song.title, song.artistName) }
input(hint = "Paste lyrics here", input(hint = "Paste lyrics here",
prefill = content, prefill = content,
@ -176,9 +176,9 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage
return paths return paths
} }
private fun getGoogleSearchUrl(title: String?, text: String?): String { private fun getGoogleSearchUrl(): String {
var baseUrl = "http://www.google.com/search?" var baseUrl = "http://www.google.com/search?"
var query = "$title+$text" var query = song.title + "+" + song.artistName
query = "q=" + query.replace(" ", "+") + " lyrics" query = "q=" + query.replace(" ", "+") + " lyrics"
baseUrl += query baseUrl += query
return baseUrl return baseUrl

View file

@ -92,7 +92,7 @@ class SupportDevelopmentActivity : AbsBaseActivity(), BillingProcessor.IBillingH
title = null title = null
donate.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this)) donate.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this))
ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.accentColor(this)) ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.textColorSecondary(this))
} }
override fun onBillingInitialized() { override fun onBillingInitialized() {

View file

@ -1,14 +1,320 @@
package code.name.monkey.retromusic.ui.activities.base package code.name.monkey.retromusic.ui.activities.base
import android.animation.ArgbEvaluator
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.ViewTreeObserver import android.view.ViewTreeObserver
import androidx.annotation.LayoutRes
import androidx.fragment.app.Fragment
import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.ui.fragments.MiniPlayerFragment
import code.name.monkey.retromusic.ui.fragments.NowPlayingScreen
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.adaptive.AdaptiveFragment
import code.name.monkey.retromusic.ui.fragments.player.blur.BlurPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.card.CardFragment
import code.name.monkey.retromusic.ui.fragments.player.cardblur.CardBlurFragment
import code.name.monkey.retromusic.ui.fragments.player.classic.ClassicPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.color.ColorFragment
import code.name.monkey.retromusic.ui.fragments.player.fit.FitFragment
import code.name.monkey.retromusic.ui.fragments.player.flat.FlatPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.full.FullPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.material.MaterialFragment
import code.name.monkey.retromusic.ui.fragments.player.normal.PlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.plain.PlainPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.simple.SimplePlayerFragment
import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.views.BottomNavigationBarTinted
import com.sothree.slidinguppanel.SlidingUpPanelLayout
import kotlinx.android.synthetic.main.sliding_music_panel_layout.*
abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), SlidingUpPanelLayout.PanelSlideListener, AbsPlayerFragment.Callbacks {
companion object {
val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName
}
private var miniPlayerFragment: MiniPlayerFragment? = null
private var playerFragment: AbsPlayerFragment? = null
private var currentNowPlayingScreen: NowPlayingScreen? = null
private var navigationBarColor: Int = 0
private var taskColor: Int = 0
private var lightStatusBar: Boolean = false
private var lightNavigationBar: Boolean = false
private var navigationBarColorAnimator: ValueAnimator? = null
protected abstract fun createContentView(): View
val panelState: SlidingUpPanelLayout.PanelState?
get() = slidingLayout.panelState
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(createContentView())
chooseFragmentForTheme()
setupSlidingUpPanel()
}
override fun onResume() {
super.onResume()
if (currentNowPlayingScreen != PreferenceUtil.getInstance().nowPlayingScreen) {
postRecreate()
}
}
override fun onDestroy() {
super.onDestroy()
if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel() // just in case
}
protected fun wrapSlidingMusicPanel(@LayoutRes resId: Int): View {
@SuppressLint("InflateParams")
val slidingMusicPanelLayout = layoutInflater.inflate(R.layout.sliding_music_panel_layout, null)
val contentContainer = slidingMusicPanelLayout.findViewById<ViewGroup>(R.id.mainContentFrame)
layoutInflater.inflate(resId, contentContainer)
return slidingMusicPanelLayout
}
fun setAntiDragView(antiDragView: View) {
slidingLayout.setAntiDragView(antiDragView);
}
private fun collapsePanel() {
slidingLayout.panelState = SlidingUpPanelLayout.PanelState.COLLAPSED
}
fun expandPanel() {
slidingLayout.panelState = SlidingUpPanelLayout.PanelState.EXPANDED
}
private fun setMiniPlayerAlphaProgress(progress: Float) {
if (miniPlayerFragment!!.view == null) return
val alpha = 1 - progress
miniPlayerFragment!!.view!!.alpha = alpha
// necessary to make the views below clickable
miniPlayerFragment!!.view!!.visibility = if (alpha == 0f) View.GONE else View.VISIBLE
bottomNavigationView.translationY = progress * 500
bottomNavigationView.alpha = alpha
}
open fun onPanelCollapsed() {
// restore values
super.setLightStatusbar(lightStatusBar)
super.setTaskDescriptionColor(taskColor)
super.setNavigationbarColor(navigationBarColor)
super.setLightNavigationBar(lightNavigationBar)
playerFragment!!.setMenuVisibility(false)
playerFragment!!.userVisibleHint = false
playerFragment!!.onHide()
}
open fun onPanelExpanded() {
val playerFragmentColor = playerFragment!!.paletteColor
super.setTaskDescriptionColor(playerFragmentColor)
playerFragment!!.setMenuVisibility(true)
playerFragment!!.userVisibleHint = true
playerFragment!!.onShow()
onPaletteColorChanged()
}
private fun setupSlidingUpPanel() {
slidingLayout.viewTreeObserver
.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
slidingLayout.viewTreeObserver.removeOnGlobalLayoutListener(this)
if (panelState == SlidingUpPanelLayout.PanelState.EXPANDED) {
onPanelSlide(slidingLayout, 1f)
onPanelExpanded()
} else if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) {
onPanelCollapsed()
} else {
playerFragment!!.onHide()
}
}
})
slidingLayout.addPanelSlideListener(this)
}
fun toggleBottomNavigationView(toggle: Boolean) {
bottomNavigationView.visibility = if (toggle) View.GONE else View.VISIBLE
}
fun getBottomNavigationView(): BottomNavigationBarTinted {
return bottomNavigationView
}
fun hideBottomBar(hide: Boolean) {
val heightOfBar = resources.getDimensionPixelSize(R.dimen.mini_player_height)
val heightOfBarWithTabs = resources.getDimensionPixelSize(R.dimen.mini_player_height_expanded)
if (hide) {
slidingLayout.panelHeight = 0
collapsePanel()
} else {
if (!MusicPlayerRemote.playingQueue.isEmpty()) {
slidingLayout.panelHeight = if (bottomNavigationView.visibility == View.VISIBLE) heightOfBarWithTabs else heightOfBar
}
}
}
fun setBottomBarVisibility(gone: Int) {
bottomNavigationView.visibility = gone
hideBottomBar(false)
}
private fun chooseFragmentForTheme() {
currentNowPlayingScreen = PreferenceUtil.getInstance().nowPlayingScreen
val fragment: Fragment = when (currentNowPlayingScreen) {
NowPlayingScreen.BLUR -> BlurPlayerFragment()
NowPlayingScreen.ADAPTIVE -> AdaptiveFragment()
NowPlayingScreen.NORMAL -> PlayerFragment()
NowPlayingScreen.CARD -> CardFragment()
NowPlayingScreen.BLUR_CARD -> CardBlurFragment()
NowPlayingScreen.FIT -> FitFragment()
NowPlayingScreen.FLAT -> FlatPlayerFragment()
NowPlayingScreen.FULL -> FullPlayerFragment()
NowPlayingScreen.PLAIN -> PlainPlayerFragment()
NowPlayingScreen.SIMPLE -> SimplePlayerFragment()
NowPlayingScreen.MATERIAL -> MaterialFragment()
NowPlayingScreen.COLOR -> ColorFragment()
NowPlayingScreen.CLASSIC -> ClassicPlayerFragment()
else -> PlayerFragment()
} // must implement AbsPlayerFragment
supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit()
supportFragmentManager.executePendingTransactions()
playerFragment = supportFragmentManager.findFragmentById(R.id.playerFragmentContainer) as AbsPlayerFragment
miniPlayerFragment = supportFragmentManager.findFragmentById(R.id.miniPlayerFragment) as MiniPlayerFragment
miniPlayerFragment!!.view!!.setOnClickListener { expandPanel() }
}
override fun onServiceConnected() {
super.onServiceConnected()
if (!MusicPlayerRemote.playingQueue.isEmpty()) {
slidingLayout.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
slidingLayout.viewTreeObserver.removeOnGlobalLayoutListener(this)
hideBottomBar(false)
}
})
} // don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout
}
override fun onQueueChanged() {
super.onQueueChanged()
hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty())
}
override fun onBackPressed() {
if (!handleBackPress())
super.onBackPressed()
}
open fun handleBackPress(): Boolean {
if (slidingLayout.panelHeight != 0 && playerFragment!!.onBackPressed())
return true
if (panelState == SlidingUpPanelLayout.PanelState.EXPANDED) {
collapsePanel()
return true
}
return false
}
override fun onPanelSlide(panel: View?, slideOffset: Float) {
setMiniPlayerAlphaProgress(slideOffset)
}
override fun onPanelStateChanged(panel: View, previousState: SlidingUpPanelLayout.PanelState, newState: SlidingUpPanelLayout.PanelState) {
when (newState) {
SlidingUpPanelLayout.PanelState.COLLAPSED -> onPanelCollapsed()
SlidingUpPanelLayout.PanelState.EXPANDED -> onPanelExpanded()
SlidingUpPanelLayout.PanelState.ANCHORED -> collapsePanel() // this fixes a bug where the panel would get stuck for some reason
else -> {
}
}
}
override fun onPaletteColorChanged() {
if (panelState == SlidingUpPanelLayout.PanelState.EXPANDED) {
val paletteColor = playerFragment!!.paletteColor
super.setTaskDescriptionColor(paletteColor)
val isColorLight = ColorUtil.isColorLight(paletteColor)
if (PreferenceUtil.getInstance().adaptiveColor &&
(currentNowPlayingScreen == NowPlayingScreen.NORMAL || currentNowPlayingScreen == NowPlayingScreen.FLAT)) {
super.setLightNavigationBar(true)
super.setLightStatusbar(isColorLight)
} else if (currentNowPlayingScreen == NowPlayingScreen.FULL || currentNowPlayingScreen == NowPlayingScreen.CARD ||
currentNowPlayingScreen == NowPlayingScreen.FIT || currentNowPlayingScreen == NowPlayingScreen.CLASSIC ||
currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) {
super.setLightStatusbar(false)
super.setLightNavigationBar(true)
} else if (currentNowPlayingScreen == NowPlayingScreen.COLOR) {
super.setNavigationbarColor(paletteColor)
super.setLightNavigationBar(isColorLight)
super.setLightStatusbar(isColorLight)
} else {
super.setLightStatusbar(ColorUtil.isColorLight(ThemeStore.primaryColor(this)))
super.setLightNavigationBar(true)
}
}
}
override fun setLightStatusbar(enabled: Boolean) {
lightStatusBar = enabled
if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) {
super.setLightStatusbar(enabled)
}
}
override fun setLightNavigationBar(enabled: Boolean) {
lightNavigationBar = enabled
if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) {
super.setLightNavigationBar(enabled)
}
}
override fun setNavigationbarColor(color: Int) {
navigationBarColor = color
if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) {
if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel()
super.setNavigationbarColor(color)
}
}
override fun setTaskDescriptionColor(color: Int) {
taskColor = color
if (panelState == SlidingUpPanelLayout.PanelState.COLLAPSED) {
super.setTaskDescriptionColor(color)
}
}
}
/*import android.animation.ArgbEvaluator
import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.os.Bundle
import android.os.PersistableBundle
import android.view.View
import android.view.ViewGroup
import android.view.ViewTreeObserver
import androidx.annotation.FloatRange import androidx.annotation.FloatRange
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.ThemeStore
import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.ColorUtil
@ -29,13 +335,14 @@ import code.name.monkey.retromusic.ui.fragments.player.material.MaterialFragment
import code.name.monkey.retromusic.ui.fragments.player.normal.PlayerFragment import code.name.monkey.retromusic.ui.fragments.player.normal.PlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.plain.PlainPlayerFragment import code.name.monkey.retromusic.ui.fragments.player.plain.PlainPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.simple.SimplePlayerFragment import code.name.monkey.retromusic.ui.fragments.player.simple.SimplePlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.classic.ClassicPlayerFragment
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.views.BottomNavigationBarTinted import code.name.monkey.retromusic.views.BottomNavigationBarTinted
import com.sothree.slidinguppanel.SlidingUpPanelLayout import com.sothree.slidinguppanel.SlidingUpPanelLayout
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState
import kotlinx.android.synthetic.main.sliding_music_panel_layout.* import kotlinx.android.synthetic.main.sliding_music_panel_layout.*
abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicServiceActivity(), SlidingUpPanelLayout.PanelSlideListener, AbsPlayerFragment.Callbacks { abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), SlidingUpPanelLayout.PanelSlideListener, AbsPlayerFragment.Callbacks {
private var miniPlayerFragment: MiniPlayerFragment? = null private var miniPlayerFragment: MiniPlayerFragment? = null
@ -218,6 +525,7 @@ abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicSe
NowPlayingScreen.SIMPLE -> SimplePlayerFragment() NowPlayingScreen.SIMPLE -> SimplePlayerFragment()
NowPlayingScreen.MATERIAL -> MaterialFragment() NowPlayingScreen.MATERIAL -> MaterialFragment()
NowPlayingScreen.COLOR -> ColorFragment() NowPlayingScreen.COLOR -> ColorFragment()
NowPlayingScreen.CLASSIC -> ClassicPlayerFragment()
else -> PlayerFragment() else -> PlayerFragment()
} // must implement AbsPlayerFragment } // must implement AbsPlayerFragment
supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit() supportFragmentManager.beginTransaction().replace(R.id.playerFragmentContainer, fragment).commit()
@ -256,7 +564,7 @@ abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicSe
super.setLightNavigationBar(true) super.setLightNavigationBar(true)
super.setLightStatusbar(isColorLight) super.setLightStatusbar(isColorLight)
} else if (currentNowPlayingScreen == NowPlayingScreen.FULL || currentNowPlayingScreen == NowPlayingScreen.CARD || } else if (currentNowPlayingScreen == NowPlayingScreen.FULL || currentNowPlayingScreen == NowPlayingScreen.CARD ||
currentNowPlayingScreen == NowPlayingScreen.FIT || currentNowPlayingScreen == NowPlayingScreen.FIT || currentNowPlayingScreen == NowPlayingScreen.CLASSIC||
currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) { currentNowPlayingScreen == NowPlayingScreen.BLUR || currentNowPlayingScreen == NowPlayingScreen.BLUR_CARD) {
super.setLightStatusbar(false) super.setLightStatusbar(false)
super.setLightNavigationBar(true) super.setLightNavigationBar(true)
@ -309,4 +617,7 @@ abstract class AbsSlidingMusicPanelActivity protected constructor() : AbsMusicSe
val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName val TAG: String = AbsSlidingMusicPanelActivity::class.java.simpleName
} }
} fun setAntiDragView( antiDragView:View ) {
slidingLayout.setAntiDragView(antiDragView);
}
}*/

View file

@ -27,7 +27,6 @@ import java.io.File
abstract class AbsTagEditorActivity : AbsBaseActivity() { abstract class AbsTagEditorActivity : AbsBaseActivity() {
private lateinit var items: Array<CharSequence>
protected var id: Int = 0 protected var id: Int = 0
private set private set
private var paletteColorPrimary: Int = 0 private var paletteColorPrimary: Int = 0
@ -37,7 +36,7 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() {
protected val show: MaterialDialog protected val show: MaterialDialog
get() = MaterialDialog(this@AbsTagEditorActivity).show { get() = MaterialDialog(this@AbsTagEditorActivity).show {
title(R.string.update_image) title(R.string.update_image)
listItems(items = items as List<String>) { _, position, _ -> listItems(items = items) { _, position, _ ->
when (position) { when (position) {
0 -> getImageFromLastFM() 0 -> getImageFromLastFM()
1 -> startImagePicker() 1 -> startImagePicker()
@ -187,9 +186,11 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() {
//observableScrollView.setScrollViewCallbacks(observableScrollViewCallbacks); //observableScrollView.setScrollViewCallbacks(observableScrollViewCallbacks);
} }
private lateinit var items: List<String>
private fun setUpImageView() { private fun setUpImageView() {
loadCurrentImage() loadCurrentImage()
items = arrayOf(getString(R.string.download_from_last_fm), getString(R.string.pick_from_local_storage), getString(R.string.web_search), getString(R.string.remove_cover)) items = listOf(getString(R.string.download_from_last_fm), getString(R.string.pick_from_local_storage), getString(R.string.web_search), getString(R.string.remove_cover))
editorImage.setOnClickListener { show } editorImage.setOnClickListener { show }
} }
@ -210,6 +211,8 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() {
protected abstract fun deleteImage() protected abstract fun deleteImage()
private fun setUpFab() { private fun setUpFab() {
saveFab.setColor(ThemeStore.accentColor(this))
saveFab.setShowTitle(true)
saveFab.apply { saveFab.apply {
scaleX = 0f scaleX = 0f
scaleY = 0f scaleY = 0f
@ -311,11 +314,11 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() {
protected abstract fun loadImageFromFile(selectedFile: Uri?) protected abstract fun loadImageFromFile(selectedFile: Uri?)
private fun getAudioFile(path: String): AudioFile { private fun getAudioFile(path: String): AudioFile {
try { return try {
return AudioFileIO.read(File(path)) AudioFileIO.read(File(path))
} catch (e: Exception) { } catch (e: Exception) {
Log.e(TAG, "Could not read audio file $path", e) Log.e(TAG, "Could not read audio file $path", e)
return AudioFile() AudioFile()
} }
} }

View file

@ -26,6 +26,7 @@ import code.name.monkey.retromusic.ui.adapter.album.AlbumFullWidthAdapter
import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter import code.name.monkey.retromusic.ui.adapter.artist.ArtistAdapter
import code.name.monkey.retromusic.ui.adapter.song.SongAdapter import code.name.monkey.retromusic.ui.adapter.song.SongAdapter
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.views.IconImageView
import code.name.monkey.retromusic.views.MetalRecyclerViewPager import code.name.monkey.retromusic.views.MetalRecyclerViewPager
import com.google.android.material.floatingactionbutton.FloatingActionButton import com.google.android.material.floatingactionbutton.FloatingActionButton
@ -97,6 +98,7 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar
} }
private inner class SuggestionViewHolder(view: View) : RecyclerView.ViewHolder(view) { private inner class SuggestionViewHolder(view: View) : RecyclerView.ViewHolder(view) {
private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon)
private val ids: ArrayList<Int> = arrayListOf(R.id.image_1, R.id.image_2, R.id.image_3, R.id.image_4, R.id.image_5, R.id.image_6, R.id.image_7) private val ids: ArrayList<Int> = arrayListOf(R.id.image_1, R.id.image_2, R.id.image_3, R.id.image_4, R.id.image_5, R.id.image_6, R.id.image_7)
private var textView: TextView = itemView.findViewById(R.id.text) private var textView: TextView = itemView.findViewById(R.id.text)
private var playSuggestion: FloatingActionButton = itemView.findViewById(R.id.playSuggestions) private var playSuggestion: FloatingActionButton = itemView.findViewById(R.id.playSuggestions)
@ -129,6 +131,7 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar
setTextColor(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color))) setTextColor(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)))
} }
title.text = activity.getString(home.title) title.text = activity.getString(home.title)
icon.setImageResource(home.icon)
playSuggestion.apply { playSuggestion.apply {
TintHelper.setTintAuto(this, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)), false) TintHelper.setTintAuto(this, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)), false)
@ -144,10 +147,12 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar
adapter = AlbumFullWidthAdapter(activity, home.arrayList as ArrayList<Album>, displayMetrics) adapter = AlbumFullWidthAdapter(activity, home.arrayList as ArrayList<Album>, displayMetrics)
} }
title.text = activity.getString(home.title) title.text = activity.getString(home.title)
icon.setImageResource(home.icon)
} }
val recyclerView: MetalRecyclerViewPager = view.findViewById(R.id.recyclerView) private val recyclerView: MetalRecyclerViewPager = view.findViewById(R.id.recyclerView)
val title: TextView = view.findViewById(R.id.sectionTitle) private val title: TextView = view.findViewById(R.id.sectionTitle)
private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon)
} }
@ -159,11 +164,12 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar
adapter = artistAdapter adapter = artistAdapter
} }
title.text = activity.getString(home.title) title.text = activity.getString(home.title)
icon.setImageResource(home.icon)
} }
val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView) private val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView)
val title: TextView = view.findViewById(R.id.sectionTitle) private val title: TextView = view.findViewById(R.id.sectionTitle)
private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon)
} }
private inner class GenreViewHolder(view: View) : RecyclerView.ViewHolder(view) { private inner class GenreViewHolder(view: View) : RecyclerView.ViewHolder(view) {
@ -175,10 +181,12 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar
} }
title.text = activity.getString(home.title) title.text = activity.getString(home.title)
icon.setImageResource(home.icon)
} }
val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView) private val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView)
val title: TextView = view.findViewById(R.id.sectionTitle) private val title: TextView = view.findViewById(R.id.sectionTitle)
private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon)
} }
@ -192,10 +200,11 @@ class HomeAdapter(private val activity: AppCompatActivity, private val homes: Ar
} }
title.text = activity.getString(home.title) title.text = activity.getString(home.title)
icon.setImageResource(home.icon)
} }
val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView) private val recyclerView: RecyclerView = view.findViewById(R.id.recyclerView)
val title: TextView = view.findViewById(R.id.sectionTitle) private val title: TextView = view.findViewById(R.id.sectionTitle)
private val icon: IconImageView = itemView.findViewById(R.id.sectionIcon)
} }
} }

View file

@ -213,6 +213,6 @@ open class AlbumAdapter(protected val activity: AppCompatActivity,
companion object { companion object {
val TAG = AlbumAdapter::class.java.simpleName val TAG = AlbumAdapter::class.java.simpleName!!
} }
} }

View file

@ -30,8 +30,10 @@ class PlayingQueueAdapter : SongAdapter, DraggableItemAdapter<PlayingQueueAdapte
this.current = current this.current = current
} }
constructor(activity: AppCompatActivity, dataSet: ArrayList<Song>, current: Int, constructor(activity: AppCompatActivity,
@LayoutRes itemLayoutRes: Int, @ColorInt color: Int) : super(activity, dataSet, itemLayoutRes, false, null) { dataSet: ArrayList<Song>, current: Int,
@LayoutRes itemLayoutRes: Int,
@ColorInt color: Int) : super(activity, dataSet, itemLayoutRes, false, null) {
this.current = current this.current = current
this.color = color this.color = color
} }

View file

@ -3,7 +3,6 @@ package code.name.monkey.retromusic.ui.fragments
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.res.ColorStateList
import android.os.Bundle import android.os.Bundle
import android.text.SpannableString import android.text.SpannableString
import android.text.SpannableStringBuilder import android.text.SpannableStringBuilder
@ -19,6 +18,7 @@ import code.name.monkey.retromusic.ui.fragments.base.AbsMusicServiceFragment
import code.name.monkey.retromusic.util.NavigationUtil import code.name.monkey.retromusic.util.NavigationUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.RetroUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_mini_player.* import kotlinx.android.synthetic.main.fragment_mini_player.*
open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpdateHelper.Callback, View.OnClickListener { open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpdateHelper.Callback, View.OnClickListener {
@ -66,7 +66,7 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda
private fun setUpMiniPlayer() { private fun setUpMiniPlayer() {
setUpPlayPauseButton() setUpPlayPauseButton()
progressBar.progressTintList = ColorStateList.valueOf(ThemeStore.accentColor(activity!!)) ViewUtil.setProgressDrawable(progressBar, ThemeStore.accentColor(context!!))
} }
private fun setUpPlayPauseButton() { private fun setUpPlayPauseButton() {

View file

@ -20,7 +20,7 @@ enum class NowPlayingScreen constructor(@param:StringRes @field:StringRes
MATERIAL(R.string.material, R.drawable.np_material, 11), MATERIAL(R.string.material, R.drawable.np_material, 11),
NORMAL(R.string.normal, R.drawable.np_normal, 0), NORMAL(R.string.normal, R.drawable.np_normal, 0),
PLAIN(R.string.plain, R.drawable.np_plain, 3), PLAIN(R.string.plain, R.drawable.np_plain, 3),
//TINY(R.string.tiny, R.drawable.np_tiny, 7), CLASSIC(R.string.classic, R.drawable.np_normal, 7),
SIMPLE(R.string.simple, R.drawable.np_simple, 8) SIMPLE(R.string.simple, R.drawable.np_simple, 8)
} }

View file

@ -11,6 +11,7 @@ import android.view.ViewGroup
import android.widget.SeekBar import android.widget.SeekBar
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
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.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.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicPlayerRemote
@ -33,9 +34,13 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
TintHelper.setTintAuto(volumeSeekBar, ThemeStore.textColorPrimary(context!!), false) setTintable(ThemeStore.accentColor(context!!))
volumeDown.setOnClickListener(this) volumeDown.setOnClickListener(this)
volumeUp.setOnClickListener(this) volumeUp.setOnClickListener(this)
val iconColor = ATHUtil.resolveColor(context!!, R.attr.iconColor)
volumeDown.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN)
volumeUp.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN)
} }
override fun onResume() { override fun onResume() {
@ -95,21 +100,16 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
} }
fun tintWhiteColor() { fun tintWhiteColor() {
setTintable(Color.WHITE) val iconColor = Color.WHITE
volumeDown.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN)
volumeUp.setColorFilter(iconColor, PorterDuff.Mode.SRC_IN)
TintHelper.setTintAuto(volumeSeekBar, iconColor, false)
} }
private fun setProgressBarColor(newColor: Int) {
//volumeSeekBar.thumbTintList = ColorStateList.valueOf(newColor)
//volumeSeekBar.progressTintList = ColorStateList.valueOf(newColor)
//volumeSeekBar.progressBackgroundTintList = ColorStateList.valueOf(newColor)
TintHelper.setTintAuto(volumeSeekBar, newColor, false)
volumeDown.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
volumeUp.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
}
fun setTintable(color: Int) { fun setTintable(color: Int) {
setProgressBarColor(color) TintHelper.setTintAuto(volumeSeekBar, color, false)
} }
fun removeThumb() { fun removeThumb() {
@ -125,6 +125,12 @@ class VolumeFragment : Fragment(), SeekBar.OnSeekBarChangeListener, OnAudioVolum
} }
} }
fun setTintableColor(color: Int) {
volumeDown.setColorFilter(color, PorterDuff.Mode.SRC_IN)
volumeUp.setColorFilter(color, PorterDuff.Mode.SRC_IN)
TintHelper.setTintAuto(volumeSeekBar, color, false)
}
companion object { companion object {
fun newInstance(): VolumeFragment { fun newInstance(): VolumeFragment {

View file

@ -57,6 +57,10 @@ abstract class AbsPlayerControlsFragment : AbsMusicServiceFragment(), MusicProgr
} }
private fun hideVolumeIfAvailable() { private fun hideVolumeIfAvailable() {
volumeFragmentContainer.visibility = if (PreferenceUtil.getInstance().volumeToggle) View.VISIBLE else View.GONE volumeFragmentContainer?.visibility = if (PreferenceUtil.getInstance().volumeToggle) View.VISIBLE else View.GONE
}
companion object {
const val SLIDER_ANIMATION_TIME: Long = 400
} }
} }

View file

@ -27,6 +27,7 @@ import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.RetroUtil
import code.name.monkey.retromusic.views.FitSystemWindowsLayout import code.name.monkey.retromusic.views.FitSystemWindowsLayout
abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItemClickListener, PaletteColorHolder, PlayerAlbumCoverFragment.Callbacks { abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItemClickListener, PaletteColorHolder, PlayerAlbumCoverFragment.Callbacks {
var callbacks: Callbacks? = null var callbacks: Callbacks? = null
private set private set
@ -189,9 +190,9 @@ abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItem
val activity = activity val activity = activity
if (activity != null) { if (activity != null) {
val res = if (isFavorite!!) val res = if (isFavorite!!)
R.drawable.ic_favorite_white_24dp code.name.monkey.retromusic.R.drawable.ic_favorite_white_24dp
else else
R.drawable.ic_favorite_border_white_24dp code.name.monkey.retromusic.R.drawable.ic_favorite_border_white_24dp
val drawable = RetroUtil.getTintedVectorDrawable(activity, res, toolbarIconColor()) val drawable = RetroUtil.getTintedVectorDrawable(activity, res, toolbarIconColor())
toolbarGet().menu.findItem(R.id.action_toggle_favorite).setIcon(drawable).title = if (isFavorite) getString(R.string.action_remove_from_favorites) else getString(R.string.action_add_to_favorites) toolbarGet().menu.findItem(R.id.action_toggle_favorite).setIcon(drawable).title = if (isFavorite) getString(R.string.action_remove_from_favorites) else getString(R.string.action_add_to_favorites)
} }
@ -202,14 +203,13 @@ abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItem
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
view.setBackgroundColor(ThemeStore.primaryColor(activity!!)) view.setBackgroundColor(ThemeStore.primaryColor(activity!!))
if (PreferenceUtil.getInstance().fullScreenMode) { if (PreferenceUtil.getInstance().fullScreenMode && view.findViewById<View>(R.id.status_bar) != null) {
if (view.findViewById<View>(R.id.status_bar) != null)
view.findViewById<View>(R.id.status_bar).visibility = View.GONE view.findViewById<View>(R.id.status_bar).visibility = View.GONE
} }
} }
fun setSafeArea(safeArea: View) { fun setSafeArea(safeArea: View) {
val layout = safeArea.findViewById<FitSystemWindowsLayout>(R.id.safeArea) val layout = safeArea.findViewById<FitSystemWindowsLayout>(code.name.monkey.retromusic.R.id.safeArea)
if (layout != null) { if (layout != null) {
layout.isFit = !PreferenceUtil.getInstance().fullScreenMode layout.isFit = !PreferenceUtil.getInstance().fullScreenMode
} }
@ -224,4 +224,13 @@ abstract class AbsPlayerFragment : AbsMusicServiceFragment(), Toolbar.OnMenuItem
val TAG: String = AbsPlayerFragment::class.java.simpleName val TAG: String = AbsPlayerFragment::class.java.simpleName
} }
protected fun getUpNextAndQueueTime(): String {
val duration = MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position)
return MusicUtil.buildInfoString(
resources.getString(R.string.up_next),
MusicUtil.getReadableDurationString(duration)
)
}
} }

View file

@ -14,6 +14,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.webkit.MimeTypeMap; import android.webkit.MimeTypeMap;
import android.widget.PopupMenu; import android.widget.PopupMenu;
import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -737,8 +738,15 @@ public class FoldersFragment extends AbsMainActivityFragment implements
@Override @Override
protected Dialog createDialog(@NonNull Context context) { protected Dialog createDialog(@NonNull Context context) {
return new MaterialDialog(context) View view= LayoutInflater.from(context).inflate(R.layout.progress_bar,null);
.title(R.string.listing_files,""); ProgressBar progressBar= view.findViewById(R.id.progressBar);
ViewUtil.INSTANCE.setProgressDrawable(progressBar,ThemeStore.Companion.accentColor(context));
MaterialDialog materialDialog= new MaterialDialog(context);
materialDialog.setContentView(R.layout.progress_bar);
materialDialog.title(R.string.listing_files,"");
return materialDialog;
} }
} }
} }

View file

@ -19,9 +19,11 @@ 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.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_adaptive_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_adaptive_player_playback_controls.*
class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() { class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() {
@ -29,6 +31,7 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null
private lateinit var volumeFragment: VolumeFragment
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -44,6 +47,8 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setUpMusicControllers() setUpMusicControllers()
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
playPauseButton.setOnClickListener { playPauseButton.setOnClickListener {
if (MusicPlayerRemote.isPlaying) { if (MusicPlayerRemote.isPlaying) {
MusicPlayerRemote.pauseSong() MusicPlayerRemote.pauseSong()
@ -103,7 +108,8 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() {
} }
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)), false) TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)), false)
TintHelper.setTintAuto(playPauseButton, colorFinal, true) TintHelper.setTintAuto(playPauseButton, colorFinal, true)
TintHelper.setTintAuto(progressSlider, colorFinal, false) ViewUtil.setProgressDrawable(progressSlider, colorFinal, true)
volumeFragment.setTintable(colorFinal)
} }
private fun updatePlayPauseColor() { private fun updatePlayPauseColor() {
@ -177,7 +183,7 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -35,6 +35,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null
private lateinit var volumeFragment: VolumeFragment
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -50,6 +51,8 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setUpMusicControllers() setUpMusicControllers()
playPauseButton.setOnClickListener { playPauseButton.setOnClickListener {
if (MusicPlayerRemote.isPlaying) { if (MusicPlayerRemote.isPlaying) {
MusicPlayerRemote.pauseSong() MusicPlayerRemote.pauseSong()
@ -58,7 +61,8 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
} }
showBonceAnimation() showBonceAnimation()
} }
val volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
volumeFragment.tintWhiteColor() volumeFragment.tintWhiteColor()
} }
@ -250,7 +254,7 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -19,8 +19,10 @@ 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.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil
import kotlinx.android.synthetic.main.fragment_card_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_card_player_playback_controls.*
import kotlinx.android.synthetic.main.media_button.* import kotlinx.android.synthetic.main.media_button.*
@ -29,6 +31,7 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null
private lateinit var volumeFragment: VolumeFragment
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -54,6 +57,8 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() {
} }
showBonceAnimation(playPauseButton) showBonceAnimation(playPauseButton)
} }
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
} }
private fun setupControls() { private fun setupControls() {
@ -121,8 +126,18 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() {
updatePlayPauseColor() updatePlayPauseColor()
updateProgressTextColor() updateProgressTextColor()
TintHelper.setTintAuto(playPauseButton!!, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(color)), false)
TintHelper.setTintAuto(playPauseButton!!, color, true) val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
color
} else {
ThemeStore.accentColor(context!!)
}
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(colorFinal)), false)
TintHelper.setTintAuto(playPauseButton, colorFinal, true)
volumeFragment.setTintable(colorFinal)
} }
private fun updatePlayPauseColor() { private fun updatePlayPauseColor() {
@ -196,7 +211,7 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -10,7 +10,6 @@ import android.view.ViewGroup
import android.view.animation.DecelerateInterpolator import android.view.animation.DecelerateInterpolator
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import android.widget.SeekBar import android.widget.SeekBar
import androidx.core.content.ContextCompat
import code.name.monkey.appthemehelper.util.ColorUtil 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
@ -23,6 +22,7 @@ import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.VolumeFragment import code.name.monkey.retromusic.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.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 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.* import kotlinx.android.synthetic.main.player_time.*
@ -31,7 +31,8 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
private lateinit var volumeFragment: VolumeFragment
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@ -60,6 +61,8 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
updateShuffleState() updateShuffleState()
updatePrevNextColor() updatePrevNextColor()
updateProgressTextColor() updateProgressTextColor()
ViewUtil.setProgressDrawable(progressSlider, Color.WHITE, true)
} }
@ -79,8 +82,8 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
} }
private fun setupVolumeControls() { private fun setupVolumeControls() {
val volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
volumeFragment.setTintable(ContextCompat.getColor(context!!, R.color.md_white_1000)) volumeFragment.tintWhiteColor()
} }
private fun updateProgressTextColor() { private fun updateProgressTextColor() {
@ -92,12 +95,12 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
progressViewUpdateHelper!!.start() progressViewUpdateHelper.start()
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
progressViewUpdateHelper!!.stop() progressViewUpdateHelper.stop()
} }
override fun onServiceConnected() { override fun onServiceConnected() {
@ -205,7 +208,7 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -0,0 +1,415 @@
package code.name.monkey.retromusic.ui.fragments.player.classic
import android.animation.Animator
import android.animation.AnimatorSet
import android.graphics.Color
import android.graphics.PorterDuff
import android.os.Build
import android.os.Bundle
import android.view.*
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import code.name.monkey.appthemehelper.ThemeStore
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.dialogs.SongShareDialog
import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.helper.menu.SongMenuHelper
import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.model.lyrics.Lyrics
import code.name.monkey.retromusic.ui.activities.base.AbsSlidingMusicPanelActivity
import code.name.monkey.retromusic.ui.adapter.base.MediaEntryViewHolder
import code.name.monkey.retromusic.ui.adapter.song.PlayingQueueAdapter
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment
import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.RetroUtil
import code.name.monkey.retromusic.util.ViewUtil
import code.name.monkey.retromusic.views.WidthFitSquareLayout
import com.h6ah4i.android.widget.advrecyclerview.animator.RefactoredDefaultItemAnimator
import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager
import com.h6ah4i.android.widget.advrecyclerview.utils.WrapperAdapterUtils
import com.sothree.slidinguppanel.SlidingUpPanelLayout
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState.ANCHORED
import com.sothree.slidinguppanel.SlidingUpPanelLayout.PanelState.COLLAPSED
import kotlinx.android.synthetic.main.fragment_classic_player.*
import kotlinx.android.synthetic.main.fragment_classic_player_playback_controls.*
class ClassicPlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks, SlidingUpPanelLayout.PanelSlideListener {
override fun onPanelSlide(p0: View?, p1: Float) {
}
override fun onPanelStateChanged(p0: View?, p1: SlidingUpPanelLayout.PanelState?, p2: SlidingUpPanelLayout.PanelState?) {
when (p2) {
COLLAPSED -> onPanelCollapsed(p0!!)
ANCHORED -> playerSlidingLayout.panelState = COLLAPSED // this fixes a bug where the panel would get stuck for some reason
else -> {
}
}
}
override fun toolbarGet(): Toolbar {
return playerToolbar
}
override fun onShow() {
classicPlaybackControlsFragment.show()
}
override fun onHide() {
classicPlaybackControlsFragment.hide()
onBackPressed()
}
override fun onBackPressed(): Boolean {
var wasExpanded = false
if (playerSlidingLayout != null) {
wasExpanded = playerSlidingLayout.panelState === SlidingUpPanelLayout.PanelState.EXPANDED
playerSlidingLayout.panelState = COLLAPSED
}
return wasExpanded
}
override fun toolbarIconColor(): Int {
return Color.WHITE
}
override val paletteColor: Int
get() = lastColor
override fun onColorChanged(color: Int) {
animateColorChange(color)
classicPlaybackControlsFragment.setDark(ColorUtil.isColorLight(color))
callbacks?.onPaletteColorChanged()
}
override fun toggleFavorite(song: Song) {
super.toggleFavorite(song)
if (song.id == MusicPlayerRemote.currentSong.id) {
updateIsFavorite()
}
}
override fun onFavoriteToggled() {
toggleFavorite(MusicPlayerRemote.currentSong)
}
var lastColor: Int = 0
lateinit var classicPlaybackControlsFragment: ClassicPlayerPlaybackControlsFragment
private var playerAlbumCoverFragment: PlayerAlbumCoverFragment? = null
private lateinit var layoutManager: LinearLayoutManager
private lateinit var playingQueueAdapter: PlayingQueueAdapter
private lateinit var wrappedAdapter: RecyclerView.Adapter<*>
private lateinit var recyclerViewDragDropManager: RecyclerViewDragDropManager
private var lyrics: Lyrics? = null
private lateinit var impl: Impl
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
if (RetroUtil.isLandscape()) {
impl = LandscapeImpl(this)
} else {
impl = PortraitImpl(this)
}
return inflater.inflate(R.layout.fragment_classic_player, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
impl.init()
setUpPlayerToolbar()
setUpSubFragments()
setUpRecyclerView()
playerSlidingLayout.addPanelSlideListener(this)
playerSlidingLayout.setAntiDragView(view.findViewById<View>(code.name.monkey.retromusic.R.id.draggableArea))
view.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
view.viewTreeObserver.removeOnGlobalLayoutListener(this)
impl.setUpPanelAndAlbumCoverHeight()
}
})
// for some reason the xml attribute doesn't get applied here.
playingQueueCard.setCardBackgroundColor(ATHUtil.resolveColor(activity, code.name.monkey.retromusic.R.attr.cardBackgroundColor))
}
private fun setUpPlayerToolbar() {
playerToolbar.apply {
inflateMenu(code.name.monkey.retromusic.R.menu.menu_player)
setNavigationIcon(code.name.monkey.retromusic.R.drawable.ic_close_white_24dp)
setNavigationOnClickListener { v -> activity!!.onBackPressed() }
setOnMenuItemClickListener(this@ClassicPlayerFragment)
}
}
private fun setUpSubFragments() {
classicPlaybackControlsFragment = childFragmentManager.findFragmentById(R.id.playbackControlsFragment) as ClassicPlayerPlaybackControlsFragment
playerAlbumCoverFragment = childFragmentManager.findFragmentById(R.id.playerAlbumCoverFragment) as PlayerAlbumCoverFragment
playerAlbumCoverFragment?.setCallbacks(this)
}
private fun setUpRecyclerView() {
recyclerViewDragDropManager = RecyclerViewDragDropManager()
val animator = RefactoredDefaultItemAnimator()
playingQueueAdapter = PlayingQueueAdapter(
activity as AppCompatActivity,
MusicPlayerRemote.playingQueue,
MusicPlayerRemote.position,
R.layout.item_queue)
wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(playingQueueAdapter)
layoutManager = LinearLayoutManager(activity)
playerRecyclerView.layoutManager = layoutManager
playerRecyclerView.adapter = wrappedAdapter
playerRecyclerView.itemAnimator = animator
recyclerViewDragDropManager.attachRecyclerView(playerRecyclerView)
layoutManager.scrollToPositionWithOffset(MusicPlayerRemote.position + 1, 0)
}
override fun onDestroyView() {
if (playerSlidingLayout != null) {
playerSlidingLayout.removePanelSlideListener(this)
}
recyclerViewDragDropManager.release()
if (playerRecyclerView != null) {
playerRecyclerView.itemAnimator = null
playerRecyclerView.adapter = null
}
WrapperAdapterUtils.releaseAll(wrappedAdapter)
super.onDestroyView()
}
override fun onPause() {
recyclerViewDragDropManager.cancelDrag()
super.onPause()
}
override fun onServiceConnected() {
updateQueue()
updateCurrentSong()
updateIsFavorite()
//updateLyrics()
}
override fun onPlayingMetaChanged() {
updateCurrentSong()
updateIsFavorite()
updateQueuePosition()
//updateLyrics()
}
override fun onQueueChanged() {
updateQueue()
}
override fun onMediaStoreChanged() {
updateQueue()
}
private fun updateQueue() {
playingQueueAdapter.swapDataSet(MusicPlayerRemote.playingQueue, MusicPlayerRemote.position)
playerQueueSubHeader.text = getUpNextAndQueueTime()
if (playerSlidingLayout.panelState === COLLAPSED) {
resetToCurrentPosition()
}
}
private fun updateQueuePosition() {
playingQueueAdapter.setCurrent(MusicPlayerRemote.position)
playerQueueSubHeader.text = getUpNextAndQueueTime()
if (playerSlidingLayout.panelState === COLLAPSED) {
resetToCurrentPosition()
}
}
private fun updateCurrentSong() {
impl.updateCurrentSong(MusicPlayerRemote.currentSong)
}
private fun animateColorChange(newColor: Int) {
impl.animateColorChange(newColor)
lastColor = newColor
}
private fun onPanelCollapsed(panel: View) {
resetToCurrentPosition()
}
private fun resetToCurrentPosition() {
playerRecyclerView.stopScroll()
layoutManager.scrollToPositionWithOffset(MusicPlayerRemote.position + 1, 0)
}
}
abstract class BaseImpl(private val fragment: ClassicPlayerFragment) : Impl {
fun createDefaultColorChangeAnimatorSet(color: Int): AnimatorSet {
val backgroundAnimator: Animator
backgroundAnimator = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val x = (fragment.classicPlaybackControlsFragment.playerPlayPauseFab.x + (fragment.classicPlaybackControlsFragment.playerPlayPauseFab.width / 2).toFloat() + fragment.classicPlaybackControlsFragment.view!!.x).toInt()
val y = (fragment.classicPlaybackControlsFragment.playerPlayPauseFab.y + (fragment.classicPlaybackControlsFragment.playerPlayPauseFab.height / 2).toFloat() + fragment.classicPlaybackControlsFragment.view!!.y + fragment.classicPlaybackControlsFragment.playerProgressSlider.height.toFloat()).toInt()
val startRadius = Math.max(fragment.classicPlaybackControlsFragment.playerPlayPauseFab.width / 2, fragment.classicPlaybackControlsFragment.playerPlayPauseFab.height / 2).toFloat()
val endRadius = Math.max(fragment.colorBackground.width, fragment.colorBackground.height).toFloat()
fragment.colorBackground.setBackgroundColor(color)
ViewAnimationUtils.createCircularReveal(fragment.colorBackground, x, y, startRadius, endRadius)
} else {
ViewUtil.createBackgroundColorTransition(fragment.colorBackground, fragment.lastColor, color)
}
val animatorSet = AnimatorSet()
animatorSet.play(backgroundAnimator)
if (!ATHUtil.isWindowBackgroundDark(fragment.activity!!)) {
val adjustedLastColor = if (ColorUtil.isColorLight(fragment.lastColor)) ColorUtil.darkenColor(fragment.lastColor) else fragment.lastColor
val adjustedNewColor = if (ColorUtil.isColorLight(color)) ColorUtil.darkenColor(color) else color
val subHeaderAnimator = ViewUtil.createTextColorTransition(fragment.playerQueueSubHeader, adjustedLastColor, adjustedNewColor)
animatorSet.play(subHeaderAnimator)
}
animatorSet.duration = ViewUtil.RETRO_MUSIC_ANIM_TIME.toLong()
return animatorSet
}
override fun animateColorChange(newColor: Int) {
if (ATHUtil.isWindowBackgroundDark(fragment.activity!!)) {
fragment.playerQueueSubHeader.setTextColor(ThemeStore.textColorSecondary(fragment.activity!!))
}
}
}
class PortraitImpl(private val fragment: ClassicPlayerFragment) : BaseImpl(fragment) {
override fun init() {
currentSongViewHolder = MediaEntryViewHolder(fragment.view?.findViewById(R.id.currentSong)!!)
currentSongViewHolder?.apply {
separator?.visibility = View.VISIBLE
shortSeparator?.visibility = View.GONE
image?.apply {
scaleType = ImageView.ScaleType.CENTER
setColorFilter(ATHUtil.resolveColor(fragment.activity!!, code.name.monkey.retromusic.R.attr.iconColor, ThemeStore.textColorSecondary(fragment.activity!!)), PorterDuff.Mode.SRC_IN)
setImageResource(code.name.monkey.retromusic.R.drawable.ic_equalizer_white_24dp)
}
imageTextContainer?.cardElevation = 0f
itemView.setOnClickListener {
// toggle the panel
if (fragment.playerSlidingLayout.panelState == COLLAPSED) {
fragment.playerSlidingLayout.panelState = SlidingUpPanelLayout.PanelState.EXPANDED
} else if (fragment.playerSlidingLayout.panelState == SlidingUpPanelLayout.PanelState.EXPANDED) {
fragment.playerSlidingLayout.panelState = COLLAPSED
}
}
menu?.setOnClickListener(object : SongMenuHelper.OnClickSongMenu((fragment.activity as AppCompatActivity?)!!) {
override val song: Song
get() = currentSong
override val menuRes: Int
get() = code.name.monkey.retromusic.R.menu.menu_item_playing_queue_song
override fun onMenuItemClick(item: MenuItem): Boolean {
when (item.itemId) {
code.name.monkey.retromusic.R.id.action_remove_from_playing_queue -> {
MusicPlayerRemote.removeFromQueue(MusicPlayerRemote.position)
return true
}
code.name.monkey.retromusic.R.id.action_share -> {
SongShareDialog.create(song).show(fragment.fragmentManager, "SONG_SHARE_DIALOG")
return true
}
}
return super.onMenuItemClick(item)
}
})
}
}
override fun updateCurrentSong(song: Song) {
currentSong = song
currentSongViewHolder?.apply {
title?.text = song.title
text?.text = MusicUtil.getSongInfoString(song)
}
}
override fun animateColorChange(newColor: Int) {
fragment.playerSlidingLayout.setBackgroundColor(fragment.lastColor)
createDefaultColorChangeAnimatorSet(newColor).start()
}
override fun setUpPanelAndAlbumCoverHeight() {
val albumCoverContainer = fragment.view!!.findViewById<WidthFitSquareLayout>(R.id.albumCoverContainer)
val availablePanelHeight = fragment.playerSlidingLayout.height - fragment.view!!.findViewById<View>(R.id.playerContent).height + ViewUtil.convertDpToPixel(8f, fragment.resources).toInt()
val minPanelHeight = ViewUtil.convertDpToPixel(72f + 24f, fragment.resources).toInt()
if (availablePanelHeight < minPanelHeight) {
albumCoverContainer.layoutParams.height = albumCoverContainer.height - (minPanelHeight - availablePanelHeight)
albumCoverContainer.forceSquare(false)
}
fragment.playerSlidingLayout.panelHeight = Math.max(minPanelHeight, availablePanelHeight)
(fragment.activity as AbsSlidingMusicPanelActivity).setAntiDragView(fragment.playerSlidingLayout.findViewById<View>(R.id.playerPanel))
}
private var currentSongViewHolder: MediaEntryViewHolder? = null
var currentSong = Song.EMPTY_SONG!!
}
class LandscapeImpl(private val fragment: ClassicPlayerFragment) : BaseImpl(fragment) {
override fun init() {
}
override fun updateCurrentSong(song: Song) {
fragment.playerToolbar.title = song.title
fragment.playerToolbar.subtitle = MusicUtil.getSongInfoString(song)
}
override fun animateColorChange(newColor: Int) {
fragment.playerSlidingLayout.setBackgroundColor(fragment.lastColor)
val animatorSet = createDefaultColorChangeAnimatorSet(newColor)
animatorSet.play(ViewUtil.createBackgroundColorTransition(fragment.playerToolbar, fragment.lastColor, newColor)).with(ViewUtil.createBackgroundColorTransition(fragment.view?.findViewById(R.id.status_bar)!!, ColorUtil.darkenColor(fragment.lastColor), ColorUtil.darkenColor(newColor)))
animatorSet.start()
}
override fun setUpPanelAndAlbumCoverHeight() {
val panelHeight = fragment.playerSlidingLayout.height - fragment.classicPlaybackControlsFragment.view?.height!!
fragment.playerSlidingLayout.panelHeight = panelHeight
(fragment.activity as AbsSlidingMusicPanelActivity).setAntiDragView(fragment.playerSlidingLayout.findViewById(R.id.playerPanel))
}
}
internal interface Impl {
fun init()
fun updateCurrentSong(song: Song)
fun animateColorChange(newColor: Int)
fun setUpPanelAndAlbumCoverHeight()
}

View file

@ -0,0 +1,235 @@
package code.name.monkey.retromusic.ui.fragments.player.classic
import android.animation.ObjectAnimator
import android.graphics.Color
import android.graphics.PorterDuff
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.DecelerateInterpolator
import android.view.animation.LinearInterpolator
import android.widget.SeekBar
import androidx.annotation.NonNull
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.retromusic.R
import code.name.monkey.retromusic.helper.MusicPlayerRemote
import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper
import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener
import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.views.PlayPauseDrawable
import kotlinx.android.synthetic.main.fragment_classic_player_playback_controls.*
class ClassicPlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
public override fun show() {
playerPlayPauseFab.animate()
.scaleX(1f)
.scaleY(1f)
.rotation(360f)
.setInterpolator(DecelerateInterpolator())
.start()
}
public override fun hide() {
if (playerPlayPauseFab != null) {
playerPlayPauseFab.scaleX = 0f
playerPlayPauseFab.scaleY = 0f
playerPlayPauseFab.rotation = 0f
}
}
override fun setDark(color: Int) {
}
fun setDark(dark: Boolean) {
if (dark) {
lastPlaybackControlsColor = MaterialValueHelper.getSecondaryTextColor(getActivity(), true);
lastDisabledPlaybackControlsColor = MaterialValueHelper.getSecondaryDisabledTextColor(getActivity(), true);
} else {
lastPlaybackControlsColor = MaterialValueHelper.getPrimaryTextColor(getActivity(), false);
lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(getActivity(), false);
}
volumeFragment.setTintableColor(lastPlaybackControlsColor)
updateRepeatState();
updateShuffleState();
updatePrevNextColor();
updateProgressTextColor();
}
private var playerFabPlayPauseDrawable: PlayPauseDrawable? = null
private var lastPlaybackControlsColor = 0
private var lastDisabledPlaybackControlsColor = 0
private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
private lateinit var volumeFragment: VolumeFragment
override fun onCreateView(@NonNull inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(code.name.monkey.retromusic.R.layout.fragment_classic_player_playback_controls, container, false)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
progressViewUpdateHelper = MusicProgressViewUpdateHelper(this)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setUpMusicControllers()
updateProgressTextColor()
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
}
private fun setUpMusicControllers() {
setUpPlayPauseFab()
setUpPrevNext()
setUpRepeatButton()
setUpShuffleButton()
setUpProgressSlider()
}
private fun updateProgressTextColor() {
val color = MaterialValueHelper.getPrimaryTextColor(context, false)
playerSongTotalTime.setTextColor(color)
playerSongCurrentProgress.setTextColor(color)
}
private fun setUpPlayPauseFab() {
val fabColor = Color.WHITE
TintHelper.setTintAuto(playerPlayPauseFab, fabColor, true)
playerFabPlayPauseDrawable = PlayPauseDrawable(activity!!)
playerPlayPauseFab.setImageDrawable(playerFabPlayPauseDrawable) // Note: set the drawable AFTER TintHelper.setTintAuto() was called
playerPlayPauseFab.setColorFilter(MaterialValueHelper.getPrimaryTextColor(context, ColorUtil.isColorLight(fabColor)), PorterDuff.Mode.SRC_IN)
playerPlayPauseFab.setOnClickListener(PlayPauseButtonOnClickHandler())
playerPlayPauseFab.post {
if (playerPlayPauseFab != null) {
playerPlayPauseFab.pivotX = (playerPlayPauseFab.width / 2).toFloat()
playerPlayPauseFab.pivotY = (playerPlayPauseFab.height / 2).toFloat()
}
}
}
private fun setUpPrevNext() {
updatePrevNextColor()
playerNextButton.setOnClickListener { _ -> MusicPlayerRemote.playNextSong() }
playerPrevButton.setOnClickListener { _ -> MusicPlayerRemote.back() }
}
private fun updatePrevNextColor() {
playerNextButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
playerPrevButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
}
private fun setUpShuffleButton() {
playerShuffleButton.setOnClickListener { MusicPlayerRemote.toggleShuffleMode() }
}
override fun updateShuffleState() {
when (MusicPlayerRemote.shuffleMode) {
MusicService.SHUFFLE_MODE_SHUFFLE -> playerShuffleButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
else -> playerShuffleButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
}
}
private fun setUpRepeatButton() {
playerRepeatButton.setOnClickListener { MusicPlayerRemote.cycleRepeatMode() }
}
override fun updateRepeatState() {
when (MusicPlayerRemote.repeatMode) {
MusicService.REPEAT_MODE_NONE -> {
playerRepeatButton.setImageResource(code.name.monkey.retromusic.R.drawable.ic_repeat_white_24dp)
playerRepeatButton.setColorFilter(lastDisabledPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
}
MusicService.REPEAT_MODE_ALL -> {
playerRepeatButton.setImageResource(code.name.monkey.retromusic.R.drawable.ic_repeat_white_24dp)
playerRepeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
}
MusicService.REPEAT_MODE_THIS -> {
playerRepeatButton.setImageResource(code.name.monkey.retromusic.R.drawable.ic_repeat_one_white_24dp)
playerRepeatButton.setColorFilter(lastPlaybackControlsColor, PorterDuff.Mode.SRC_IN)
}
}
}
override fun setUpProgressSlider() {
val color = MaterialValueHelper.getPrimaryTextColor(context, false)
playerProgressSlider.thumb.mutate().setColorFilter(color, PorterDuff.Mode.SRC_IN)
playerProgressSlider.progressDrawable.mutate().setColorFilter(Color.TRANSPARENT, PorterDuff.Mode.SRC_IN)
playerProgressSlider.setOnSeekBarChangeListener(object : SimpleOnSeekbarChangeListener() {
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
if (fromUser) {
MusicPlayerRemote.seekTo(progress)
onUpdateProgressViews(MusicPlayerRemote.songProgressMillis, MusicPlayerRemote.songDurationMillis)
}
}
})
}
override fun onUpdateProgressViews(progress: Int, total: Int) {
playerProgressSlider.max = total
val animator = ObjectAnimator.ofInt(playerProgressSlider, "progress", progress)
animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator()
animator.start()
playerSongTotalTime.text = MusicUtil.getReadableDurationString(total.toLong())
playerSongCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
}
override fun onResume() {
super.onResume()
progressViewUpdateHelper.start()
}
override fun onPause() {
super.onPause()
progressViewUpdateHelper.stop()
}
override fun onServiceConnected() {
updatePlayPauseDrawableState(false)
updateRepeatState()
updateShuffleState()
}
override fun onPlayStateChanged() {
updatePlayPauseDrawableState(true)
}
override fun onRepeatModeChanged() {
updateRepeatState()
}
override fun onShuffleModeChanged() {
updateShuffleState()
}
fun updatePlayPauseDrawableState(animate: Boolean) {
if (MusicPlayerRemote.isPlaying) {
playerFabPlayPauseDrawable?.setPause(animate)
} else {
playerFabPlayPauseDrawable?.setPlay(animate)
}
}
}

View file

@ -226,7 +226,7 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider!!.max = total progressSlider!!.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -21,6 +21,7 @@ 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.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
@ -33,7 +34,8 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
private lateinit var volumeFragment: VolumeFragment
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -49,6 +51,9 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setUpMusicControllers() setUpMusicControllers()
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
playPauseButton.setOnClickListener { playPauseButton.setOnClickListener {
if (MusicPlayerRemote.isPlaying) { if (MusicPlayerRemote.isPlaying) {
MusicPlayerRemote.pauseSong() MusicPlayerRemote.pauseSong()
@ -67,12 +72,12 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
progressViewUpdateHelper!!.start() progressViewUpdateHelper.start()
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
progressViewUpdateHelper!!.stop() progressViewUpdateHelper.stop()
} }
override fun onServiceConnected() { override fun onServiceConnected() {
@ -114,6 +119,8 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() {
} else { } else {
ThemeStore.accentColor(context!!) ThemeStore.accentColor(context!!)
} }
volumeFragment.setTintable(colorFinal)
setFabColor(colorFinal) setFabColor(colorFinal)
updateRepeatState() updateRepeatState()
updateShuffleState() updateShuffleState()
@ -246,7 +253,7 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -21,19 +21,20 @@ import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper.Callback
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.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_flat_player_playback_controls.* import kotlinx.android.synthetic.main.fragment_flat_player_playback_controls.*
import kotlinx.android.synthetic.main.player_time.* import kotlinx.android.synthetic.main.player_time.*
import kotlinx.android.synthetic.main.volume_controls.*
class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback { class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
private lateinit var volumeFragment: VolumeFragment
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -48,24 +49,25 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setUpMusicControllers() setUpMusicControllers()
hideVolumeIfAvailable()
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
} }
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
progressViewUpdateHelper!!.start() progressViewUpdateHelper.start()
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
progressViewUpdateHelper!!.stop() progressViewUpdateHelper.stop()
} }
override fun onUpdateProgressViews(progress: Int, total: Int) { override fun onUpdateProgressViews(progress: Int, total: Int) {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()
@ -73,10 +75,6 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {
songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong()) songCurrentProgress.text = MusicUtil.getReadableDurationString(progress.toLong())
} }
private fun hideVolumeIfAvailable() {
volumeFragmentContainer.visibility = if (PreferenceUtil.getInstance().volumeToggle) View.VISIBLE else View.GONE
}
public override fun show() { public override fun show() {
playPauseButton!!.animate() playPauseButton!!.animate()
.scaleX(1f) .scaleX(1f)
@ -112,16 +110,14 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback {
} }
updateTextColors(colorFinal) updateTextColors(colorFinal)
setProgressBarColor(colorFinal) volumeFragment.setTintable(colorFinal)
ViewUtil.setProgressDrawable(progressSlider, colorFinal, true)
updateRepeatState() updateRepeatState()
updateShuffleState() updateShuffleState()
} }
private fun setProgressBarColor(dark: Int) {
ViewUtil.setProgressDrawable(progressSlider, dark)
}
private fun updateTextColors(color: Int) { private fun updateTextColors(color: Int) {
val isDark = ColorUtil.isColorLight(color) val isDark = ColorUtil.isColorLight(color)
val darkColor = ColorUtil.darkenColor(color) val darkColor = ColorUtil.darkenColor(color)

View file

@ -73,7 +73,7 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()
@ -102,12 +102,12 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment() {
lastPlaybackControlsColor = Color.WHITE lastPlaybackControlsColor = Color.WHITE
lastDisabledPlaybackControlsColor = ContextCompat.getColor(context!!, R.color.md_grey_500) lastDisabledPlaybackControlsColor = ContextCompat.getColor(context!!, R.color.md_grey_500)
if (PreferenceUtil.getInstance().adaptiveColor) { val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
setProgressBarColor(color) color
} else { } else {
val accentColor = ThemeStore.accentColor(context!!) ThemeStore.accentColor(context!!)
setProgressBarColor(accentColor)
} }
setProgressBarColor(colorFinal)
updateRepeatState() updateRepeatState()
updateShuffleState() updateShuffleState()

View file

@ -219,7 +219,7 @@ class LockScreenPlayerControlsFragment : AbsPlayerControlsFragment() {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -8,19 +8,21 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import android.widget.SeekBar import android.widget.SeekBar
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.MaterialValueHelper import code.name.monkey.appthemehelper.util.MaterialValueHelper
import code.name.monkey.appthemehelper.util.TintHelper
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.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.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.ViewUtil
import kotlinx.android.synthetic.main.fragment_material_playback_controls.* import kotlinx.android.synthetic.main.fragment_material_playback_controls.*
import kotlinx.android.synthetic.main.player_time.* import kotlinx.android.synthetic.main.player_time.*
@ -31,7 +33,8 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
private lateinit var volumeFragment: VolumeFragment
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -40,14 +43,14 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? { savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_material_playback_controls, container, false) return inflater.inflate(R.layout.fragment_material_playback_controls, 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)
setUpMusicControllers() setUpMusicControllers()
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
} }
private fun updateSong() { private fun updateSong() {
@ -58,12 +61,12 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
progressViewUpdateHelper!!.start() progressViewUpdateHelper.start()
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
progressViewUpdateHelper!!.stop() progressViewUpdateHelper.stop()
} }
override fun onServiceConnected() { override fun onServiceConnected() {
@ -103,12 +106,15 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
updateRepeatState() updateRepeatState()
updateShuffleState() updateShuffleState()
val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
if (PreferenceUtil.getInstance().adaptiveColor) {
lastPlaybackControlsColor = color lastPlaybackControlsColor = color
text.setTextColor(color) color
TintHelper.setTintAuto(progressSlider, color, false) } else {
ThemeStore.textColorSecondary(context!!)
} }
text.setTextColor(colorFinal)
ViewUtil.setProgressDrawable(progressSlider, ColorUtil.stripAlpha(colorFinal), true)
volumeFragment.setTintable(colorFinal)
updatePlayPauseColor() updatePlayPauseColor()
updatePrevNextColor() updatePrevNextColor()
@ -205,7 +211,7 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() {
progressSlider!!.max = total progressSlider!!.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -3,18 +3,22 @@ package code.name.monkey.retromusic.ui.fragments.player.normal
import android.animation.ArgbEvaluator import android.animation.ArgbEvaluator
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.util.DisplayMetrics
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ATHUtil
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
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.model.Song import code.name.monkey.retromusic.model.Song
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerFragment
import code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
import code.name.monkey.retromusic.util.RetroUtil
import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.ViewUtil
import code.name.monkey.retromusic.views.DrawableGradient import code.name.monkey.retromusic.views.DrawableGradient
import kotlinx.android.synthetic.main.fragment_player.* import kotlinx.android.synthetic.main.fragment_player.*
@ -57,7 +61,7 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
} }
override fun toolbarIconColor(): Int { override fun toolbarIconColor(): Int {
return ATHUtil.resolveColor(context, code.name.monkey.retromusic.R.attr.iconColor) return ATHUtil.resolveColor(context, R.attr.iconColor)
} }
override fun onColorChanged(color: Int) { override fun onColorChanged(color: Int) {
@ -70,6 +74,20 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
if (PreferenceUtil.getInstance().adaptiveColor) { if (PreferenceUtil.getInstance().adaptiveColor) {
colorize(color) colorize(color)
} }
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
val display = activity?.windowManager?.defaultDisplay
val outMetrics = DisplayMetrics()
display?.getMetrics(outMetrics)
val density = resources.displayMetrics.density
val dpHeight = outMetrics.heightPixels / density
val dpWidth = outMetrics.widthPixels / density
playerAlbumCoverContainer?.layoutParams?.width = RetroUtil.convertDpToPixel(dpWidth - 20, context!!).toInt()
}
} }
override fun toggleFavorite(song: Song) { override fun toggleFavorite(song: Song) {
@ -126,6 +144,7 @@ class PlayerFragment : AbsPlayerFragment(), PlayerAlbumCoverFragment.Callbacks {
companion object { companion object {
fun newInstance(): PlayerFragment { fun newInstance(): PlayerFragment {
return PlayerFragment() return PlayerFragment()
} }

View file

@ -2,8 +2,6 @@ package code.name.monkey.retromusic.ui.fragments.player.normal
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.graphics.PorterDuff import android.graphics.PorterDuff
import android.graphics.drawable.ClipDrawable
import android.graphics.drawable.LayerDrawable
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -22,6 +20,7 @@ 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.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
@ -34,7 +33,8 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
private lateinit var volumeFragment: VolumeFragment
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -50,6 +50,9 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setUpMusicControllers() setUpMusicControllers()
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
playPauseButton.setOnClickListener { playPauseButton.setOnClickListener {
if (MusicPlayerRemote.isPlaying) { if (MusicPlayerRemote.isPlaying) {
MusicPlayerRemote.pauseSong() MusicPlayerRemote.pauseSong()
@ -70,23 +73,22 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(context!!, false) lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(context!!, false)
} }
if (PreferenceUtil.getInstance().adaptiveColor) { val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
setFabColor(color) color
} else { } else {
setFabColor(ThemeStore.accentColor(context!!)) ThemeStore.accentColor(context!!)
} }
volumeFragment.setTintable(colorFinal)
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false)
TintHelper.setTintAuto(playPauseButton, colorFinal, true)
ViewUtil.setProgressDrawable(progressSlider, colorFinal)
updateRepeatState() updateRepeatState()
updateShuffleState() updateShuffleState()
updatePrevNextColor() updatePrevNextColor()
} }
private fun setFabColor(i: Int) {
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(i)), false)
TintHelper.setTintAuto(playPauseButton, i, true)
setProgressBarColor(i)
}
private fun updateSong() { private fun updateSong() {
val song = MusicPlayerRemote.currentSong val song = MusicPlayerRemote.currentSong
title.text = song.title title.text = song.title
@ -95,12 +97,12 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
progressViewUpdateHelper!!.start() progressViewUpdateHelper.start()
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
progressViewUpdateHelper!!.stop() progressViewUpdateHelper.stop()
} }
override fun onServiceConnected() { override fun onServiceConnected() {
@ -127,11 +129,6 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
updateShuffleState() updateShuffleState()
} }
private fun setProgressBarColor(newColor: Int) {
ViewUtil.setProgressDrawable(progressSlider, newColor)
}
private fun setUpPlayPauseFab() { private fun setUpPlayPauseFab() {
playPauseButton.setOnClickListener(PlayPauseButtonOnClickHandler()) playPauseButton.setOnClickListener(PlayPauseButtonOnClickHandler())
} }
@ -230,7 +227,7 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -22,6 +22,7 @@ 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.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
@ -38,7 +39,8 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
private lateinit var volumeFragment: VolumeFragment
override fun onPlayStateChanged() { override fun onPlayStateChanged() {
updatePlayPauseDrawableState() updatePlayPauseDrawableState()
@ -71,18 +73,20 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
progressViewUpdateHelper!!.start() progressViewUpdateHelper.start()
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
progressViewUpdateHelper!!.stop() progressViewUpdateHelper.stop()
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setUpMusicControllers() setUpMusicControllers()
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
playPauseButton.setOnClickListener { playPauseButton.setOnClickListener {
if (MusicPlayerRemote.isPlaying) { if (MusicPlayerRemote.isPlaying) {
MusicPlayerRemote.pauseSong() MusicPlayerRemote.pauseSong()
@ -132,6 +136,7 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
} else { } else {
ThemeStore.accentColor(context!!) ThemeStore.accentColor(context!!)
} }
volumeFragment.setTintable(colorFinal)
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false) TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false)
TintHelper.setTintAuto(playPauseButton, colorFinal, true) TintHelper.setTintAuto(playPauseButton, colorFinal, true)
@ -245,7 +250,7 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() {
progressSlider.max = total progressSlider.max = total
val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress) val animator = ObjectAnimator.ofInt(progressSlider, "progress", progress)
animator.duration = 1500 animator.duration = SLIDER_ANIMATION_TIME
animator.interpolator = LinearInterpolator() animator.interpolator = LinearInterpolator()
animator.start() animator.start()

View file

@ -16,6 +16,7 @@ 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.service.MusicService import code.name.monkey.retromusic.service.MusicService
import code.name.monkey.retromusic.ui.fragments.VolumeFragment
import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.ui.fragments.base.AbsPlayerControlsFragment
import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.MusicUtil
import code.name.monkey.retromusic.util.PreferenceUtil import code.name.monkey.retromusic.util.PreferenceUtil
@ -30,7 +31,8 @@ class SimplePlaybackControlsFragment : AbsPlayerControlsFragment() {
private var lastPlaybackControlsColor: Int = 0 private var lastPlaybackControlsColor: Int = 0
private var lastDisabledPlaybackControlsColor: Int = 0 private var lastDisabledPlaybackControlsColor: Int = 0
private var progressViewUpdateHelper: MusicProgressViewUpdateHelper? = null private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
private lateinit var volumeFragment: VolumeFragment
override fun onPlayStateChanged() { override fun onPlayStateChanged() {
@ -64,18 +66,20 @@ class SimplePlaybackControlsFragment : AbsPlayerControlsFragment() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
progressViewUpdateHelper!!.start() progressViewUpdateHelper.start()
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
progressViewUpdateHelper!!.stop() progressViewUpdateHelper.stop()
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
setUpMusicControllers() setUpMusicControllers()
volumeFragment = childFragmentManager.findFragmentById(R.id.volumeFragment) as VolumeFragment
playPauseButton.setOnClickListener { playPauseButton.setOnClickListener {
if (MusicPlayerRemote.isPlaying) { if (MusicPlayerRemote.isPlaying) {
MusicPlayerRemote.pauseSong() MusicPlayerRemote.pauseSong()
@ -194,6 +198,8 @@ class SimplePlaybackControlsFragment : AbsPlayerControlsFragment() {
ThemeStore.accentColor(context!!) ThemeStore.accentColor(context!!)
} }
volumeFragment.setTintable(colorFinal)
TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false) TintHelper.setTintAuto(playPauseButton, MaterialValueHelper.getPrimaryTextColor(context!!, ColorUtil.isColorLight(colorFinal)), false)
TintHelper.setTintAuto(playPauseButton, colorFinal, true) TintHelper.setTintAuto(playPauseButton, colorFinal, true)
text.setTextColor(colorFinal) text.setTextColor(colorFinal)

View file

@ -16,10 +16,6 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.FileProvider;
import org.jaudiotagger.audio.AudioFileIO; import org.jaudiotagger.audio.AudioFileIO;
import org.jaudiotagger.tag.FieldKey; import org.jaudiotagger.tag.FieldKey;
@ -30,6 +26,9 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.FileProvider;
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.loaders.PlaylistLoader; import code.name.monkey.retromusic.loaders.PlaylistLoader;
@ -106,6 +105,39 @@ public class MusicUtil {
} }
} }
@NonNull
public static String getSongInfoString(@NonNull final Song song) {
return MusicUtil.buildInfoString(
song.artistName,
song.albumName
);
}
/**
* Build a concatenated string from the provided arguments
* The intended purpose is to show extra annotations
* to a music library item.
* Ex: for a given album --> buildInfoString(album.artist, album.songCount)
*/
public static String buildInfoString(@NonNull final String string1, @NonNull final String string2) {
// Skip empty strings
if (string1.isEmpty()) {
return string2;
}
if (string2.isEmpty()) {
return string1;
}
final String separator = "";
final StringBuilder builder = new StringBuilder();
builder.append(string1);
builder.append(separator);
builder.append(string2);
return builder.toString();
}
@NonNull @NonNull
public static String getArtistInfoString(@NonNull final Context context, public static String getArtistInfoString(@NonNull final Context context,
@NonNull final Artist artist) { @NonNull final Artist artist) {

View file

@ -4,6 +4,7 @@ import android.animation.Animator
import android.animation.ArgbEvaluator import android.animation.ArgbEvaluator
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.content.Context import android.content.Context
import android.content.res.ColorStateList
import android.content.res.Resources import android.content.res.Resources
import android.graphics.Color import android.graphics.Color
import android.graphics.PorterDuff import android.graphics.PorterDuff
@ -11,6 +12,7 @@ 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.ProgressBar
import android.widget.SeekBar import android.widget.SeekBar
import android.widget.TextView import android.widget.TextView
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
@ -28,7 +30,33 @@ object ViewUtil {
return createColorAnimator(v, "textColor", startColor, endColor) return createColorAnimator(v, "textColor", startColor, endColor)
} }
fun setProgressDrawable(progressSlider: SeekBar, newColor: Int) { fun createBackgroundColorTransition(v: View, @ColorInt startColor: Int, @ColorInt endColor: Int): Animator {
return createColorAnimator(v, "backgroundColor", startColor, endColor)
}
fun setProgressDrawable(progressSlider: SeekBar, newColor: Int, thumbTint: Boolean = false) {
if (thumbTint) {
progressSlider.thumbTintList = ColorStateList.valueOf(newColor)
}
if (progressSlider.progressDrawable is LayerDrawable) {
val ld = progressSlider.progressDrawable as LayerDrawable?
if (ld != null) {
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress)
clipDrawableProgress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
clipDrawableBackground.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(progressSlider.context, ColorUtil.isColorLight(ThemeStore.primaryColor(progressSlider.context))), PorterDuff.Mode.SRC_IN)
}
} else {
progressSlider.progressTintList = ColorStateList.valueOf(newColor)
}
}
fun setProgressDrawable(progressSlider: ProgressBar, newColor: Int) {
val ld = progressSlider.progressDrawable as LayerDrawable val ld = progressSlider.progressDrawable as LayerDrawable
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress) val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress)

View file

@ -37,7 +37,7 @@ class ColorIconsImageView : AppCompatImageView {
val alpha = if (ATHUtil.isWindowBackgroundDark(context)) { val alpha = if (ATHUtil.isWindowBackgroundDark(context)) {
1.0f 1.0f
} else { } else {
0.28f 0.12f
} }
val filterColor = if (ATHUtil.isWindowBackgroundDark(context)) { val filterColor = if (ATHUtil.isWindowBackgroundDark(context)) {
ThemeStore.textColorPrimary(context) ThemeStore.textColorPrimary(context)

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/md_blue_500A12" />
</shape>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/md_red_500A12" />
</shape>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/md_green_500A12" />
</shape>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/md_deep_purple_500A12" />
</shape>

View file

@ -1 +0,0 @@
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <stroke android:width="2dp" android:color="?attr/dividerColor" /> <corners android:topLeftRadius="12dp" android:topRightRadius="12dp" /> <solid android:color="@android:color/transparent" /> <padding android:bottom="8dp" /> </shape>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/md_deep_purple_A700" />
<corners android:radius="50dp" />
</shape>

View file

@ -4,6 +4,6 @@
android:viewportWidth="24.0" android:viewportWidth="24.0"
android:viewportHeight="24.0"> android:viewportHeight="24.0">
<path <path
android:fillColor="#FF000000" android:fillColor="@color/md_white_1000"
android:pathData="M20,16h2v-2h-2v2zM20,7v5h2L22,7h-2zM10,4c-4.42,0 -8,3.58 -8,8s3.58,8 8,8 8,-3.58 8,-8 -3.58,-8 -8,-8zM10,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/> android:pathData="M20,16h2v-2h-2v2zM20,7v5h2L22,7h-2zM10,4c-4.42,0 -8,3.58 -8,8s3.58,8 8,8 8,-3.58 8,-8 -3.58,-8 -8,-8zM10,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z" />
</vector> </vector>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000000"
android:pathData="M12 6c1.1 0 2 0.9 2 2s-0.9 2-2 2-2-0.9-2-2 0.9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c0.23-0.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" />
</vector>

View file

@ -66,15 +66,15 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/albumTitle" android:id="@+id/albumTitle"
android:textStyle="bold" style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/albumText" android:id="@+id/albumText"
style="@style/TextAppearance.MaterialComponents.Subtitle2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -86,7 +86,6 @@
android:paddingTop="4dp" android:paddingTop="4dp"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />
@ -105,9 +104,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
android:layout_margin="10dp" android:layout_margin="10dp"
app:showTitle="true"
app:setText="@string/action_shuffle_all"
app:setIcon="@drawable/ic_shuffle_white_24dp" app:setIcon="@drawable/ic_shuffle_white_24dp"
app:setText="@string/action_shuffle_all"
app:showTitle="true"
app:shuffleBackgroundColor="@color/md_black_1000" /> app:shuffleBackgroundColor="@color/md_black_1000" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -191,11 +191,13 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton <code.name.monkey.retromusic.views.CollapsingFAB
android:id="@+id/saveFab" android:id="@+id/saveFab"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:layout_margin="16dp" app:setIcon="@drawable/ic_save_white_24dp"
app:srcCompat="@drawable/ic_save_white_24dp" /> app:setText="Save"
app:showTitle="true"
app:shuffleBackgroundColor="@color/md_grey_200" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -60,16 +60,16 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/artistTitle" android:id="@+id/artistTitle"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textStyle="bold"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/text" android:id="@+id/text"
style="@style/TextAppearance.MaterialComponents.Subtitle2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -80,7 +80,6 @@
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />

View file

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--The unused FrameLayout layout is necessary to prevent a crash on rotate-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="UselessParent">
<include layout="@layout/status_bar" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/playerToolbar"
style="@style/Toolbar"
android:background="@android:color/transparent" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<code.name.monkey.retromusic.views.HeightFitSquareLayout
android:id="@+id/coverContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/playerAlbumCoverFragment"
class="code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</code.name.monkey.retromusic.views.HeightFitSquareLayout>
<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/playerSlidingLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toEndOf="@+id/coverContainer"
android:layout_toRightOf="@+id/coverContainer"
android:clickable="false"
android:focusable="true"
android:gravity="bottom"
sothree:umanoFadeColor="#00000000"
sothree:umanoOverlay="true"
sothree:umanoPanelHeight="0dp"
sothree:umanoScrollableView="@+id/playerRecyclerView"
sothree:umanoShadowHeight="0dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/colorBackground"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment
android:id="@+id/playbackControlsFragment"
class="code.name.monkey.retromusic.ui.fragments.player.classic.ClassicPlayerPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
<FrameLayout
android:id="@+id/playerPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp">
<com.google.android.material.card.MaterialCardView
android:id="@+id/playingQueueCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
sothree:cardCornerRadius="12dp"
android:layout_marginBottom="-8dp"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardElevation="@dimen/card_elevation"
app:cardUseCompatPadding="false">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--This is necessary for the drag sorting to work at the top-->
<View
android:id="@+id/draggableArea"
android:layout_width="72dp"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/cardContent"
android:layout_alignBottom="@+id/cardContent"
android:layout_marginTop="48dp" />
<LinearLayout
android:id="@+id/cardContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/playerQueueSubHeader"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/up_next"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="?android:textColorSecondary" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/playerRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:requiresFadingEdge="vertical" />
</LinearLayout>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
</FrameLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</RelativeLayout>
</LinearLayout>
</FrameLayout>

View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true">
<View
android:id="@+id/colorGradientBackground"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.jetradarmobile.snowfall.SnowfallView
android:id="@+id/snowfall"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include layout="@layout/shadow_statusbar_toolbar" />
<code.name.monkey.retromusic.views.FitSystemWindowsLayout
android:id="@+id/safeArea"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/status_bar" />
</FrameLayout>
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:id="@+id/playerAlbumCoverContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<fragment
android:id="@+id/playerAlbumCoverFragment"
android:name="code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_album_cover" />
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<fragment
android:id="@+id/playbackControlsFragment"
android:name="code.name.monkey.retromusic.ui.fragments.player.normal.PlayerPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_player_playback_controls" />
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0">
<androidx.appcompat.widget.Toolbar
android:id="@+id/playerToolbar"
style="@style/Toolbar"
android:layout_gravity="bottom"
android:navigationIcon="@drawable/ic_close_white_24dp"
app:navigationIcon="@drawable/ic_close_white_24dp" />
</FrameLayout>
</LinearLayout>
</code.name.monkey.retromusic.views.FitSystemWindowsLayout>
</FrameLayout>

View file

@ -19,7 +19,7 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:scaleType="centerCrop" android:scaleType="centerCrop"
/> android:contentDescription="TODO" />
<ImageView <ImageView
android:id="@+id/foregroundImage" android:id="@+id/foregroundImage"
@ -27,7 +27,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignStart="@id/largeIcon" android:layout_alignStart="@id/largeIcon"
android:src="@drawable/background_image" android:src="@drawable/background_image"
android:tint="@color/md_black_1000"/> android:tint="@color/md_black_1000"
android:contentDescription="TODO" />
</RelativeLayout> </RelativeLayout>
@ -57,7 +58,8 @@
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
tools:src="@drawable/ic_audiotrack_black_24dp" tools:src="@drawable/ic_audiotrack_black_24dp"
tools:tint="@color/md_black_1000"/> tools:tint="@color/md_black_1000"
android:contentDescription="TODO" />
<TextView <TextView
android:id="@+id/appName" android:id="@+id/appName"
@ -77,7 +79,8 @@
android:layout_marginStart="2dp" android:layout_marginStart="2dp"
android:scaleType="centerInside" android:scaleType="centerInside"
android:src="@drawable/ic_keyboard_arrow_up_24dp" android:src="@drawable/ic_keyboard_arrow_up_24dp"
tools:ignore="VectorDrawableCompat"/> tools:ignore="VectorDrawableCompat"
android:contentDescription="TODO" />
</LinearLayout> </LinearLayout>

View file

@ -21,8 +21,8 @@
android:background="@android:color/transparent"> android:background="@android:color/transparent">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:id="@+id/collapsingToolbarLayout" android:id="@+id/collapsingToolbarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed" app:layout_scrollFlags="scroll|exitUntilCollapsed"
@ -92,15 +92,15 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/albumTitle" android:id="@+id/albumTitle"
android:textStyle="bold" style="@style/TextAppearance.MaterialComponents.Headline3"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline3"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/albumText" android:id="@+id/albumText"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -112,7 +112,6 @@
android:paddingTop="4dp" android:paddingTop="4dp"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />

View file

@ -65,16 +65,16 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/artistTitle" android:id="@+id/artistTitle"
style="@style/TextAppearance.MaterialComponents.Headline4"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textStyle="bold"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/text" android:id="@+id/text"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -85,7 +85,6 @@
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />

View file

@ -5,11 +5,27 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<code.name.monkey.retromusic.views.IconImageView
android:id="@+id/sectionIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="14dp"
android:paddingEnd="0dp"
app:srcCompat="@drawable/ic_person_white_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
style="@style/SubTitleTextAppearance" android:id="@+id/sectionTitle"
android:text="@string/for_you" android:text="@string/for_you"
style="@style/SubTitleTextAppearance"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -24,14 +40,13 @@
android:paddingStart="12dp" android:paddingStart="12dp"
android:paddingEnd="12dp"> android:paddingEnd="12dp">
<androidx.appcompat.widget.AppCompatImageView <code.name.monkey.retromusic.views.ColorIconsImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/abs_history_playlist"
android:padding="24dp" android:padding="24dp"
app:srcCompat="@drawable/ic_access_time_white_24dp" app:iconBackgroundColor="@color/md_blue_A700"
app:tint="@color/md_blue_A700" /> app:srcCompat="@drawable/ic_access_time_white_24dp" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -51,14 +66,13 @@
android:paddingStart="12dp" android:paddingStart="12dp"
android:paddingEnd="12dp"> android:paddingEnd="12dp">
<androidx.appcompat.widget.AppCompatImageView <code.name.monkey.retromusic.views.ColorIconsImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/abs_last_added_playlist"
android:padding="24dp" android:padding="24dp"
app:srcCompat="@drawable/ic_library_add_white_24dp" app:iconBackgroundColor="@color/md_red_A700"
app:tint="@color/md_red_A700" /> app:srcCompat="@drawable/ic_library_add_white_24dp" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -78,14 +92,13 @@
android:paddingStart="12dp" android:paddingStart="12dp"
android:paddingEnd="12dp"> android:paddingEnd="12dp">
<androidx.appcompat.widget.AppCompatImageView <code.name.monkey.retromusic.views.ColorIconsImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/abs_top_tracks_playlist"
android:padding="24dp" android:padding="24dp"
app:srcCompat="@drawable/ic_trending_up_white_24dp" app:iconBackgroundColor="@color/md_deep_purple_A700"
app:tint="@color/md_deep_purple_A700" /> app:srcCompat="@drawable/ic_trending_up_white_24dp" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -105,14 +118,13 @@
android:paddingStart="12dp" android:paddingStart="12dp"
android:paddingEnd="12dp"> android:paddingEnd="12dp">
<androidx.appcompat.widget.AppCompatImageView <code.name.monkey.retromusic.views.ColorIconsImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/abs_shuffle"
android:padding="24dp" android:padding="24dp"
app:srcCompat="@drawable/ic_shuffle_white_24dp" app:iconBackgroundColor="@color/md_green_A700"
app:tint="@color/md_green_A700" /> app:srcCompat="@drawable/ic_shuffle_white_24dp" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -15,15 +15,15 @@
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent"> android:background="@android:color/transparent">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/collapsingToolbarLayout"
android:background="@android:color/transparent" android:background="@android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed" app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="false"> app:titleEnabled="false">
@ -94,15 +94,15 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/albumTitle" android:id="@+id/albumTitle"
android:textStyle="bold" style="@style/TextAppearance.MaterialComponents.Headline4"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/albumText" android:id="@+id/albumText"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -114,7 +114,6 @@
android:paddingTop="4dp" android:paddingTop="4dp"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline6"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />
@ -137,9 +136,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
android:layout_margin="10dp" android:layout_margin="10dp"
app:showTitle="false"
app:setIcon="@drawable/ic_shuffle_white_24dp" app:setIcon="@drawable/ic_shuffle_white_24dp"
app:setText="@string/action_shuffle_all" app:setText="@string/action_shuffle_all"
app:showTitle="false"
app:shuffleBackgroundColor="@color/md_black_1000" /> app:shuffleBackgroundColor="@color/md_black_1000" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -66,16 +66,16 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/artistTitle" android:id="@+id/artistTitle"
style="@style/TextAppearance.MaterialComponents.Headline4"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textStyle="bold"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/text" android:id="@+id/text"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -86,7 +86,6 @@
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />

View file

@ -5,11 +5,27 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<code.name.monkey.retromusic.views.IconImageView
android:id="@+id/sectionIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="14dp"
android:paddingEnd="0dp"
app:srcCompat="@drawable/ic_person_white_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/sectionTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:text="@string/for_you" android:text="@string/for_you"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -27,7 +43,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/abs_history_playlist"
android:padding="12dp" android:padding="12dp"
app:iconBackgroundColor="@color/md_blue_A700" app:iconBackgroundColor="@color/md_blue_A700"
app:srcCompat="@drawable/ic_access_time_white_24dp" /> app:srcCompat="@drawable/ic_access_time_white_24dp" />
@ -37,8 +52,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="@string/history" android:text="@string/history" />
android:textSize="12sp" />
</LinearLayout> </LinearLayout>
@ -53,7 +67,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/abs_last_added_playlist"
android:padding="12dp" android:padding="12dp"
app:iconBackgroundColor="@color/md_red_A700" app:iconBackgroundColor="@color/md_red_A700"
app:srcCompat="@drawable/ic_library_add_white_24dp" /> app:srcCompat="@drawable/ic_library_add_white_24dp" />
@ -63,8 +76,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="@string/last_added" android:text="@string/last_added" />
android:textSize="12sp" />
</LinearLayout> </LinearLayout>
@ -79,7 +91,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/abs_top_tracks_playlist"
android:padding="12dp" android:padding="12dp"
app:iconBackgroundColor="@color/md_deep_purple_A700" app:iconBackgroundColor="@color/md_deep_purple_A700"
app:srcCompat="@drawable/ic_trending_up_white_24dp" /> app:srcCompat="@drawable/ic_trending_up_white_24dp" />
@ -89,8 +100,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
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:textSize="12sp" />
</LinearLayout> </LinearLayout>
@ -105,7 +115,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/abs_shuffle"
android:padding="12dp" android:padding="12dp"
app:iconBackgroundColor="@color/md_green_A700" app:iconBackgroundColor="@color/md_green_A700"
app:srcCompat="@drawable/ic_shuffle_white_24dp" /> app:srcCompat="@drawable/ic_shuffle_white_24dp" />
@ -115,8 +124,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:paddingTop="8dp" android:paddingTop="8dp"
android:text="@string/shuffle" android:text="@string/shuffle" />
android:textSize="12sp" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -82,15 +82,15 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/albumTitle" android:id="@+id/albumTitle"
android:textStyle="bold" style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
tools:ignore="MissingPrefix" /> tools:ignore="MissingPrefix" />
<code.name.monkey.appthemehelper.common.views.ATESecondaryTextView <code.name.monkey.appthemehelper.common.views.ATESecondaryTextView
android:id="@+id/albumText" android:id="@+id/albumText"
style="@style/TextAppearance.MaterialComponents.Subtitle2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -102,7 +102,6 @@
android:paddingTop="4dp" android:paddingTop="4dp"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />
@ -122,9 +121,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
android:layout_margin="10dp" android:layout_margin="10dp"
app:showTitle="true"
app:setIcon="@drawable/ic_shuffle_white_24dp" app:setIcon="@drawable/ic_shuffle_white_24dp"
app:setText="@string/action_shuffle_all" app:setText="@string/action_shuffle_all"
app:showTitle="true"
app:shuffleBackgroundColor="@color/md_black_1000" /> app:shuffleBackgroundColor="@color/md_black_1000" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -206,11 +206,14 @@
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton <code.name.monkey.retromusic.views.CollapsingFAB
android:id="@+id/saveFab" android:id="@+id/saveFab"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="center_horizontal|bottom"
android:layout_margin="16dp" app:setIcon="@drawable/ic_save_white_24dp"
app:srcCompat="@drawable/ic_save_white_24dp" /> app:setText="Save"
app:showTitle="true"
app:shuffleBackgroundColor="@color/md_grey_200" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -68,16 +68,16 @@
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/artistTitle" android:id="@+id/artistTitle"
android:textStyle="bold" style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="2" android:maxLines="2"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/text" android:id="@+id/text"
style="@style/TextAppearance.MaterialComponents.Subtitle2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -88,7 +88,6 @@
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:text="Title" /> tools:text="Title" />
</LinearLayout> </LinearLayout>
@ -105,8 +104,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end|bottom" android:layout_gravity="end|bottom"
android:layout_margin="10dp" android:layout_margin="10dp"
app:showTitle="true"
app:setIcon="@drawable/ic_shuffle_white_24dp" app:setIcon="@drawable/ic_shuffle_white_24dp"
app:setText="@string/action_shuffle_all" app:setText="@string/action_shuffle_all"
app:showTitle="true"
app:shuffleBackgroundColor="@color/md_black_1000" /> app:shuffleBackgroundColor="@color/md_black_1000" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -51,11 +51,11 @@
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:id="@+id/donation" android:id="@+id/donation"
style="@style/TextAppearance.MaterialComponents.Subtitle2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="16dp" android:padding="16dp"
android:text="@string/donation_header" android:text="@string/donation_header"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
android:textColor="?attr/colorAccent" /> android:textColor="?attr/colorAccent" />
<LinearLayout <LinearLayout
@ -73,12 +73,12 @@
android:indeterminate="true" /> android:indeterminate="true" />
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
style="@style/TextAppearance.MaterialComponents.Caption"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="start" android:gravity="start"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:text="@string/loading_products" android:text="@string/loading_products"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:ignore="RtlHardcoded,RtlSymmetry" /> tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout> </LinearLayout>
@ -112,6 +112,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="16dp" android:paddingStart="16dp"
style="@style/TextAppearance.MaterialComponents.Caption"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:text="@string/paypal_summary" android:text="@string/paypal_summary"
android:textColor="@color/md_white_1000" /> android:textColor="@color/md_white_1000" />

View file

@ -42,7 +42,8 @@
android:id="@+id/image" android:id="@+id/image"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop" /> android:scaleType="centerCrop"
android:contentDescription="TODO" />
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
</code.name.monkey.retromusic.views.WidthFitSquareLayout> </code.name.monkey.retromusic.views.WidthFitSquareLayout>

View file

@ -226,14 +226,15 @@
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton <code.name.monkey.retromusic.views.CollapsingFAB
android:id="@+id/saveFab" android:id="@+id/saveFab"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="center_horizontal|bottom"
android:layout_margin="16dp" app:setIcon="@drawable/ic_save_white_24dp"
app:backgroundTint="?colorAccent" app:setText="Save"
app:srcCompat="@drawable/ic_save_white_24dp" /> app:showTitle="true"
app:shuffleBackgroundColor="@color/md_grey_200" />
<ProgressBar <ProgressBar
android:id="@+id/progressBar" android:id="@+id/progressBar"

View file

@ -9,7 +9,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/img_offer" /> android:src="@drawable/img_offer"
android:contentDescription="TODO" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -58,8 +58,8 @@
android:id="@+id/progressSlider" android:id="@+id/progressSlider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="20dp"
android:maxHeight="3dp" android:maxHeight="3dp"
android:paddingStart="20dp"
android:paddingEnd="20dp" android:paddingEnd="20dp"
android:progressDrawable="@drawable/color_progress_seek" android:progressDrawable="@drawable/color_progress_seek"
android:progressTint="@color/md_white_1000" android:progressTint="@color/md_white_1000"

View file

@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--The unused FrameLayout layout is necessary to prevent a crash on rotate-->
<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/playerSlidingLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="true"
android:gravity="bottom"
sothree:umanoFadeColor="#00000000"
sothree:umanoOverlay="true"
sothree:umanoPanelHeight="0dp"
sothree:umanoScrollableView="@+id/playerRecyclerView"
sothree:umanoShadowHeight="0dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/colorBackground"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:id="@+id/playerContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<code.name.monkey.retromusic.views.WidthFitSquareLayout
android:id="@+id/albumCoverContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<fragment
android:id="@+id/playerAlbumCoverFragment"
class="code.name.monkey.retromusic.ui.fragments.player.PlayerAlbumCoverFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</code.name.monkey.retromusic.views.WidthFitSquareLayout>
<fragment
android:id="@+id/playbackControlsFragment"
class="code.name.monkey.retromusic.ui.fragments.player.classic.ClassicPlayerPlaybackControlsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/albumCoverContainer" />
</RelativeLayout>
<FrameLayout
android:id="@+id/toolbarContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<include layout="@layout/shadow_statusbar_toolbar" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<code.name.monkey.retromusic.views.StatusBarView
android:layout_width="match_parent"
android:layout_height="@dimen/status_bar_padding" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/playerToolbar"
style="@style/Toolbar"
android:background="@android:color/transparent" />
</LinearLayout>
</FrameLayout>
</FrameLayout>
<code.name.monkey.retromusic.views.StatusBarMarginFrameLayout
android:id="@+id/playerPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/status_bar_padding"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:id="@+id/playingQueueCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
sothree:cardCornerRadius="12dp"
android:layout_marginBottom="-8dp"
app:cardBackgroundColor="?cardBackgroundColor"
app:cardElevation="@dimen/card_elevation"
app:cardUseCompatPadding="false">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!--This is necessary for the drag sorting to work at the top-->
<View
android:id="@+id/draggableArea"
android:layout_width="72dp"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/cardContent"
android:layout_alignBottom="@+id/cardContent"
android:layout_marginTop="120dp" />
<LinearLayout
android:id="@+id/cardContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/currentSong"
layout="@layout/item_list" />
<TextView
android:id="@+id/playerQueueSubHeader"
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/up_next"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="?android:textColorSecondary" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/playerRecyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:requiresFadingEdge="vertical" />
</LinearLayout>
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
</code.name.monkey.retromusic.views.StatusBarMarginFrameLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</FrameLayout>

View file

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/playerFooterFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/progress_container_height"
android:background="@color/twenty_percent_black_overlay">
<TextView
android:id="@+id/playerSongCurrentProgress"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|left|end"
android:paddingLeft="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/playerSongTotalTime"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:fontFamily="sans-serif-medium"
android:gravity="center_vertical|right|end"
android:paddingRight="8dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="?android:textColorSecondary"
android:textSize="12sp"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<SeekBar
android:id="@+id/playerProgressSlider"
style="@style/MusicProgressSlider"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/playerSongTotalTime"
android:layout_toRightOf="@id/playerSongCurrentProgress"
tools:ignore="RtlHardcoded,UnusedAttribute" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/playerMediaControllerContainer"
android:layout_width="match_parent"
android:layout_height="112dp"
android:layoutDirection="ltr"
tools:ignore="ContentDescription,UnusedAttribute">
<ImageButton
android:id="@+id/playerPrevButton"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_centerVertical="true"
android:layout_marginEnd="-8dp"
android:layout_marginRight="-8dp"
android:layout_toStartOf="@+id/dummyFab"
android:layout_toLeftOf="@+id/dummyFab"
android:background="?attr/roundSelector"
android:padding="22dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_skip_previous_white_24dp"
tools:ignore="MissingPrefix" />
<ImageButton
android:id="@+id/playerNextButton"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_centerVertical="true"
android:layout_marginStart="-8dp"
android:layout_marginLeft="-8dp"
android:layout_toEndOf="@+id/dummyFab"
android:layout_toRightOf="@+id/dummyFab"
android:background="?attr/roundSelector"
android:padding="22dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_skip_next_white_24dp"
tools:ignore="MissingPrefix" />
<ImageButton
android:id="@+id/playerRepeatButton"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:background="?attr/roundSelector"
android:padding="22dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_repeat_white_24dp"
tools:ignore="MissingPrefix" />
<ImageButton
android:id="@+id/playerShuffleButton"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:background="?attr/roundSelector"
android:padding="22dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_shuffle_white_24dp"
tools:ignore="MissingPrefix" />
<Space
android:id="@+id/dummyFab"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_centerInParent="true" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/playerPlayPauseFab"
style="@style/Fab"
android:layout_centerInParent="true"
app:elevation="4dp"
app:pressedTranslationZ="2dp" />
</RelativeLayout>
<include layout="@layout/volume_controls" />
</LinearLayout>

View file

@ -13,7 +13,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:splitTrack="false" android:splitTrack="false"
android:thumb="@drawable/flat_shadow_thumb" android:thumb="@drawable/slider_thumb"
tools:ignore="RtlHardcoded,UnusedAttribute" /> tools:ignore="RtlHardcoded,UnusedAttribute" />

View file

@ -16,7 +16,8 @@
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_repeat_white_24dp" app:srcCompat="@drawable/ic_repeat_white_24dp"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:tint="@color/md_black_1000" /> tools:tint="@color/md_black_1000"
android:contentDescription="TODO" />
<ImageButton <ImageButton
android:id="@+id/player_shuffle_button" android:id="@+id/player_shuffle_button"
@ -27,5 +28,6 @@
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_shuffle_white_24dp" app:srcCompat="@drawable/ic_shuffle_white_24dp"
tools:ignore="MissingPrefix" tools:ignore="MissingPrefix"
tools:tint="@color/md_black_1000" /> tools:tint="@color/md_black_1000"
android:contentDescription="TODO" />
</LinearLayout> </LinearLayout>

View file

@ -105,7 +105,8 @@
<ImageView <ImageView
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:src="@drawable/promotional" /> android:src="@drawable/promotional"
android:contentDescription="TODO" />
</LinearLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>

View file

@ -45,7 +45,7 @@
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
tools:text="Title" /> tools:text="Title" />
@ -60,6 +60,7 @@
android:maxLines="1" android:maxLines="1"
android:paddingStart="16dp" android:paddingStart="16dp"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
android:textColor="?android:attr/textColorSecondary" /> android:textColor="?android:attr/textColorSecondary" />
</LinearLayout> </LinearLayout>

View file

@ -19,7 +19,7 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:scaleType="centerCrop" android:scaleType="centerCrop"
/> android:contentDescription="TODO" />
<ImageView <ImageView
android:id="@+id/foregroundImage" android:id="@+id/foregroundImage"
@ -27,7 +27,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignStart="@id/largeIcon" android:layout_alignStart="@id/largeIcon"
android:src="@drawable/background_image" android:src="@drawable/background_image"
tools:tint="@color/md_black_1000"/> tools:tint="@color/md_black_1000"
android:contentDescription="TODO" />
</RelativeLayout> </RelativeLayout>
@ -55,7 +56,8 @@
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
tools:src="@drawable/ic_audiotrack_black_24dp" tools:src="@drawable/ic_audiotrack_black_24dp"
tools:tint="@color/md_black_1000"/> tools:tint="@color/md_black_1000"
android:contentDescription="TODO" />
<TextView <TextView
android:id="@+id/appName" android:id="@+id/appName"
@ -75,7 +77,8 @@
android:layout_marginStart="2dp" android:layout_marginStart="2dp"
android:scaleType="centerInside" android:scaleType="centerInside"
android:src="@drawable/ic_keyboard_arrow_up_24dp" android:src="@drawable/ic_keyboard_arrow_up_24dp"
tools:ignore="VectorDrawableCompat"/> tools:ignore="VectorDrawableCompat"
android:contentDescription="TODO" />
</LinearLayout> </LinearLayout>
@ -111,25 +114,29 @@
android:id="@+id/action_prev" android:id="@+id/action_prev"
android:layout_width="42dp" android:layout_width="42dp"
android:layout_height="42dp" android:layout_height="42dp"
android:scaleType="centerInside"/> android:scaleType="centerInside"
android:contentDescription="TODO" />
<ImageView <ImageView
android:id="@+id/action_play_pause" android:id="@+id/action_play_pause"
android:layout_width="42dp" android:layout_width="42dp"
android:layout_height="42dp" android:layout_height="42dp"
android:scaleType="centerInside"/> android:scaleType="centerInside"
android:contentDescription="TODO" />
<ImageView <ImageView
android:id="@+id/action_next" android:id="@+id/action_next"
android:layout_width="42dp" android:layout_width="42dp"
android:layout_height="42dp" android:layout_height="42dp"
android:scaleType="centerInside"/> android:scaleType="centerInside"
android:contentDescription="TODO" />
<ImageView <ImageView
android:id="@+id/action_quit" android:id="@+id/action_quit"
android:layout_width="42dp" android:layout_width="42dp"
android:layout_height="42dp" android:layout_height="42dp"
android:scaleType="centerInside"/> android:scaleType="centerInside"
android:contentDescription="TODO" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:app="http://schemas.android.com/apk/res-auto" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/playerMediaControllerContainer" android:id="@+id/playerMediaControllerContainer"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -5,11 +5,26 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<code.name.monkey.retromusic.views.IconImageView
android:id="@+id/sectionIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="14dp"
android:paddingEnd="0dp"
app:srcCompat="@drawable/ic_album_white_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/sectionTitle" android:id="@+id/sectionTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout>
<code.name.monkey.retromusic.views.MetalRecyclerViewPager <code.name.monkey.retromusic.views.MetalRecyclerViewPager
android:id="@+id/recyclerView" android:id="@+id/recyclerView"

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<me.zhanghai.android.materialprogressbar.MaterialProgressBar
style="@style/Widget.MaterialProgressBar.ProgressBar.Horizontal"
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
app:mpb_progressStyle="horizontal"
app:mpb_showProgressBackground="false"
app:mpb_useIntrinsicPadding="true" />
</LinearLayout>

View file

@ -5,11 +5,26 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<code.name.monkey.retromusic.views.IconImageView
android:id="@+id/sectionIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="14dp"
android:paddingEnd="0dp"
app:srcCompat="@drawable/ic_audiotrack_black_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/sectionTitle" android:id="@+id/sectionTitle"
style="@style/SubTitleTextAppearance" style="@style/SubTitleTextAppearance"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -1,16 +1,31 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/recentArtistContainer" android:id="@+id/recentArtistContainer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<code.name.monkey.retromusic.views.IconImageView
android:id="@+id/sectionIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="14dp"
android:paddingEnd="0dp"
app:srcCompat="@drawable/ic_artist_selected_white_24dp" />
<code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView <code.name.monkey.appthemehelper.common.views.ATEPrimaryTextView
android:id="@+id/sectionTitle" android:id="@+id/sectionTitle"
android:textStyle="bold" style="@style/SubTitleTextAppearance"
style="@style/SubTitleTextAppearance" /> android:textStyle="bold" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView" android:id="@+id/recyclerView"

View file

@ -597,5 +597,6 @@
<string name="pref_filter_song_title">Filter song duration</string> <string name="pref_filter_song_title">Filter song duration</string>
<string name="md_error_label">Error</string> <string name="md_error_label">Error</string>
<string name="md_storage_perm_error">Permission error</string> <string name="md_storage_perm_error">Permission error</string>
<string name="classic">Classic</string>
</resources> </resources>

View file

@ -67,7 +67,7 @@
</style> </style>
<style name="SubTitleTextAppearance"> <style name="SubTitleTextAppearance">
<item name="android:textSize">18sp</item> <item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Subtitle1</item>
<item name="android:layout_gravity">start|center_vertical</item> <item name="android:layout_gravity">start|center_vertical</item>
<item name="android:padding">12dp</item> <item name="android:padding">12dp</item>
<item name="android:textColor">?android:attr/textColorPrimary</item> <item name="android:textColor">?android:attr/textColorPrimary</item>

View file

@ -38,5 +38,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="40dip" android:layout_height="40dip"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:src="@drawable/ic_toggle_switch" /> android:src="@drawable/ic_toggle_switch"
android:contentDescription="TODO" />
</TableRow> </TableRow>

View file

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.3.11' ext.kotlin_version = '1.3.21'
ext { ext {
supportLibVersion = '1.0.0' supportLibVersion = '1.0.0'
firebase = "11.8.0" firebase = "11.8.0"