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

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

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

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

35
                 title.value = data.substring(hyphenPos + 3)
35
                 title.value = data.substring(hyphenPos + 3)
36
         } catch (e: Exception) {
36
         } catch (e: Exception) {
37
             if (artist.value != "")
37
             if (artist.value != "")
38
-                artist.value = ""
38
+                artist.postValue("")
39
             if (title.value != data)
39
             if (title.value != data)
40
-                title.value = data
40
+                title.postValue(data)
41
         }
41
         }
42
     }
42
     }
43
 
43