From f69a04b2d245cf69bd3b9913314985c5b62e951a Mon Sep 17 00:00:00 2001 From: h4h13 Date: Fri, 21 Feb 2020 13:26:44 +0530 Subject: [PATCH] Added song info refresh and song sort by date modified --- .../retromusic/activities/MainActivity.java | 23 +++++++++++-------- .../AdaptivePlaybackControlsFragment.kt | 2 ++ .../blur/BlurPlaybackControlsFragment.kt | 4 +++- .../card/CardPlaybackControlsFragment.kt | 6 +++-- .../CardBlurPlaybackControlsFragment.kt | 11 +++++++-- .../player/circle/CirclePlayerFragment.kt | 6 +++-- .../color/ColorPlaybackControlsFragment.kt | 6 +++-- .../player/fit/FitPlaybackControlsFragment.kt | 6 +++-- .../flat/FlatPlaybackControlsFragment.kt | 7 +++--- .../full/FullPlaybackControlsFragment.kt | 6 +++-- .../player/full/FullPlayerFragment.kt | 2 +- .../material/MaterialControlsFragment.kt | 6 +++-- .../normal/PlayerPlaybackControlsFragment.kt | 6 +++-- .../player/peak/PeakPlayerFragment.kt | 7 ++++-- .../plain/PlainPlaybackControlsFragment.kt | 6 +++-- .../simple/SimplePlaybackControlsFragment.kt | 7 ++++-- .../player/tiny/TinyPlayerFragment.kt | 6 +++-- .../monkey/retromusic/helper/SortOrder.kt | 2 +- .../res/drawable/ic_dashboard_white_24dp.xml | 19 +++++++++++++++ app/src/main/res/menu/menu_main.xml | 6 ++--- app/src/main/res/values/ids.xml | 1 + app/src/main/res/values/strings.xml | 1 + 22 files changed, 104 insertions(+), 42 deletions(-) create mode 100644 app/src/main/res/drawable/ic_dashboard_white_24dp.xml diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.java b/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.java index 53bae439..b728fd8e 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.java @@ -287,14 +287,14 @@ public class MainActivity extends AbsSlidingMusicPanelActivity key.equals(PreferenceUtil.ADAPTIVE_COLOR_APP) || key.equals(PreferenceUtil.DOMINANT_COLOR) || key.equals(PreferenceUtil.USER_NAME) || key.equals(PreferenceUtil.TOGGLE_FULL_SCREEN) || key.equals(PreferenceUtil.TOGGLE_VOLUME) || key.equals(PreferenceUtil.ROUND_CORNERS) || - key.equals(PreferenceUtil.CAROUSEL_EFFECT) || key == PreferenceUtil.NOW_PLAYING_SCREEN_ID || - key == PreferenceUtil.TOGGLE_GENRE || key.equals(PreferenceUtil.BANNER_IMAGE_PATH) || - key == PreferenceUtil.PROFILE_IMAGE_PATH || key == PreferenceUtil.CIRCULAR_ALBUM_ART || - key == PreferenceUtil.KEEP_SCREEN_ON || key == PreferenceUtil.TOGGLE_SEPARATE_LINE || - key == PreferenceUtil.TOGGLE_HOME_BANNER || key == PreferenceUtil.TOGGLE_ADD_CONTROLS || - key == PreferenceUtil.ALBUM_COVER_STYLE || key == PreferenceUtil.HOME_ARTIST_GRID_STYLE || - key == PreferenceUtil.ALBUM_COVER_TRANSFORM || key == PreferenceUtil.DESATURATED_COLOR || - key == PreferenceUtil.TAB_TEXT_MODE || key == PreferenceUtil.LIBRARY_CATEGORIES + key.equals(PreferenceUtil.CAROUSEL_EFFECT) || key.equals(PreferenceUtil.NOW_PLAYING_SCREEN_ID) || + key.equals(PreferenceUtil.TOGGLE_GENRE) || key.equals(PreferenceUtil.BANNER_IMAGE_PATH) || + key.equals(PreferenceUtil.PROFILE_IMAGE_PATH) || key.equals(PreferenceUtil.CIRCULAR_ALBUM_ART) || + key.equals(PreferenceUtil.KEEP_SCREEN_ON) || key.equals(PreferenceUtil.TOGGLE_SEPARATE_LINE) || + key.equals(PreferenceUtil.TOGGLE_HOME_BANNER) || key.equals(PreferenceUtil.TOGGLE_ADD_CONTROLS) || + key.equals(PreferenceUtil.ALBUM_COVER_STYLE) || key.equals(PreferenceUtil.HOME_ARTIST_GRID_STYLE) || + key.equals(PreferenceUtil.ALBUM_COVER_TRANSFORM) || key.equals(PreferenceUtil.DESATURATED_COLOR) || + key.equals(PreferenceUtil.TAB_TEXT_MODE) || key.equals(PreferenceUtil.LIBRARY_CATEGORIES) ) { postRecreate(); } @@ -321,7 +321,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity mAppBarLayout.removeOnOffsetChangedListener(onOffsetChangedListener); } - public void setCurrentFragment(Fragment fragment, String tag) { + public void setCurrentFragment(@NonNull Fragment fragment, @NonNull String tag) { String currentTag = null; if (getSupportFragmentManager().findFragmentByTag(tag) != null) { currentTag = getSupportFragmentManager().findFragmentByTag(tag).getTag(); @@ -547,6 +547,9 @@ public class MainActivity extends AbsSlidingMusicPanelActivity case R.id.action_song_sort_order_composer: sortOrder = SongSortOrder.COMPOSER; break; + case R.id.action_song_sort_order_date_modified: + sortOrder = SongSortOrder.SONG_DATE_MODIFIED; + break; } } @@ -700,6 +703,8 @@ public class MainActivity extends AbsSlidingMusicPanelActivity .setChecked(currentSortOrder.equals(SongSortOrder.SONG_DATE)); sortOrderMenu.add(0, R.id.action_song_sort_order_composer, 6, R.string.sort_order_composer) .setChecked(currentSortOrder.equals(SongSortOrder.COMPOSER)); + sortOrderMenu.add(0, R.id.action_song_sort_order_date_modified, 6, R.string.sort_order_date_modified) + .setChecked(currentSortOrder.equals(SongSortOrder.COMPOSER)); } sortOrderMenu.setGroupCheckable(0, true, true); diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt index c858e535..bcde8aeb 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptivePlaybackControlsFragment.kt @@ -16,6 +16,7 @@ import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide import code.name.monkey.retromusic.extensions.ripAlpha +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -70,6 +71,7 @@ class AdaptivePlaybackControlsFragment : AbsPlayerControlsFragment() { private fun updateSong() { if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { songInfo?.text = getSongInfo(MusicPlayerRemote.currentSong) + songInfo.show() } else { songInfo?.hide() } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/blur/BlurPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/blur/BlurPlaybackControlsFragment.kt index 4cbcc681..41120517 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/blur/BlurPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/blur/BlurPlaybackControlsFragment.kt @@ -17,6 +17,7 @@ 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.hide +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -75,9 +76,10 @@ class BlurPlaybackControlsFragment : AbsPlayerControlsFragment() { private fun updateSong() { val song = MusicPlayerRemote.currentSong title.text = song.title - text.text = "${song.artistName} • ${song.albumName}" + text.text = String.format("%s • %s", song.artistName, song.albumName) if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { + songInfo.show() songInfo?.text = getSongInfo(song) } else { songInfo?.hide() diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardPlaybackControlsFragment.kt index f3d8e093..e04de9fa 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardPlaybackControlsFragment.kt @@ -16,6 +16,7 @@ import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide import code.name.monkey.retromusic.extensions.ripAlpha +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -77,9 +78,10 @@ class CardPlaybackControlsFragment : AbsPlayerControlsFragment() { text.text = song.artistName if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(MusicPlayerRemote.currentSong) + songInfo.text = getSongInfo(MusicPlayerRemote.currentSong) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/cardblur/CardBlurPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/cardblur/CardBlurPlaybackControlsFragment.kt index 6107ca15..81f1e9c4 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/cardblur/CardBlurPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/cardblur/CardBlurPlaybackControlsFragment.kt @@ -15,6 +15,7 @@ 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.hide +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -110,11 +111,17 @@ class CardBlurPlaybackControlsFragment : AbsPlayerControlsFragment() { updateSong() } + override fun onPlayingMetaChanged() { + super.onPlayingMetaChanged() + updateSong() + } + private fun updateSong() { if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(MusicPlayerRemote.currentSong) + songInfo.text = getSongInfo(MusicPlayerRemote.currentSong) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/circle/CirclePlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/circle/CirclePlayerFragment.kt index f53f9498..39a55edc 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/circle/CirclePlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/circle/CirclePlayerFragment.kt @@ -32,6 +32,7 @@ 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.extensions.hide +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote @@ -197,9 +198,10 @@ class CirclePlayerFragment : AbsPlayerFragment(), Callback, OnAudioVolumeChanged text.text = song.artistName if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt index 86a17969..d4b46285 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorPlaybackControlsFragment.kt @@ -14,6 +14,7 @@ import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -73,9 +74,10 @@ class ColorPlaybackControlsFragment : AbsPlayerControlsFragment() { text.text = song.artistName if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitPlaybackControlsFragment.kt index 63edd157..6a3f9e6f 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitPlaybackControlsFragment.kt @@ -18,6 +18,7 @@ import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide import code.name.monkey.retromusic.extensions.ripAlpha +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -80,9 +81,10 @@ class FitPlaybackControlsFragment : AbsPlayerControlsFragment() { title.text = song.title text.text = song.artistName if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlaybackControlsFragment.kt index 3db06f45..4780e6b1 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlaybackControlsFragment.kt @@ -17,6 +17,7 @@ import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide import code.name.monkey.retromusic.extensions.ripAlpha +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -179,14 +180,14 @@ class FlatPlaybackControlsFragment : AbsPlayerControlsFragment(), Callback { } private fun updateSong() { - //TransitionManager.beginDelayedTransition(viewGroup, new ChangeText().setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN)); val song = MusicPlayerRemote.currentSong title.text = song.title text.text = song.artistName if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlaybackControlsFragment.kt index fc2ef704..49d92967 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlaybackControlsFragment.kt @@ -23,6 +23,7 @@ import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide import code.name.monkey.retromusic.extensions.ripAlpha +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -158,9 +159,10 @@ class FullPlaybackControlsFragment : AbsPlayerControlsFragment(), PopupMenu.OnMe text.text = song.artistName updateIsFavorite() if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlayerFragment.kt index 3dc83e2d..e8bab308 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/full/FullPlayerFragment.kt @@ -194,7 +194,7 @@ class FullPlayerFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Ca override fun onColorChanged(color: Int) { lastColor = color fullPlaybackControlsFragment.setDark(color) - callbacks!!.onPaletteColorChanged() + callbacks?.onPaletteColorChanged() ToolbarContentTintHelper.colorizeToolbar(playerToolbar, Color.WHITE, activity) } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt index 6dfc208d..2a7008de 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt @@ -15,6 +15,7 @@ import code.name.monkey.appthemehelper.util.MaterialValueHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide import code.name.monkey.retromusic.extensions.ripAlpha +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -70,9 +71,10 @@ class MaterialControlsFragment : AbsPlayerControlsFragment() { text.text = song.artistName if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerPlaybackControlsFragment.kt index 49653e2f..e98736d2 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerPlaybackControlsFragment.kt @@ -19,6 +19,7 @@ import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide import code.name.monkey.retromusic.extensions.ripAlpha +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -113,9 +114,10 @@ class PlayerPlaybackControlsFragment : AbsPlayerControlsFragment(), OnSharedPref text.text = song.artistName if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/peak/PeakPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/peak/PeakPlayerFragment.kt index 497603d1..6b454ebb 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/peak/PeakPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/peak/PeakPlayerFragment.kt @@ -23,6 +23,7 @@ import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.glide.RetroMusicColoredTarget import code.name.monkey.retromusic.glide.SongGlideRequest @@ -111,10 +112,12 @@ class PeakPlayerFragment : AbsPlayerFragment() { val song = MusicPlayerRemote.currentSong title.text = song.title text.text = song.artistName + if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } SongGlideRequest.Builder.from(Glide.with(requireActivity()), MusicPlayerRemote.currentSong) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/plain/PlainPlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/plain/PlainPlaybackControlsFragment.kt index 1d27251e..9d279e90 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/plain/PlainPlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/plain/PlainPlaybackControlsFragment.kt @@ -18,6 +18,7 @@ import code.name.monkey.appthemehelper.util.TintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide import code.name.monkey.retromusic.extensions.ripAlpha +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -73,9 +74,10 @@ class PlainPlaybackControlsFragment : AbsPlayerControlsFragment() { private fun updateSong() { if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(MusicPlayerRemote.currentSong) + songInfo.text = getSongInfo(MusicPlayerRemote.currentSong) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/simple/SimplePlaybackControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/simple/SimplePlaybackControlsFragment.kt index 5f9a03d3..1d2da9ba 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/simple/SimplePlaybackControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/simple/SimplePlaybackControlsFragment.kt @@ -13,6 +13,7 @@ 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.hide +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.base.AbsPlayerControlsFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.helper.MusicProgressViewUpdateHelper @@ -150,10 +151,12 @@ class SimplePlaybackControlsFragment : AbsPlayerControlsFragment() { val song = MusicPlayerRemote.currentSong title.text = song.title text.text = song.artistName + if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt index 9b50716a..e6918903 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt @@ -14,6 +14,7 @@ import code.name.monkey.appthemehelper.util.MaterialValueHelper import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide +import code.name.monkey.retromusic.extensions.show import code.name.monkey.retromusic.fragments.MiniPlayerFragment import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment @@ -135,9 +136,10 @@ class TinyPlayerFragment : AbsPlayerFragment(), MusicProgressViewUpdateHelper.Ca text.text = String.format("%s \nby - %s", song.albumName, song.artistName) if (PreferenceUtil.getInstance(requireContext()).isSongInfo) { - songInfo?.text = getSongInfo(song) + songInfo.text = getSongInfo(song) + songInfo.show() } else { - songInfo?.hide() + songInfo.hide() } } diff --git a/app/src/main/java/code/name/monkey/retromusic/helper/SortOrder.kt b/app/src/main/java/code/name/monkey/retromusic/helper/SortOrder.kt index d9bac554..0d5eb6f1 100644 --- a/app/src/main/java/code/name/monkey/retromusic/helper/SortOrder.kt +++ b/app/src/main/java/code/name/monkey/retromusic/helper/SortOrder.kt @@ -92,7 +92,7 @@ class SortOrder { const val SONG_DATE = MediaStore.Audio.Media.DATE_ADDED + " DESC" /* Song sort modified date */ - const val SONG_MODIFIED = MediaStore.Audio.Media.DATE_MODIFIED + " DESC" + const val SONG_DATE_MODIFIED = MediaStore.Audio.Media.DATE_MODIFIED + " DESC" /* Song sort order composer*/ const val COMPOSER = MediaStore.Audio.Media.COMPOSER diff --git a/app/src/main/res/drawable/ic_dashboard_white_24dp.xml b/app/src/main/res/drawable/ic_dashboard_white_24dp.xml new file mode 100644 index 00000000..73dd664e --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_white_24dp.xml @@ -0,0 +1,19 @@ + + + + + diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index d497d5c4..bca1db46 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -22,7 +22,7 @@ android:id="@+id/action_grid_size" android:icon="@drawable/ic_grid_size_white_24dp" android:title="@string/action_grid_size" - app:showAsAction="never"> + app:showAsAction="ifRoom"> + app:showAsAction="ifRoom"> + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dc28a8a5..ced5ef65 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -727,6 +727,7 @@ Artist Composer Date + Date modified Year Descending