mirror of
https://github.com/zoriya/Opus.git
synced 2025-12-06 06:26:15 +00:00
Removing the undo snackbar of the remove song from playlist.
This commit is contained in:
@@ -569,20 +569,22 @@ namespace Opus.Api
|
||||
{
|
||||
if (song.TrackID == null)
|
||||
song = await CompleteItem(song, item.YoutubeID);
|
||||
|
||||
RemoveFromYoutubePlaylist(song.TrackID);
|
||||
}
|
||||
|
||||
RemovedCallback?.Invoke();
|
||||
|
||||
RemoveTrackFromPlaylistCallback callback = new RemoveTrackFromPlaylistCallback(song, item.LocalID, position);
|
||||
Snackbar snackBar = Snackbar.Make(MainActivity.instance.FindViewById(Resource.Id.snackBar), (song.Title.Length > 20 ? song.Title.Substring(0, 17) + "..." : song.Title) + MainActivity.instance.GetString(Resource.String.removed_from_playlist), Snackbar.LengthLong)
|
||||
.SetAction(MainActivity.instance.GetString(Resource.String.undo), (v) =>
|
||||
{
|
||||
callback.canceled = true;
|
||||
UndoCallback?.Invoke();
|
||||
});
|
||||
snackBar.AddCallback(callback);
|
||||
snackBar.View.FindViewById<TextView>(Resource.Id.snackbar_text).SetTextColor(Color.White);
|
||||
snackBar.Show();
|
||||
//RemoveTrackFromPlaylistCallback callback = new RemoveTrackFromPlaylistCallback(song, item.LocalID, position);
|
||||
//Snackbar snackBar = Snackbar.Make(MainActivity.instance.FindViewById(Resource.Id.snackBar), (song.Title.Length > 20 ? song.Title.Substring(0, 17) + "..." : song.Title) + MainActivity.instance.GetString(Resource.String.removed_from_playlist), Snackbar.LengthLong)
|
||||
// .SetAction(MainActivity.instance.GetString(Resource.String.undo), (v) =>
|
||||
// {
|
||||
// callback.canceled = true;
|
||||
// UndoCallback?.Invoke();
|
||||
// });
|
||||
//snackBar.AddCallback(callback);
|
||||
//snackBar.View.FindViewById<TextView>(Resource.Id.snackbar_text).SetTextColor(Color.White);
|
||||
//snackBar.Show();
|
||||
})
|
||||
.SetNegativeButton(Resource.String.no, (sender, e) => { CancelledCallback?.Invoke(); })
|
||||
.Create();
|
||||
@@ -1317,7 +1319,8 @@ namespace Opus.Api
|
||||
ContentValues value = new ContentValues();
|
||||
value.Put(Playlists.Members.AudioId, item.LocalID);
|
||||
value.Put(Playlists.Members.PlayOrder, position);
|
||||
resolver.Insert(Playlists.Members.GetContentUri("external", LocalID), value);
|
||||
var info = resolver.Insert(Playlists.Members.GetContentUri("external", LocalID), value);
|
||||
Console.WriteLine("&Add info: " + info + " - item localID: " + item.LocalID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,8 @@ namespace Opus.Others
|
||||
|
||||
public override void OnDismissed(Java.Lang.Object transientBottomBar, int @event)
|
||||
{
|
||||
base.OnDismissed(transientBottomBar, @event);
|
||||
if(canceled)
|
||||
{
|
||||
MainActivity.instance.SupportFragmentManager.PopBackStack();
|
||||
if (LocalPlaylistID != 0)
|
||||
PlaylistManager.InsertToLocalPlaylist(LocalPlaylistID, song, position);
|
||||
}
|
||||
@@ -32,6 +30,7 @@ namespace Opus.Others
|
||||
if (song.TrackID != null)
|
||||
PlaylistManager.RemoveFromYoutubePlaylist(song.TrackID);
|
||||
}
|
||||
base.OnDismissed(transientBottomBar, @event);
|
||||
}
|
||||
|
||||
public override void OnShown(Java.Lang.Object transientBottomBar)
|
||||
|
||||
Reference in New Issue
Block a user