diff --git a/app/build.gradle b/app/build.gradle
index 3a24669..0acdf31 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -17,7 +17,7 @@ configurations.all {
android {
compileSdkVersion 30
- buildToolsVersion "30.0.0"
+ buildToolsVersion "30.0.1"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
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 ccbb25a..d89e00e 100644
--- a/app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt
+++ b/app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt
@@ -499,6 +499,7 @@ class RadioService : MediaBrowserServiceCompat() {
.setUsage(C.USAGE_ALARM)
.build()
} else {
+ isAlarmStopped = true // if we're not ringing and it tries playing, it means the user opened the app somehow
audioAttributes.setUsage(AudioAttributesCompat.USAGE_MEDIA)
audioFocusRequestBuilder.setAudioAttributes(audioAttributes.build())
audioFocusRequest = audioFocusRequestBuilder.build()
@@ -514,11 +515,6 @@ class RadioService : MediaBrowserServiceCompat() {
return
}
- // TODO: Remove this
- if (mediaSession.controller.playbackState.state == PlaybackStateCompat.STATE_PLAYING && !isRinging && isAlarmStopped)
- return // nothing to do here
- isAlarmStopped = true
-
PlayerStore.instance.playbackState.value = PlaybackStateCompat.STATE_PLAYING
// Reinitialize media player. Otherwise the playback doesn't resume when beginPlaying. Dunno why.
@@ -534,7 +530,6 @@ class RadioService : MediaBrowserServiceCompat() {
}
// START PLAYBACK, LET'S ROCK
- player.playWhenReady = true
nowPlayingNotification.update(this, isUpdatingNotificationButton = true, isRinging = isRinging)
playbackStateBuilder.setState(
@@ -544,6 +539,8 @@ class RadioService : MediaBrowserServiceCompat() {
SystemClock.elapsedRealtime()
)
mediaSession.setPlaybackState(playbackStateBuilder.build())
+ player.playWhenReady = true
+
//[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
}
@@ -557,8 +554,8 @@ class RadioService : MediaBrowserServiceCompat() {
{
if (mediaSession.controller.playbackState.state == PlaybackStateCompat.STATE_STOPPED)
return // nothing to do here
-
- isAlarmStopped = true
+ if (PlayerStore.instance.playbackState.value == PlaybackStateCompat.STATE_PLAYING)
+ isAlarmStopped = true
PlayerStore.instance.playbackState.value = PlaybackStateCompat.STATE_STOPPED
diff --git a/app/src/main/res/drawable/none.xml b/app/src/main/res/drawable/none.xml
new file mode 100644
index 0000000..a8b409b
--- /dev/null
+++ b/app/src/main/res/drawable/none.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index fcdcb13..96c951a 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -11,8 +11,14 @@
- @color/colorPrimaryDark
-