mirror of
https://github.com/zoriya/Opus.git
synced 2026-06-02 06:05:01 +00:00
Solving MusicPlayer stop bugs and preparing the 1.6.
This commit is contained in:
@@ -1399,5 +1399,16 @@ namespace MusicApp
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
if(MusicPlayer.instance != null && !MusicPlayer.isRunning && Preferences.instance == null && Queue.instance == null && EditMetaData.instance == null)
|
||||
{
|
||||
Intent intent = new Intent(this, typeof(MusicPlayer));
|
||||
intent.SetAction("Stop");
|
||||
StartService(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.musicapp.android" android:installLocation="preferExternal" android:versionCode="5" android:versionName="1.5">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.musicapp.android" android:installLocation="preferExternal" android:versionCode="6" android:versionName="1.6">
|
||||
<uses-sdk android:minSdkVersion="21" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
@@ -692,6 +692,10 @@ namespace MusicApp.Resources.Portable_Class
|
||||
tmpDefaultIntent.SetAction("Player");
|
||||
PendingIntent defaultIntent = PendingIntent.GetActivity(Application.Context, 0, tmpDefaultIntent, PendingIntentFlags.UpdateCurrent);
|
||||
|
||||
Intent tmpDeleteIntent = new Intent(Application.Context, typeof(MusicPlayer));
|
||||
tmpDeleteIntent.SetAction("Stop");
|
||||
PendingIntent deleteIntent = PendingIntent.GetActivity(Application.Context, 0, tmpDeleteIntent, PendingIntentFlags.UpdateCurrent);
|
||||
|
||||
notification = new NotificationCompat.Builder(Application.Context, "MusicApp.Channel")
|
||||
.SetVisibility(NotificationCompat.VisibilityPublic)
|
||||
.SetSmallIcon(Resource.Drawable.MusicIcon)
|
||||
@@ -705,6 +709,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
.SetShowCancelButton(true)
|
||||
.SetMediaSession(mediaSession.SessionToken))
|
||||
.SetColor(ContextCompat.GetColor(Application.Context, Resource.Color.notification_icon_bg_color))
|
||||
.SetDeleteIntent(deleteIntent)
|
||||
.SetContentTitle(title)
|
||||
.SetContentText(artist)
|
||||
.SetLargeIcon(icon)
|
||||
@@ -773,7 +778,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
isRunning = false;
|
||||
title = null;
|
||||
queue.Clear();
|
||||
//queue.Clear();
|
||||
parsing = false;
|
||||
currentID = -1;
|
||||
progress = 0;
|
||||
@@ -787,6 +792,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
player = null;
|
||||
StopForeground(true);
|
||||
}
|
||||
StopSelf();
|
||||
}
|
||||
|
||||
private void SleepPause()
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
android:summary="Comming soon" />
|
||||
<Preference
|
||||
android:title="Version :"
|
||||
android:summary="V. 1.5" />
|
||||
android:summary="V. 1.6" />
|
||||
<AccountPreference
|
||||
android:key="account"
|
||||
android:icon="@drawable/ic_account_circle_black_24dp"
|
||||
|
||||
Reference in New Issue
Block a user