Adding copy right signature
This commit is contained in:
parent
147b8b5292
commit
8efadd9a79
23 changed files with 245 additions and 120 deletions
|
@ -30,7 +30,9 @@ class PlayingQueueActivity : AbsMusicServiceActivity() {
|
||||||
private val upNextAndQueueTime: String
|
private val upNextAndQueueTime: String
|
||||||
get() = resources.getString(R.string.up_next) + " • " + MusicUtil.getReadableDurationString(MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position))
|
get() = resources.getString(R.string.up_next) + " • " + MusicUtil.getReadableDurationString(MusicPlayerRemote.getQueueDurationMillis(MusicPlayerRemote.position))
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_playing_queue)
|
setContentView(R.layout.activity_playing_queue)
|
||||||
|
|
||||||
|
|
|
@ -260,6 +260,8 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
|
||||||
super.setTaskDescriptionColor(paletteColor)
|
super.setTaskDescriptionColor(paletteColor)
|
||||||
|
|
||||||
val isColorLight = ColorUtil.isColorLight(paletteColor)
|
val isColorLight = ColorUtil.isColorLight(paletteColor)
|
||||||
|
|
||||||
|
|
||||||
if (PreferenceUtil.getInstance().adaptiveColor &&
|
if (PreferenceUtil.getInstance().adaptiveColor &&
|
||||||
(currentNowPlayingScreen == NORMAL || currentNowPlayingScreen == FLAT)) {
|
(currentNowPlayingScreen == NORMAL || currentNowPlayingScreen == FLAT)) {
|
||||||
super.setLightNavigationBar(true)
|
super.setLightNavigationBar(true)
|
||||||
|
@ -269,7 +271,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
|
||||||
currentNowPlayingScreen == BLUR || currentNowPlayingScreen == BLUR_CARD) {
|
currentNowPlayingScreen == BLUR || currentNowPlayingScreen == BLUR_CARD) {
|
||||||
super.setLightStatusbar(false)
|
super.setLightStatusbar(false)
|
||||||
super.setLightNavigationBar(true)
|
super.setLightNavigationBar(true)
|
||||||
} else if (currentNowPlayingScreen == COLOR) {
|
} else if (currentNowPlayingScreen == COLOR || currentNowPlayingScreen == TINY) {
|
||||||
super.setNavigationbarColor(paletteColor)
|
super.setNavigationbarColor(paletteColor)
|
||||||
super.setLightNavigationBar(isColorLight)
|
super.setLightNavigationBar(isColorLight)
|
||||||
super.setLightStatusbar(isColorLight)
|
super.setLightStatusbar(isColorLight)
|
||||||
|
@ -310,7 +312,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), Sliding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun updateTabs() {
|
private fun updateTabs() {
|
||||||
bottomNavigationView.menu.clear()
|
bottomNavigationView.menu.clear()
|
||||||
val currentTabs = PreferenceUtil.getInstance().libraryCategoryInfos
|
val currentTabs = PreferenceUtil.getInstance().libraryCategoryInfos
|
||||||
for (tab in currentTabs) {
|
for (tab in currentTabs) {
|
||||||
|
|
|
@ -77,11 +77,7 @@ abstract class AbsThemeActivity : ATHActivity(), Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setDrawUnderStatusBar() {
|
fun setDrawUnderStatusBar() {
|
||||||
if (VersionUtils.hasLollipop()) {
|
|
||||||
RetroUtil.setAllowDrawUnderStatusBar(window)
|
RetroUtil.setAllowDrawUnderStatusBar(window)
|
||||||
} else if (VersionUtils.hasKitKat()) {
|
|
||||||
RetroUtil.setStatusBarTranslucent(window)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setDrawUnderNavigationBar() {
|
fun setDrawUnderNavigationBar() {
|
||||||
|
@ -95,7 +91,6 @@ abstract class AbsThemeActivity : ATHActivity(), Runnable {
|
||||||
* @param color the new statusbar color (will be shifted down on Lollipop and above)
|
* @param color the new statusbar color (will be shifted down on Lollipop and above)
|
||||||
*/
|
*/
|
||||||
fun setStatusbarColor(color: Int) {
|
fun setStatusbarColor(color: Int) {
|
||||||
if (VersionUtils.hasKitKat()) {
|
|
||||||
val statusBar = window.decorView.rootView.findViewById<View>(R.id.status_bar)
|
val statusBar = window.decorView.rootView.findViewById<View>(R.id.status_bar)
|
||||||
if (statusBar != null) {
|
if (statusBar != null) {
|
||||||
when {
|
when {
|
||||||
|
@ -109,7 +104,6 @@ abstract class AbsThemeActivity : ATHActivity(), Runnable {
|
||||||
else -> window.statusBarColor = ColorUtil.darkenColor(color)
|
else -> window.statusBarColor = ColorUtil.darkenColor(color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
setLightStatusbarAuto(color)
|
setLightStatusbarAuto(color)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ abstract class AbsMainActivityFragment : AbsMusicServiceFragment() {
|
||||||
|
|
||||||
fun setStatusbarColorAuto(view: View) {
|
fun setStatusbarColorAuto(view: View) {
|
||||||
// we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat
|
// we don't want to use statusbar color because we are doing the color darkening on our own to support KitKat
|
||||||
|
|
||||||
if (VersionUtils.hasMarshmallow()) {
|
if (VersionUtils.hasMarshmallow()) {
|
||||||
setStatusbarColor(view, ThemeStore.primaryColor(context!!))
|
setStatusbarColor(view, ThemeStore.primaryColor(context!!))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -89,32 +89,35 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
|
||||||
toolbar = view.findViewById(R.id.toolbar)
|
toolbar = view.findViewById(R.id.toolbar)
|
||||||
|
|
||||||
bannerImage?.setOnClickListener {
|
bannerImage?.setOnClickListener {
|
||||||
NavigationUtil.goToUserInfo(activity!!)
|
NavigationUtil.goToUserInfo(requireActivity())
|
||||||
}
|
}
|
||||||
if (!PreferenceUtil.getInstance().isHomeBanner)
|
if (!PreferenceUtil.getInstance().isHomeBanner)
|
||||||
setStatusbarColorAuto(view)
|
setStatusbarColorAuto(view)
|
||||||
|
|
||||||
lastAdded.setOnClickListener {
|
lastAdded.setOnClickListener {
|
||||||
NavigationUtil.goToPlaylistNew(mainActivity, LastAddedPlaylist(mainActivity))
|
NavigationUtil.goToPlaylistNew(requireActivity(), LastAddedPlaylist(requireActivity()))
|
||||||
}
|
}
|
||||||
|
|
||||||
topPlayed.setOnClickListener {
|
topPlayed.setOnClickListener {
|
||||||
NavigationUtil.goToPlaylistNew(mainActivity, MyTopTracksPlaylist(mainActivity))
|
NavigationUtil.goToPlaylistNew(requireActivity(), MyTopTracksPlaylist(requireActivity()))
|
||||||
}
|
}
|
||||||
|
|
||||||
actionShuffle.setOnClickListener {
|
actionShuffle.setOnClickListener {
|
||||||
MusicPlayerRemote.openAndShuffleQueue(SongLoader.getAllSongs(mainActivity) , true)
|
MusicPlayerRemote.openAndShuffleQueue(SongLoader.getAllSongs(requireActivity()) , true)
|
||||||
}
|
}
|
||||||
|
|
||||||
history.setOnClickListener {
|
history.setOnClickListener {
|
||||||
NavigationUtil.goToPlaylistNew(mainActivity, HistoryPlaylist(mainActivity))
|
NavigationUtil.goToPlaylistNew(requireActivity(), HistoryPlaylist(requireActivity()))
|
||||||
}
|
}
|
||||||
|
|
||||||
homePresenter = HomePresenter(this)
|
homePresenter = HomePresenter(this)
|
||||||
|
|
||||||
contentContainer.setBackgroundColor(ThemeStore.primaryColor(context!!))
|
contentContainer.setBackgroundColor(ThemeStore.primaryColor(requireContext()))
|
||||||
|
|
||||||
setupToolbar()
|
setupToolbar()
|
||||||
homeAdapter = HomeAdapter(mainActivity, ArrayList(), displayMetrics)
|
homeAdapter = HomeAdapter(mainActivity, ArrayList(), displayMetrics)
|
||||||
|
@ -124,16 +127,16 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
checkPadding()
|
checkPadding()
|
||||||
|
|
||||||
userInfoContainer.setOnClickListener {
|
userInfoContainer.setOnClickListener {
|
||||||
NavigationUtil.goToUserInfo(activity!!)
|
NavigationUtil.goToUserInfo(requireActivity())
|
||||||
}
|
}
|
||||||
titleWelcome.setTextColor(ThemeStore.textColorPrimary(context!!))
|
titleWelcome.setTextColor(ThemeStore.textColorPrimary(requireContext()))
|
||||||
titleWelcome.text = String.format("%s", PreferenceUtil.getInstance().userName)
|
titleWelcome.text = String.format("%s", PreferenceUtil.getInstance().userName)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkPadding() {
|
private fun checkPadding() {
|
||||||
val marginSpan = when {
|
val marginSpan = when {
|
||||||
MusicPlayerRemote.playingQueue.isEmpty() -> RetroUtil.convertDpToPixel(52f, context!!).toInt()
|
MusicPlayerRemote.playingQueue.isEmpty() -> RetroUtil.convertDpToPixel(52f, context!!).toInt()
|
||||||
else -> RetroUtil.convertDpToPixel(0f, context!!).toInt()
|
else -> RetroUtil.convertDpToPixel(0f, requireContext()).toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
(recyclerView.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = (marginSpan * 2.3f).toInt()
|
(recyclerView.layoutParams as ViewGroup.MarginLayoutParams).bottomMargin = (marginSpan * 2.3f).toInt()
|
||||||
|
@ -154,7 +157,7 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
setNavigationIcon(R.drawable.ic_menu_white_24dp)
|
setNavigationIcon(R.drawable.ic_menu_white_24dp)
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
val pairImageView = Pair.create<View, String>(toolbarContainer, resources.getString(R.string.transition_toolbar))
|
val pairImageView = Pair.create<View, String>(toolbarContainer, resources.getString(R.string.transition_toolbar))
|
||||||
NavigationUtil.goToSearch(activity!!, pairImageView)
|
NavigationUtil.goToSearch(requireActivity(), pairImageView)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -219,20 +222,18 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
super.onCreateOptionsMenu(menu, inflater)
|
super.onCreateOptionsMenu(menu, inflater)
|
||||||
inflater.inflate(R.menu.menu_search, menu)
|
inflater.inflate(R.menu.menu_search, menu)
|
||||||
|
|
||||||
val activity = activity ?: return
|
ToolbarContentTintHelper.handleOnCreateOptionsMenu(requireActivity(), toolbar, menu, ATHToolbarActivity.getToolbarBackgroundColor(toolbar))
|
||||||
ToolbarContentTintHelper.handleOnCreateOptionsMenu(activity, toolbar, menu, ATHToolbarActivity.getToolbarBackgroundColor(toolbar))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPrepareOptionsMenu(menu: Menu) {
|
override fun onPrepareOptionsMenu(menu: Menu) {
|
||||||
super.onPrepareOptionsMenu(menu)
|
super.onPrepareOptionsMenu(menu)
|
||||||
val activity = activity ?: return
|
ToolbarContentTintHelper.handleOnPrepareOptionsMenu(requireActivity(), toolbar)
|
||||||
ToolbarContentTintHelper.handleOnPrepareOptionsMenu(activity, toolbar)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
if (item.itemId == R.id.action_search) {
|
if (item.itemId == R.id.action_search) {
|
||||||
val pairImageView = Pair.create<View, String>(toolbarContainer, resources.getString(R.string.transition_toolbar))
|
val pairImageView = Pair.create<View, String>(toolbarContainer, resources.getString(R.string.transition_toolbar))
|
||||||
NavigationUtil.goToSearch(mainActivity, true, pairImageView)
|
NavigationUtil.goToSearch(requireActivity(), true, pairImageView)
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item)
|
return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
@ -258,13 +259,13 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
||||||
private fun loadTimeImage(day: String) {
|
private fun loadTimeImage(day: String) {
|
||||||
if (bannerImage != null) {
|
if (bannerImage != null) {
|
||||||
if (PreferenceUtil.getInstance().bannerImage.isEmpty()) {
|
if (PreferenceUtil.getInstance().bannerImage.isEmpty()) {
|
||||||
GlideApp.with(activity!!)
|
GlideApp.with(requireActivity())
|
||||||
.load(day)
|
.load(day)
|
||||||
.placeholder(R.drawable.material_design_default)
|
.placeholder(R.drawable.material_design_default)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||||
.into(bannerImage!!)
|
.into(bannerImage!!)
|
||||||
} else {
|
} else {
|
||||||
disposable.add(Compressor(context!!)
|
disposable.add(Compressor(requireActivity())
|
||||||
.setQuality(100)
|
.setQuality(100)
|
||||||
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
.setCompressFormat(Bitmap.CompressFormat.WEBP)
|
||||||
.compressToBitmapAsFlowable(File(PreferenceUtil.getInstance().bannerImage, USER_BANNER))
|
.compressToBitmapAsFlowable(File(PreferenceUtil.getInstance().bannerImage, USER_BANNER))
|
||||||
|
|
|
@ -169,47 +169,6 @@ class ColorFragment : AbsPlayerFragment() {
|
||||||
setColors(backgroundColor, textColor)
|
setColors(backgroundColor, textColor)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/*SongGlideRequest.Builder.from(Glide.with(activity), MusicPlayerRemote.currentSong)
|
|
||||||
.checkIgnoreMediaStore(activity!!)
|
|
||||||
.generatePalette(activity).build().dontAnimate()
|
|
||||||
.into(object : RetroMusicColoredTarget(playerImage) {
|
|
||||||
override fun onColorReady(color: Int) {
|
|
||||||
//setColors(color);
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onLoadFailed(e: Exception?, errorDrawable: Drawable?) {
|
|
||||||
super.onLoadFailed(e, errorDrawable)
|
|
||||||
|
|
||||||
val backgroundColor = defaultFooterColor
|
|
||||||
val textColor = if (ColorUtil.isColorLight(defaultFooterColor))
|
|
||||||
MaterialValueHelper.getPrimaryTextColor(context, true)
|
|
||||||
else
|
|
||||||
MaterialValueHelper.getPrimaryTextColor(context, false)
|
|
||||||
|
|
||||||
setColors(backgroundColor, textColor)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onResourceReady(resource: BitmapPaletteWrapper,
|
|
||||||
glideAnimation: GlideAnimation<in BitmapPaletteWrapper>?) {
|
|
||||||
super.onResourceReady(resource, glideAnimation)
|
|
||||||
*//* MediaNotificationProcessor processor = new MediaNotificationProcessor(getContext(),
|
|
||||||
getContext());
|
|
||||||
Palette.Builder builder = MediaNotificationProcessor
|
|
||||||
.generatePalette(resource.getBitmap());
|
|
||||||
|
|
||||||
int backgroundColor = processor.getBackgroundColor(builder);
|
|
||||||
int textColor = processor.getTextColor(builder);*//*
|
|
||||||
|
|
||||||
val palette = resource.palette
|
|
||||||
val swatch = RetroColorUtil.getSwatch(palette)
|
|
||||||
|
|
||||||
val textColor = RetroColorUtil.getTextColor(palette)
|
|
||||||
val backgroundColor = swatch.rgb
|
|
||||||
|
|
||||||
setColors(backgroundColor, textColor)
|
|
||||||
}
|
|
||||||
})*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setColors(backgroundColor: Int, textColor: Int) {
|
private fun setColors(backgroundColor: Int, textColor: Int) {
|
||||||
|
|
|
@ -5,7 +5,8 @@ import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
|
import code.name.monkey.appthemehelper.util.MaterialValueHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
|
||||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
import code.name.monkey.retromusic.helper.MusicPlayerRemote
|
||||||
|
@ -28,8 +29,13 @@ class TinyPlaybackControlsFragment : AbsPlayerControlsFragment() {
|
||||||
|
|
||||||
override fun setDark(color: Int) {
|
override fun setDark(color: Int) {
|
||||||
|
|
||||||
lastPlaybackControlsColor = ThemeStore.textColorPrimary(requireContext())
|
if (ColorUtil.isColorLight(color)) {
|
||||||
lastDisabledPlaybackControlsColor = ThemeStore.textColorSecondary(requireContext())
|
lastPlaybackControlsColor = MaterialValueHelper.getSecondaryTextColor(requireContext(), true)
|
||||||
|
lastDisabledPlaybackControlsColor = MaterialValueHelper.getSecondaryDisabledTextColor(requireContext(), true)
|
||||||
|
} else {
|
||||||
|
lastPlaybackControlsColor = MaterialValueHelper.getPrimaryTextColor(requireContext(), false)
|
||||||
|
lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(requireContext(), false)
|
||||||
|
}
|
||||||
|
|
||||||
updateRepeatState();
|
updateRepeatState();
|
||||||
updateShuffleState();
|
updateShuffleState();
|
||||||
|
|
|
@ -11,7 +11,6 @@ import androidx.appcompat.widget.Toolbar
|
||||||
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
|
||||||
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.ToolbarContentTintHelper
|
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||||
import code.name.monkey.retromusic.R
|
import code.name.monkey.retromusic.R
|
||||||
import code.name.monkey.retromusic.fragments.MiniPlayerFragment
|
import code.name.monkey.retromusic.fragments.MiniPlayerFragment
|
||||||
|
@ -23,6 +22,7 @@ import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler
|
||||||
import code.name.monkey.retromusic.model.Song
|
import code.name.monkey.retromusic.model.Song
|
||||||
import code.name.monkey.retromusic.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_tiny_player.*
|
import kotlinx.android.synthetic.main.fragment_tiny_player.*
|
||||||
|
|
||||||
class TinyPlayerFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Callback {
|
class TinyPlayerFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Callback {
|
||||||
|
@ -59,28 +59,46 @@ class TinyPlayerFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Ca
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toolbarIconColor(): Int {
|
override fun toolbarIconColor(): Int {
|
||||||
return ThemeStore.textColorSecondary(requireContext())
|
return textColorPrimary
|
||||||
}
|
}
|
||||||
|
|
||||||
private var lastColor: Int = 0
|
private var lastColor: Int = 0
|
||||||
override val paletteColor: Int
|
override val paletteColor: Int
|
||||||
get() = lastColor
|
get() = lastColor
|
||||||
|
|
||||||
|
private var textColorPrimary = 0
|
||||||
|
private var textColorPrimaryDisabled = 0
|
||||||
|
|
||||||
override fun onColorChanged(color: Int) {
|
override fun onColorChanged(color: Int) {
|
||||||
|
|
||||||
val lastColor = if (PreferenceUtil.getInstance().adaptiveColor) {
|
val colorFinal = if (PreferenceUtil.getInstance().adaptiveColor) {
|
||||||
color
|
color
|
||||||
} else {
|
} else {
|
||||||
ThemeStore.accentColor(requireContext())
|
ThemeStore.accentColor(requireContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ColorUtil.isColorLight(color)) {
|
||||||
|
textColorPrimary = MaterialValueHelper.getSecondaryTextColor(requireContext(), true)
|
||||||
|
textColorPrimaryDisabled = MaterialValueHelper.getSecondaryTextColor(requireContext(), true)
|
||||||
|
} else {
|
||||||
|
textColorPrimary = MaterialValueHelper.getPrimaryTextColor(requireContext(), false)
|
||||||
|
textColorPrimaryDisabled = MaterialValueHelper.getSecondaryTextColor(requireContext(), false)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastColor = colorFinal
|
||||||
|
|
||||||
callbacks?.onPaletteColorChanged()
|
callbacks?.onPaletteColorChanged()
|
||||||
|
|
||||||
tinyPlaybackControlsFragment.setDark(lastColor)
|
tinyPlaybackControlsFragment.setDark(colorFinal)
|
||||||
|
|
||||||
TintHelper.setTintAuto(progressBar, lastColor, false)
|
ViewUtil.setProgressDrawable(progressBar, colorFinal)
|
||||||
|
|
||||||
val iconColor = ThemeStore.textColorSecondary(requireContext())
|
songTitle.setTextColor(textColorPrimary)
|
||||||
ToolbarContentTintHelper.colorizeToolbar(playerToolbar, iconColor, requireActivity())
|
songText.setTextColor(textColorPrimaryDisabled)
|
||||||
|
|
||||||
|
playerSongTotalTime.setTextColor(textColorPrimary)
|
||||||
|
|
||||||
|
ToolbarContentTintHelper.colorizeToolbar(playerToolbar, textColorPrimary, requireActivity())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFavoriteToggled() {
|
override fun onFavoriteToggled() {
|
||||||
|
|
|
@ -60,12 +60,14 @@ object ViewUtil {
|
||||||
|
|
||||||
val ld = progressSlider.progressDrawable as LayerDrawable
|
val ld = progressSlider.progressDrawable as LayerDrawable
|
||||||
|
|
||||||
val clipDrawableProgress = ld.findDrawableByLayerId(android.R.id.progress)
|
val progress = ld.findDrawableByLayerId(android.R.id.progress)
|
||||||
clipDrawableProgress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
|
progress.setColorFilter(newColor, PorterDuff.Mode.SRC_IN)
|
||||||
|
|
||||||
val clipDrawableBackground = ld.findDrawableByLayerId(android.R.id.background)
|
val background = ld.findDrawableByLayerId(android.R.id.background)
|
||||||
clipDrawableBackground.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(progressSlider.context, ColorUtil.isColorLight(ThemeStore.primaryColor(progressSlider.context))), PorterDuff.Mode.SRC_IN)
|
background.setColorFilter(MaterialValueHelper.getPrimaryDisabledTextColor(progressSlider.context, ColorUtil.isColorLight(ThemeStore.primaryColor(progressSlider.context))), PorterDuff.Mode.SRC_IN)
|
||||||
|
|
||||||
|
val secondaryProgress = ld.findDrawableByLayerId(android.R.id.secondaryProgress)
|
||||||
|
secondaryProgress.setColorFilter(ColorUtil.withAlpha(newColor, 0.65f), PorterDuff.Mode.SRC_IN)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createColorAnimator(target: Any, propertyName: String, @ColorInt startColor: Int, @ColorInt endColor: Int): Animator {
|
private fun createColorAnimator(target: Any, propertyName: String, @ColorInt startColor: Int, @ColorInt endColor: Int): Animator {
|
||||||
|
|
BIN
app/src/main/res/drawable-xxxhdpi/retro_icon.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/retro_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
|
@ -5,13 +5,21 @@
|
||||||
<solid android:color="@android:color/transparent" />
|
<solid android:color="@android:color/transparent" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
<item android:id="@android:id/secondaryProgress">
|
||||||
|
<clip
|
||||||
|
android:clipOrientation="vertical"
|
||||||
|
android:gravity="bottom">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="@color/md_red_400" />
|
||||||
|
</shape>
|
||||||
|
</clip>
|
||||||
|
</item>
|
||||||
<item android:id="@android:id/progress">
|
<item android:id="@android:id/progress">
|
||||||
<clip
|
<clip
|
||||||
android:clipOrientation="vertical"
|
android:clipOrientation="vertical"
|
||||||
android:gravity="bottom">
|
android:gravity="bottom">
|
||||||
<shape>
|
<shape>
|
||||||
<solid
|
<solid android:color="@color/md_deep_purple_A400" />
|
||||||
android:color="@color/md_deep_purple_A400" />
|
|
||||||
</shape>
|
</shape>
|
||||||
</clip>
|
</clip>
|
||||||
</item>
|
</item>
|
||||||
|
|
25
app/src/main/res/drawable/splash.xml
Normal file
25
app/src/main/res/drawable/splash.xml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:drawable="?colorPrimary" />
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@drawable/retro_icon" />
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</layer-list>
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
@ -61,5 +75,3 @@
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
@ -57,4 +71,3 @@
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (c) 2019 Hemanth Savarala.
|
||||||
|
~
|
||||||
|
~ Licensed under the GNU General Public License v3
|
||||||
|
~
|
||||||
|
~ This is free software: you can redistribute it and/or modify it under
|
||||||
|
~ the terms of the GNU General Public License as published by
|
||||||
|
~ the Free Software Foundation either version 3 of the License, or (at your option) any later version.
|
||||||
|
~
|
||||||
|
~ This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||||
|
~ without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
~ See the GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
|
||||||
<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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
@ -33,13 +47,13 @@
|
||||||
android:id="@+id/toolbarContainer"
|
android:id="@+id/toolbarContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
app:cardCornerRadius="8dp"
|
app:cardCornerRadius="8dp"
|
||||||
app:cardElevation="0dp"
|
app:cardElevation="0dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
app:strokeColor="?dividerColor"
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
app:layout_scrollFlags="scroll|enterAlways"
|
||||||
app:strokeColor="?dividerColor"
|
|
||||||
app:strokeWidth="1dp">
|
app:strokeWidth="1dp">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
@ -49,9 +63,8 @@
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
style="@style/Toolbar"
|
style="@style/Toolbar"
|
||||||
app:title="@string/search_hint"
|
|
||||||
app:titleMarginStart="0dp"
|
app:titleMarginStart="0dp"
|
||||||
app:titleTextAppearance="@style/TextAppearance.MaterialComponents.Body1"
|
app:title="@string/library"
|
||||||
tools:ignore="UnusedAttribute" />
|
tools:ignore="UnusedAttribute" />
|
||||||
|
|
||||||
<ViewStub
|
<ViewStub
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:max="100"
|
android:max="100"
|
||||||
android:progress="80"
|
android:progress="80"
|
||||||
|
android:secondaryProgress="100"
|
||||||
android:progressDrawable="@drawable/progress_drawable_vertical" />
|
android:progressDrawable="@drawable/progress_drawable_vertical" />
|
||||||
|
|
||||||
<code.name.monkey.retromusic.views.FitSystemWindowsLayout
|
<code.name.monkey.retromusic.views.FitSystemWindowsLayout
|
||||||
|
|
|
@ -8,20 +8,6 @@ import android.os.Build
|
||||||
|
|
||||||
object VersionUtils {
|
object VersionUtils {
|
||||||
|
|
||||||
/**
|
|
||||||
* @return true if device is running API >= 19
|
|
||||||
*/
|
|
||||||
fun hasKitKat(): Boolean {
|
|
||||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return true if device is running API >= 20
|
|
||||||
*/
|
|
||||||
fun hasAndroidLPreview(): Boolean {
|
|
||||||
return Build.VERSION.SDK_INT >= 20
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if device is running API >= 21
|
* @return true if device is running API >= 21
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue