mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
Quit service when bottom_sheet_header is dragged down
This commit is contained in:
parent
12b23ab3c2
commit
5e6d28ece3
3 changed files with 11 additions and 0 deletions
|
|
@ -142,6 +142,12 @@ public class MusicPlayerRemote {
|
||||||
return musicService != null && musicService.isLoading();
|
return musicService != null && musicService.isLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void quitPlaying() {
|
||||||
|
if (musicService != null) {
|
||||||
|
musicService.quitPlaying();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void resumePlaying() {
|
public static void resumePlaying() {
|
||||||
if (musicService != null) {
|
if (musicService != null) {
|
||||||
musicService.play();
|
musicService.play();
|
||||||
|
|
|
||||||
|
|
@ -398,6 +398,10 @@ public class MusicService extends Service implements Playback.PlaybackCallbacks
|
||||||
return playback != null && playback.isLoading();
|
return playback != null && playback.isLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void quitPlaying() {
|
||||||
|
quit();
|
||||||
|
}
|
||||||
|
|
||||||
public int getPosition() {
|
public int getPosition() {
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@ public class MainActivity extends BaseActivity {
|
||||||
break;
|
break;
|
||||||
case BottomSheetBehavior.STATE_HIDDEN:
|
case BottomSheetBehavior.STATE_HIDDEN:
|
||||||
MusicPlayerRemote.pauseSong();
|
MusicPlayerRemote.pauseSong();
|
||||||
|
MusicPlayerRemote.quitPlaying();
|
||||||
mainViewModel.deleteQueue();
|
mainViewModel.deleteQueue();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue