diff --git a/app/build.gradle b/app/build.gradle
index 5e7ae2db0..747962195 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -13,8 +13,8 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
- versionCode 378
- versionName '3.4.200-beta04'
+ versionCode 379
+ versionName '3.4.400-beta05'
multiDexEnabled true
@@ -118,7 +118,7 @@ dependencies {
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
- implementation 'com.google.android.material:material:1.1.0-alpha10'
+ implementation 'com.google.android.material:material:1.1.0-beta01'
implementation 'com.google.android.play:core:1.6.3'
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
@@ -151,7 +151,6 @@ dependencies {
implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0'
implementation 'com.github.kabouzeid:recyclerview-fastscroll:1.9-kmod'
- implementation 'com.github.kabouzeid:AndroidSlidingUpPanel:3.3.3-kmod'
implementation 'com.github.AdrienPoupa:jaudiotagger:2.2.3'
diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html
index 97e68bbed..7e1c2dc48 100644
--- a/app/src/main/assets/retro-changelog.html
+++ b/app/src/main/assets/retro-changelog.html
@@ -1 +1 @@
-
v3.4.000
- Removed color theme as material design guidelines
- Fix remaining time in playing queue
- Fix font not applied for some components
- Performance improved
- Updated internal libraries
- Removed artist loading from Deezer because it's not official to use(will come back with
official)
- Updated translation
- Fix crashing on album details sorting
- Fixed lot of internal bugs
- Limiting the use of Theme engine for making use of system colors
- Change home icon from user
v3.3.200
- Fix fullscreen bottom tabs icons squash
- Improved tiny theme colors
- Android auto support
- New notification icon
- Favorite icon in mini player
v.3.3.100
- Improved Now playing controls alignment
- Lot internal changes to improve performance
- Fix playlist adding crash
- Fix color corrections
- Fix file editing crash
v3.3.000
- SD card support for deleting and editing
v3.2.240
- Improved options dialog with selected color and title icon
- Fix dialog color on dark theme
v3.2.220
- Fix Notification SeekBar position (Need Android Q test)
- Rolled back settings tint icons
- Changed preference category title style according Android Q
- Fix tabs options not working
v3.2.203
- Carousel effect improved
- Settings icons are now tint accent color
- Settings title, back arrow and icons are now tint accent color
- Equalizer is removed
- Fix keyboard not popping on Search
- Curated the main options
- Folder toolbar outlined, folder icon background fix and separate line removed
- Edit text input handles are colored
v3.2.135
- Fix crashing on sharing song
v3.2.125
- Fix crashing on selecting profile picture
- Semi transparent color fix(s) on now playing themes
v3.2.120
- Fix crashing on choosing a theme
- Fix color theme selection without pro enabled
- Fix icon tint some places
v3.2.105
v3.2.100
- Fix crashing on Sleep timer
- Toolbar elevation removed added stroke instead
- Show empty indication for home
v3.2.000
- Implemented Artist image loading all thanks to VinylMusicPlayer
- Fixed buttons in Genre details
- Fixed color buttons in Album and Artist details screen
v3.1.900
- Added Play and Shuffle buttons on Songs list, Album Details, Artist Details, Playlist
Details etc.
- Home toolbar is semi transparent in Banner mode
- Added new Buy Retro Music pro in settings
- Improved dark color in Dark theme
v3.1.850
- Toolbar will be clickable for Search
v3.1.800
- Search bar CardView background
- Improve volume zero
- Now playing and Album theme picker rollback to dialog
- Fix sharing app link
- Fix scanning dialog
- Added settings icons for options
v3.1.700
- Cleaned internal code
- Removed full screen option
- Added Toolbar elevation
- To access menu either tap on Toolbar or Hamburger icon
- Fix back button not working on playing queue
- Fix crashing on What's New screen
- Fix lyrics dialog
- Changed toggles to line icons
- Fix crashing on artist list for number format error
- Fix blacklist dialog crashing
- Rearranged icons and main menu access
- Fix some crashes when device is locked or background
- Folder screen have main options access
- Dialogs are now using Material Dialogs v3(BottomSheet)
- Fix Shuffle icon for Artist, Album, Genre and Playlist details
v3.1.400
- Removed sync lyrics for Android 5
- Fix Seek-bar color in settings
- Added keyboard to popup on search
- Added keyboard to popup on search
- Improved lock-screen behavior and UI
- Improved text appearance
- Fix bio text not showing in settings
- Fix not showing slider(blur, filter song) amount in settings
- Fix setting ringtone
- Fix file sharing crash
- Fix some crashes
- Fix playlist icon on small devices
- Fix empty lyrics text color
- Fix album cover background purple color in color theme
v3.1.300
- Fix rename playlist text color
- Fix same album showing in details page
- Fix lyrics text alignment on sync and lyrics reading improved
- Improved home sections loading
- Removed library options which are duplicated (it's available from profile menu)
- Replaced collapsing Fab with Android Floating Extended Fab
- Replaced home with for you
- Fixed profile image not loading in about
- Improved selecting user profile image
- Added bio to enter custom message
- Improved some UI screens
If you see entire app white or dark or black select same theme in settings to fix
FAQ's
*If you face any UI related issues you clear app data and cache, if its
not working try to
uninstall and install again.
\ No newline at end of file
+
v3.4.000
- Added app rating dialog
- Fix remaining time in playing queue
- Fix font not applied for some components
- Fix crashing on album details sorting
- Fixed lot of internal bugs
- Fix dialog expand
- Removed SlidingUpPanel to replace with BottomSheet
- Removed color theme as per material design guidelines
- Removed classic theme(We're bringing back)
- Removed artist loading from Deezer because it's not official to use(will come back with
official)
- Replace line switch to Material Switch in settings
- Performance improved
- Updated internal libraries
- Updated translation
- Limiting the use of Theme engine for making use of system colors
- Change home icon from user icon
- Corrected all toolbar with elevation when scroll
v3.3.200
- Fix fullscreen bottom tabs icons squash
- Improved tiny theme colors
- Android auto support
- New notification icon
- Favorite icon in mini player
v.3.3.100
- Improved Now playing controls alignment
- Lot internal changes to improve performance
- Fix playlist adding crash
- Fix color corrections
- Fix file editing crash
v3.3.000
- SD card support for deleting and editing
v3.2.240
- Improved options dialog with selected color and title icon
- Fix dialog color on dark theme
v3.2.220
- Fix Notification SeekBar position (Need Android Q test)
- Rolled back settings tint icons
- Changed preference category title style according Android Q
- Fix tabs options not working
v3.2.203
- Carousel effect improved
- Settings icons are now tint accent color
- Settings title, back arrow and icons are now tint accent color
- Equalizer is removed
- Fix keyboard not popping on Search
- Curated the main options
- Folder toolbar outlined, folder icon background fix and separate line removed
- Edit text input handles are colored
v3.2.135
- Fix crashing on sharing song
v3.2.125
- Fix crashing on selecting profile picture
- Semi transparent color fix(s) on now playing themes
v3.2.120
- Fix crashing on choosing a theme
- Fix color theme selection without pro enabled
- Fix icon tint some places
v3.2.105
v3.2.100
- Fix crashing on Sleep timer
- Toolbar elevation removed added stroke instead
- Show empty indication for home
v3.2.000
- Implemented Artist image loading all thanks to VinylMusicPlayer
- Fixed buttons in Genre details
- Fixed color buttons in Album and Artist details screen
v3.1.900
- Added Play and Shuffle buttons on Songs list, Album Details, Artist Details, Playlist
Details etc.
- Home toolbar is semi transparent in Banner mode
- Added new Buy Retro Music pro in settings
- Improved dark color in Dark theme
v3.1.850
- Toolbar will be clickable for Search
v3.1.800
- Search bar CardView background
- Improve volume zero
- Now playing and Album theme picker rollback to dialog
- Fix sharing app link
- Fix scanning dialog
- Added settings icons for options
v3.1.700
- Cleaned internal code
- Removed full screen option
- Added Toolbar elevation
- To access menu either tap on Toolbar or Hamburger icon
- Fix back button not working on playing queue
- Fix crashing on What's New screen
- Fix lyrics dialog
- Changed toggles to line icons
- Fix crashing on artist list for number format error
- Fix blacklist dialog crashing
- Rearranged icons and main menu access
- Fix some crashes when device is locked or background
- Folder screen have main options access
- Dialogs are now using Material Dialogs v3(BottomSheet)
- Fix Shuffle icon for Artist, Album, Genre and Playlist details
v3.1.400
- Removed sync lyrics for Android 5
- Fix Seek-bar color in settings
- Added keyboard to popup on search
- Added keyboard to popup on search
- Improved lock-screen behavior and UI
- Improved text appearance
- Fix bio text not showing in settings
- Fix not showing slider(blur, filter song) amount in settings
- Fix setting ringtone
- Fix file sharing crash
- Fix some crashes
- Fix playlist icon on small devices
- Fix empty lyrics text color
- Fix album cover background purple color in color theme
v3.1.300
- Fix rename playlist text color
- Fix same album showing in details page
- Fix lyrics text alignment on sync and lyrics reading improved
- Improved home sections loading
- Removed library options which are duplicated (it's available from profile menu)
- Replaced collapsing Fab with Android Floating Extended Fab
- Replaced home with for you
- Fixed profile image not loading in about
- Improved selecting user profile image
- Added bio to enter custom message
- Improved some UI screens
If you see entire app white or dark or black select same theme in settings to fix
FAQ's
*If you face any UI related issues you clear app data and cache, if its
not working try to
uninstall and install again.
\ No newline at end of file
diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt
index ca6b76778..75f14e00e 100644
--- a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt
@@ -88,8 +88,6 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay
updateTabs()
bottomSheetBehavior = BottomSheetBehavior.from(slidingPanel)
- bottomSheetBehavior.bottomSheetCallback = bottomSheetCallbackList
-
}
override fun onResume() {
@@ -97,6 +95,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay
if (currentNowPlayingScreen != PreferenceUtil.getInstance(this).nowPlayingScreen) {
postRecreate()
}
+ bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallbackList)
if (bottomSheetBehavior.state == BottomSheetBehavior.STATE_EXPANDED) {
setMiniPlayerAlphaProgress(1f)
@@ -105,6 +104,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity(), AbsPlay
override fun onDestroy() {
super.onDestroy()
+ bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallbackList)
if (navigationBarColorAnimator != null) navigationBarColorAnimator!!.cancel() // just in case
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/HomeAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/HomeAdapter.kt
index 3835cc63d..896611112 100644
--- a/app/src/main/java/code/name/monkey/retromusic/adapter/HomeAdapter.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/adapter/HomeAdapter.kt
@@ -99,7 +99,8 @@ class HomeAdapter(
fun bindView(home: Home) {
recyclerView.apply {
layoutManager = GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false)
- val artistAdapter = ArtistAdapter(activity, home.arrayList as ArrayList, PreferenceUtil.getInstance(activity).getHomeGridStyle(context!!), false, null)
+ val artistAdapter = ArtistAdapter(activity, home.arrayList as ArrayList,
+ PreferenceUtil.getInstance(activity).getHomeGridStyle(activity), false, null)
adapter = artistAdapter
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/album/AlbumAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/album/AlbumAdapter.kt
index f28b9dbd9..40b79f5a5 100644
--- a/app/src/main/java/code/name/monkey/retromusic/adapter/album/AlbumAdapter.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/adapter/album/AlbumAdapter.kt
@@ -97,12 +97,13 @@ open class AlbumAdapter(protected val activity: AppCompatActivity,
}
protected open fun setColors(color: Int, holder: ViewHolder) {
- holder.paletteColorContainer?.let {
- it.setBackgroundColor(color)
+ if (holder.paletteColorContainer != null) {
holder.title?.setTextColor(
MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)))
holder.text?.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)))
+ holder.paletteColorContainer?.setBackgroundColor(color)
}
+
holder.mask?.backgroundTintList = ColorStateList.valueOf(color)
}
@@ -121,10 +122,7 @@ open class AlbumAdapter(protected val activity: AppCompatActivity,
}
override fun onColorReady(color: Int) {
- if (usePalette)
- setColors(color, holder)
- else
- setColors(defaultFooterColor, holder)
+ setColors(color, holder)
}
})
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/adapter/artist/ArtistAdapter.kt b/app/src/main/java/code/name/monkey/retromusic/adapter/artist/ArtistAdapter.kt
index 9cd7aa2c2..58e8dec58 100644
--- a/app/src/main/java/code/name/monkey/retromusic/adapter/artist/ArtistAdapter.kt
+++ b/app/src/main/java/code/name/monkey/retromusic/adapter/artist/ArtistAdapter.kt
@@ -32,7 +32,7 @@ class ArtistAdapter(val activity: AppCompatActivity,
@LayoutRes var itemLayoutRes: Int,
var usePalette: Boolean,
cabHolder: CabHolder?
-) : AbsMultiSelectAdapter(activity, cabHolder, code.name.monkey.retromusic.R.menu.menu_media_selection), FastScrollRecyclerView.SectionedAdapter {
+) : AbsMultiSelectAdapter(activity, cabHolder, R.menu.menu_media_selection), FastScrollRecyclerView.SectionedAdapter {
fun swapDataSet(dataSet: ArrayList) {
this.dataSet = dataSet
@@ -67,10 +67,11 @@ class ArtistAdapter(val activity: AppCompatActivity,
}
fun setColors(color: Int, holder: ViewHolder) {
- holder.paletteColorContainer?.let {
- it.setBackgroundColor(color)
+ if (holder.paletteColorContainer != null) {
+ holder.paletteColorContainer?.setBackgroundColor(color)
holder.title?.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)))
}
+
holder.mask?.backgroundTintList = ColorStateList.valueOf(color)
}
@@ -87,10 +88,7 @@ class ArtistAdapter(val activity: AppCompatActivity,
}
override fun onColorReady(color: Int) {
- if (usePalette)
- setColors(color, holder)
- else
- setColors(defaultFooterColor, holder)
+ setColors(color, holder)
}
})
}
diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/classic/ClassicPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/classic/ClassicPlayerFragment.kt
deleted file mode 100644
index 572bfbbf0..000000000
--- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/classic/ClassicPlayerFragment.kt
+++ /dev/null
@@ -1,413 +0,0 @@
-package code.name.monkey.retromusic.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.activities.base.AbsSlidingMusicPanelActivity
-import code.name.monkey.retromusic.adapter.base.MediaEntryViewHolder
-import code.name.monkey.retromusic.adapter.song.PlayingQueueAdapter
-import code.name.monkey.retromusic.dialogs.SongShareDialog
-import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment
-import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment
-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.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.*
-import kotlin.math.max
-
-
-class ClassicPlayerFragment : AbsPlayerFragment(), 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 playerToolbar(): Toolbar {
- return playerToolbar
- }
-
- override fun onShow() {
- controlsFragment.show()
- }
-
- override fun onHide() {
- controlsFragment.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)
- controlsFragment.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 controlsFragment: 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 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(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(requireContext(), R.attr.colorPrimary))
- }
-
- private fun setUpPlayerToolbar() {
- playerToolbar.apply {
- inflateMenu(R.menu.menu_player)
- setNavigationOnClickListener { activity!!.onBackPressed() }
- setOnMenuItemClickListener(this@ClassicPlayerFragment)
- }
- }
-
-
- private fun setUpSubFragments() {
- controlsFragment = 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.controlsFragment.playerPlayPauseFab.x + (fragment.controlsFragment.playerPlayPauseFab.width / 2).toFloat() + fragment.controlsFragment.view!!.x).toInt()
- val y = (fragment.controlsFragment.playerPlayPauseFab.y + (fragment.controlsFragment.playerPlayPauseFab.height / 2).toFloat() + fragment.controlsFragment.view!!.y + fragment.controlsFragment.playerProgressSlider.height.toFloat()).toInt()
- val startRadius = max(fragment.controlsFragment.playerPlayPauseFab.width / 2, fragment.controlsFragment.playerPlayPauseFab.height / 2).toFloat()
- val endRadius = 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 {
- image?.apply {
- scaleType = ImageView.ScaleType.CENTER
- setColorFilter(ATHUtil.resolveColor(fragment.activity!!, R.attr.iconColor, ThemeStore.textColorSecondary(fragment.activity!!)), PorterDuff.Mode.SRC_IN)
- setImageResource(R.drawable.ic_equalizer_white_24dp)
- }
- imageTextContainer?.let {
- it.cardElevation = 0f
- it.setCardBackgroundColor(ATHUtil.resolveColor(fragment.requireContext(), R.attr.colorPrimary))
- }
-
- 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() = R.menu.menu_item_playing_queue_song
-
- override fun onMenuItemClick(item: MenuItem): Boolean {
- when (item.itemId) {
- R.id.action_remove_from_playing_queue -> {
- MusicPlayerRemote.removeFromQueue(MusicPlayerRemote.position)
- return true
- }
- 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(R.id.albumCoverContainer)
- val availablePanelHeight = fragment.playerSlidingLayout.height - fragment.view!!.findViewById(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(R.id.playerPanel))
-
- }
-
- private var currentSongViewHolder: MediaEntryViewHolder? = null
- var currentSong = Song.emptySong
-
-}
-
-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.controlsFragment.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()
-}
\ No newline at end of file
diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/classic/ClassicPlayerPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/classic/ClassicPlayerPlaybackControlsFragment.kt
deleted file mode 100644
index e264016b5..000000000
--- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/classic/ClassicPlayerPlaybackControlsFragment.kt
+++ /dev/null
@@ -1,218 +0,0 @@
-package code.name.monkey.retromusic.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.LinearInterpolator
-import android.widget.SeekBar
-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.extensions.ripAlpha
-import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment
-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.util.MusicUtil
-import kotlinx.android.synthetic.main.fragment_classic_player_playback_controls.*
-
-
-class ClassicPlayerPlaybackControlsFragment : AbsPlayerControlsFragment() {
- public override fun show() {
-
- }
-
- public override fun hide() {
-
- }
-
-
- override fun setDark(color: Int) {
-
- }
-
- fun setDark(dark: Boolean) {
- if (dark) {
- lastPlaybackControlsColor = MaterialValueHelper.getSecondaryTextColor(activity, true)
- lastDisabledPlaybackControlsColor = MaterialValueHelper.getSecondaryDisabledTextColor(activity, true)
- } else {
- lastPlaybackControlsColor = MaterialValueHelper.getPrimaryTextColor(activity, false)
- lastDisabledPlaybackControlsColor = MaterialValueHelper.getPrimaryDisabledTextColor(activity, false)
- }
-
- volumeFragment?.setTintableColor(lastPlaybackControlsColor.ripAlpha())
-
- updateRepeatState()
- updateShuffleState()
- updatePrevNextColor()
- updateProgressTextColor()
-
- val fabColor = Color.WHITE
- TintHelper.setTintAuto(playerPlayPauseFab, fabColor, true)
- TintHelper.setTintAuto(playerPlayPauseFab, MaterialValueHelper.getPrimaryTextColor(requireContext(), ColorUtil.isColorLight(fabColor)), false)
-
- }
-
-
- private var lastPlaybackControlsColor = 0
- private var lastDisabledPlaybackControlsColor = 0
-
- private lateinit var progressViewUpdateHelper: MusicProgressViewUpdateHelper
-
-
- override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
- return inflater.inflate(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 updatePlayPauseDrawableState() {
- if (MusicPlayerRemote.isPlaying) {
- playerPlayPauseFab.setImageResource(R.drawable.ic_pause_white_24dp)
- } else {
- playerPlayPauseFab.setImageResource(R.drawable.ic_play_arrow_white_32dp)
- }
- }
-
- private fun setUpPlayPauseFab() {
- 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()
- updateRepeatState()
- updateShuffleState()
- }
-
- override fun onPlayStateChanged() {
- updatePlayPauseDrawableState()
- }
-
- override fun onRepeatModeChanged() {
- updateRepeatState()
- }
-
- override fun onShuffleModeChanged() {
- updateShuffleState()
- }
-}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/tab_indicator.xml b/app/src/main/res/drawable/tab_indicator.xml
index 2f6041cab..78af14451 100644
--- a/app/src/main/res/drawable/tab_indicator.xml
+++ b/app/src/main/res/drawable/tab_indicator.xml
@@ -1,7 +1,16 @@
-
-
-
-
\ No newline at end of file
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout-land/fragment_classic_player.xml b/app/src/main/res/layout-land/fragment_classic_player.xml
deleted file mode 100644
index 7ca062111..000000000
--- a/app/src/main/res/layout-land/fragment_classic_player.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_classic_player.xml b/app/src/main/res/layout/fragment_classic_player.xml
deleted file mode 100644
index 452b5b689..000000000
--- a/app/src/main/res/layout/fragment_classic_player.xml
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_classic_player_playback_controls.xml b/app/src/main/res/layout/fragment_classic_player_playback_controls.xml
deleted file mode 100644
index 075034fc8..000000000
--- a/app/src/main/res/layout/fragment_classic_player_playback_controls.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_album_card.xml b/app/src/main/res/layout/item_album_card.xml
index f690492c7..1b8936ef2 100644
--- a/app/src/main/res/layout/item_album_card.xml
+++ b/app/src/main/res/layout/item_album_card.xml
@@ -27,7 +27,7 @@
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="1"
- android:paddingStart="8dp"
+ android:paddingStart="12dp"
android:paddingTop="6dp"
android:paddingEnd="8dp"
android:paddingBottom="4dp"
diff --git a/app/src/main/res/layout/item_artist_square.xml b/app/src/main/res/layout/item_artist_square.xml
index c2ea61968..d63bdfe83 100644
--- a/app/src/main/res/layout/item_artist_square.xml
+++ b/app/src/main/res/layout/item_artist_square.xml
@@ -15,8 +15,8 @@
diff --git a/app/src/main/res/layout/item_image_gradient.xml b/app/src/main/res/layout/item_image_gradient.xml
index 702addddc..665d020b9 100644
--- a/app/src/main/res/layout/item_image_gradient.xml
+++ b/app/src/main/res/layout/item_image_gradient.xml
@@ -6,6 +6,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
app:cardCornerRadius="8dp"
+ app:cardElevation="4dp"
app:cardUseCompatPadding="true"
tools:backgroundTint="@color/md_red_400">