diff --git a/app/build.gradle b/app/build.gradle index dc6ada4..9a7267f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -36,7 +36,8 @@ android { } buildTypes { release { - minifyEnabled false + minifyEnabled true + shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } @@ -65,7 +66,6 @@ dependencies { implementation "androidx.media:media:1.1.0" implementation 'com.google.android.exoplayer:exoplayer:2.11.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0' @@ -78,10 +78,6 @@ dependencies { // RSS parser library @ https://github.com/prof18/RSS-Parser implementation 'com.prof.rssparser:rssparser:2.0.4' - def work_version = "2.2.0" - implementation "androidx.work:work-runtime-ktx:$work_version" - - // new implems implementation deps.kotlin.stdlib implementation deps.support.app_compat diff --git a/app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt b/app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt index 9eb1cff..78e6bb8 100644 --- a/app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt +++ b/app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt @@ -433,6 +433,7 @@ class RadioService : MediaBrowserServiceCompat() { { Thread.sleep(1000) i++ + Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped") } } val post: (Any?) -> Unit = { @@ -516,9 +517,12 @@ class RadioService : MediaBrowserServiceCompat() { // stop playing but keep the notification. fun stopPlaying() { - isAlarmStopped = true if (mediaSession.controller.playbackState.state == PlaybackStateCompat.STATE_STOPPED) return // nothing to do here + + if (PlayerStore.instance.playbackState.value == PlaybackStateCompat.STATE_PLAYING) + isAlarmStopped = true + PlayerStore.instance.playbackState.value = PlaybackStateCompat.STATE_STOPPED // STOP THE PLAYBACK diff --git a/app/src/main/java/fr/forum_thalie/tsumugi/playerstore/Song.kt b/app/src/main/java/fr/forum_thalie/tsumugi/playerstore/Song.kt index 1dcfe4b..0511154 100644 --- a/app/src/main/java/fr/forum_thalie/tsumugi/playerstore/Song.kt +++ b/app/src/main/java/fr/forum_thalie/tsumugi/playerstore/Song.kt @@ -35,9 +35,9 @@ class Song(artistTitle: String = "", _id : Int = 0) { title.value = data.substring(hyphenPos + 3) } catch (e: Exception) { if (artist.value != "") - artist.value = "" + artist.postValue("") if (title.value != data) - title.value = data + title.postValue(data) } }