diff --git a/app/build.gradle b/app/build.gradle index 8702d698..f8d653c4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,7 +13,7 @@ android { vectorDrawables.useSupportLibrary = true applicationId "code.name.monkey.retromusic" - versionCode 355 + versionCode 357 versionName '3.3.200' multiDexEnabled true diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index 3cc479cf..7d5e7167 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -

v.3.3.100

v3.3.000

v3.2.240

v3.2.220

v3.2.203

v3.2.135

v3.2.125

v3.2.120

v3.2.105

v3.2.100

v3.2.000

v3.1.900

v3.1.850

v3.1.800

v3.1.700

v3.1.400

v3.1.300

v3.1.240

v3.1.200

v3.0.570

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.3.200

v.3.3.100

v3.3.000

v3.2.240

v3.2.220

v3.2.203

v3.2.135

v3.2.125

v3.2.120

v3.2.105

v3.2.100

v3.2.000

v3.1.900

v3.1.850

v3.1.800

v3.1.700

v3.1.400

v3.1.300

v3.1.240

v3.1.200

v3.0.570

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/fragments/MiniPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/MiniPlayerFragment.kt index fcd30d98..af98f3f2 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/MiniPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/MiniPlayerFragment.kt @@ -53,7 +53,7 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda setUpMiniPlayer() miniPlayerImage.setOnClickListener { - toggleFavorite(MusicPlayerRemote.currentSong) + //toggleFavorite(MusicPlayerRemote.currentSong) } if (RetroUtil.isTablet()) { @@ -100,12 +100,12 @@ open class MiniPlayerFragment : AbsMusicServiceFragment(), MusicProgressViewUpda override fun onServiceConnected() { updateSongTitle() updatePlayPauseDrawableState() - updateIsFavorite() + //updateIsFavorite() } override fun onPlayingMetaChanged() { updateSongTitle() - updateIsFavorite() + //updateIsFavorite() } override fun onPlayStateChanged() { diff --git a/app/src/main/java/code/name/monkey/retromusic/service/MediaStoreObserver.java b/app/src/main/java/code/name/monkey/retromusic/service/MediaStoreObserver.kt similarity index 56% rename from app/src/main/java/code/name/monkey/retromusic/service/MediaStoreObserver.java rename to app/src/main/java/code/name/monkey/retromusic/service/MediaStoreObserver.kt index 14c9780f..131154ef 100644 --- a/app/src/main/java/code/name/monkey/retromusic/service/MediaStoreObserver.java +++ b/app/src/main/java/code/name/monkey/retromusic/service/MediaStoreObserver.kt @@ -12,36 +12,32 @@ * See the GNU General Public License for more details. */ -package code.name.monkey.retromusic.service; +package code.name.monkey.retromusic.service -import android.database.ContentObserver; -import android.os.Handler; +import android.database.ContentObserver +import android.os.Handler -public class MediaStoreObserver extends ContentObserver implements Runnable { - // milliseconds to delay before calling refresh to aggregate events - private static final long REFRESH_DELAY = 500; - private final MusicService musicService; - private Handler mHandler; +class MediaStoreObserver( + private val musicService: MusicService, + private val mHandler: Handler +) : ContentObserver(mHandler), Runnable { - MediaStoreObserver(MusicService musicService, Handler handler) { - super(handler); - this.musicService = musicService; - mHandler = handler; - } - - @Override - public void onChange(boolean selfChange) { + override fun onChange(selfChange: Boolean) { // if a change is detected, remove any scheduled callback // then post a new one. This is intended to prevent closely // spaced events from generating multiple refresh calls - mHandler.removeCallbacks(this); - mHandler.postDelayed(this, REFRESH_DELAY); + mHandler.removeCallbacks(this) + mHandler.postDelayed(this, REFRESH_DELAY) } - @Override - public void run() { + override fun run() { // actually call refresh when the delayed callback fires // do not send a sticky broadcast here - musicService.handleAndSendChangeInternal(MusicService.MEDIA_STORE_CHANGED); + musicService.handleAndSendChangeInternal(MusicService.MEDIA_STORE_CHANGED) + } + + companion object { + // milliseconds to delay before calling refresh to aggregate events + private val REFRESH_DELAY: Long = 500 } } \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java b/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java index 01bffe2d..f7d55e52 100644 --- a/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java +++ b/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java @@ -1088,6 +1088,7 @@ public class MusicService extends MediaBrowserServiceCompat implements SharedPre try { int newPosition = playback.seek(millis); throttledSeekHandler.notifySeek(); + updateMediaSessionPlaybackState(); return newPosition; } catch (Exception e) { return -1; diff --git a/app/src/main/java/code/name/monkey/retromusic/service/QueueSaveHandler.java b/app/src/main/java/code/name/monkey/retromusic/service/QueueSaveHandler.java deleted file mode 100644 index 0d60ca2e..00000000 --- a/app/src/main/java/code/name/monkey/retromusic/service/QueueSaveHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -package code.name.monkey.retromusic.service; - -import android.os.Handler; -import android.os.Looper; -import android.os.Message; - -import androidx.annotation.NonNull; - -import java.lang.ref.WeakReference; - -import static code.name.monkey.retromusic.service.MusicService.SAVE_QUEUES; - -class QueueSaveHandler extends Handler { - @NonNull - private final WeakReference mService; - - QueueSaveHandler(final MusicService service, @NonNull final Looper looper) { - super(looper); - mService = new WeakReference<>(service); - } - - @Override - public void handleMessage(@NonNull Message msg) { - final MusicService service = mService.get(); - if (msg.what == SAVE_QUEUES) { - service.saveQueuesImpl(); - } - } -} diff --git a/app/src/main/java/code/name/monkey/retromusic/service/QueueSaveHandler.kt b/app/src/main/java/code/name/monkey/retromusic/service/QueueSaveHandler.kt new file mode 100644 index 00000000..44f3eb84 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/service/QueueSaveHandler.kt @@ -0,0 +1,35 @@ +/* + * 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. + */ + +package code.name.monkey.retromusic.service + +import android.os.Handler +import android.os.Looper +import android.os.Message +import code.name.monkey.retromusic.service.MusicService.SAVE_QUEUES +import java.lang.ref.WeakReference + +internal class QueueSaveHandler( + musicService: MusicService, + looper: Looper +) : Handler(looper) { + private val service: WeakReference = WeakReference(musicService) + + override fun handleMessage(msg: Message) { + val service: MusicService? = service.get() + if (msg.what == SAVE_QUEUES) { + service?.saveQueuesImpl() + } + } +} diff --git a/app/src/main/java/code/name/monkey/retromusic/service/SongPlayCountHelper.java b/app/src/main/java/code/name/monkey/retromusic/service/SongPlayCountHelper.java deleted file mode 100644 index 463396fb..00000000 --- a/app/src/main/java/code/name/monkey/retromusic/service/SongPlayCountHelper.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ - -package code.name.monkey.retromusic.service; - -import code.name.monkey.retromusic.helper.StopWatch; -import code.name.monkey.retromusic.model.Song; - -public class SongPlayCountHelper { - public static final String TAG = SongPlayCountHelper.class.getSimpleName(); - - private StopWatch stopWatch = new StopWatch(); - private Song song = Song.getEmptySong(); - - public Song getSong() { - return song; - } - - boolean shouldBumpPlayCount() { - return song.getDuration() * 0.5d < stopWatch.getElapsedTime(); - } - - void notifySongChanged(Song song) { - synchronized (this) { - stopWatch.reset(); - this.song = song; - } - } - - void notifyPlayStateChanged(boolean isPlaying) { - synchronized (this) { - if (isPlaying) { - stopWatch.start(); - } else { - stopWatch.pause(); - } - } - } -} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/service/SongPlayCountHelper.kt b/app/src/main/java/code/name/monkey/retromusic/service/SongPlayCountHelper.kt new file mode 100644 index 00000000..612b166a --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/service/SongPlayCountHelper.kt @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package code.name.monkey.retromusic.service + +import code.name.monkey.retromusic.helper.StopWatch +import code.name.monkey.retromusic.model.Song + +class SongPlayCountHelper { + + private val stopWatch = StopWatch() + var song = Song.emptySong + private set + + fun shouldBumpPlayCount(): Boolean { + return song.duration * 0.5 < stopWatch.elapsedTime + } + + fun notifySongChanged(song: Song) { + synchronized(this) { + stopWatch.reset() + this.song = song + } + } + + fun notifyPlayStateChanged(isPlaying: Boolean) { + synchronized(this) { + if (isPlaying) { + stopWatch.start() + } else { + stopWatch.pause() + } + } + } + + companion object { + val TAG: String = SongPlayCountHelper::class.java.simpleName + } +} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/service/ThrottledSeekHandler.java b/app/src/main/java/code/name/monkey/retromusic/service/ThrottledSeekHandler.java deleted file mode 100644 index 20f075e7..00000000 --- a/app/src/main/java/code/name/monkey/retromusic/service/ThrottledSeekHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -package code.name.monkey.retromusic.service; - - -import android.os.Handler; - -import static code.name.monkey.retromusic.service.MusicService.PLAY_STATE_CHANGED; - -public class ThrottledSeekHandler implements Runnable { - // milliseconds to throttle before calling run() to aggregate events - private static final long THROTTLE = 500; - private final MusicService musicService; - private Handler handler; - - ThrottledSeekHandler(MusicService musicService, Handler handler) { - this.musicService = musicService; - this.handler = handler; - } - - void notifySeek() { - handler.removeCallbacks(this); - handler.postDelayed(this, THROTTLE); - } - - @Override - public void run() { - musicService.savePositionInTrack(); - musicService.sendPublicIntent(PLAY_STATE_CHANGED); // for musixmatch synced lyrics - } -} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/service/ThrottledSeekHandler.kt b/app/src/main/java/code/name/monkey/retromusic/service/ThrottledSeekHandler.kt new file mode 100644 index 00000000..1d971104 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/service/ThrottledSeekHandler.kt @@ -0,0 +1,41 @@ +/* + * 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. + */ + +package code.name.monkey.retromusic.service + + +import android.os.Handler + +import code.name.monkey.retromusic.service.MusicService.PLAY_STATE_CHANGED + +class ThrottledSeekHandler( + private val musicService: MusicService, + private val handler: Handler +) : Runnable { + + fun notifySeek() { + handler.removeCallbacks(this) + handler.postDelayed(this, THROTTLE) + } + + override fun run() { + musicService.savePositionInTrack() + musicService.sendPublicIntent(PLAY_STATE_CHANGED) // for musixmatch synced lyrics + } + + companion object { + // milliseconds to throttle before calling run() to aggregate events + private val THROTTLE: Long = 500 + } +} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/service/playback/Playback.java b/app/src/main/java/code/name/monkey/retromusic/service/playback/Playback.kt similarity index 50% rename from app/src/main/java/code/name/monkey/retromusic/service/playback/Playback.java rename to app/src/main/java/code/name/monkey/retromusic/service/playback/Playback.kt index 6fc4c449..7925bef9 100644 --- a/app/src/main/java/code/name/monkey/retromusic/service/playback/Playback.java +++ b/app/src/main/java/code/name/monkey/retromusic/service/playback/Playback.kt @@ -12,46 +12,44 @@ * See the GNU General Public License for more details. */ -package code.name.monkey.retromusic.service.playback; - -import androidx.annotation.Nullable; +package code.name.monkey.retromusic.service.playback -public interface Playback { +interface Playback { - boolean setDataSource(String path); + val isInitialized: Boolean - void setNextDataSource(@Nullable String path); + val isPlaying: Boolean - void setCallbacks(PlaybackCallbacks callbacks); + val audioSessionId: Int - boolean isInitialized(); + fun setDataSource(path: String): Boolean - boolean start(); + fun setNextDataSource(path: String?) - void stop(); + fun setCallbacks(callbacks: PlaybackCallbacks) - void release(); + fun start(): Boolean - boolean pause(); + fun stop() - boolean isPlaying(); + fun release() - int duration(); + fun pause(): Boolean - int position(); + fun duration(): Int - int seek(int whereto); + fun position(): Int - boolean setVolume(float vol); + fun seek(whereto: Int): Int - boolean setAudioSessionId(int sessionId); + fun setVolume(vol: Float): Boolean - int getAudioSessionId(); + fun setAudioSessionId(sessionId: Int): Boolean interface PlaybackCallbacks { - void onTrackWentToNext(); + fun onTrackWentToNext() - void onTrackEnded(); + fun onTrackEnded() } }