Browse Source

fixed the_stream_is_down not playing (IMPORTANT). Shrink release APK.

yattoz 4 years ago
parent
commit
d1781b908d

+ 2 - 6
app/build.gradle View File

@@ -36,7 +36,8 @@ android {
36 36
     }
37 37
     buildTypes {
38 38
         release {
39
-            minifyEnabled false
39
+            minifyEnabled true
40
+            shrinkResources true
40 41
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
41 42
         }
42 43
     }
@@ -65,7 +66,6 @@ dependencies {
65 66
 
66 67
     implementation "androidx.media:media:1.1.0"
67 68
     implementation 'com.google.android.exoplayer:exoplayer:2.11.0'
68
-    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
69 69
     implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
70 70
     implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
71 71
 
@@ -78,10 +78,6 @@ dependencies {
78 78
     // RSS parser library @ https://github.com/prof18/RSS-Parser
79 79
     implementation 'com.prof.rssparser:rssparser:2.0.4'
80 80
 
81
-    def work_version = "2.2.0"
82
-    implementation "androidx.work:work-runtime-ktx:$work_version"
83
-
84
-
85 81
     // new implems
86 82
     implementation deps.kotlin.stdlib
87 83
     implementation deps.support.app_compat

+ 5 - 1
app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt View File

@@ -433,6 +433,7 @@ class RadioService : MediaBrowserServiceCompat() {
433 433
             {
434 434
                 Thread.sleep(1000)
435 435
                 i++
436
+                Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped")
436 437
             }
437 438
         }
438 439
         val post: (Any?) -> Unit = {
@@ -516,9 +517,12 @@ class RadioService : MediaBrowserServiceCompat() {
516 517
     // stop playing but keep the notification.
517 518
     fun stopPlaying()
518 519
     {
519
-        isAlarmStopped = true
520 520
         if (mediaSession.controller.playbackState.state == PlaybackStateCompat.STATE_STOPPED)
521 521
             return // nothing to do here
522
+
523
+        if (PlayerStore.instance.playbackState.value == PlaybackStateCompat.STATE_PLAYING)
524
+            isAlarmStopped = true
525
+
522 526
         PlayerStore.instance.playbackState.value = PlaybackStateCompat.STATE_STOPPED
523 527
 
524 528
         // STOP THE PLAYBACK

+ 2 - 2
app/src/main/java/fr/forum_thalie/tsumugi/playerstore/Song.kt View File

@@ -35,9 +35,9 @@ class Song(artistTitle: String = "", _id : Int = 0) {
35 35
                 title.value = data.substring(hyphenPos + 3)
36 36
         } catch (e: Exception) {
37 37
             if (artist.value != "")
38
-                artist.value = ""
38
+                artist.postValue("")
39 39
             if (title.value != data)
40
-                title.value = data
40
+                title.postValue(data)
41 41
         }
42 42
     }
43 43