mirror of
https://github.com/zoriya/Opus.git
synced 2026-06-05 23:31:52 +00:00
Making a playlist header
This commit is contained in:
@@ -611,6 +611,15 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\darkRectangle.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\menu\playlist_header_more.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\menu\ytplaylist_header_more.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\menu\ytplaylistnowrite_header_more.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets')" />
|
||||
<Import Project="..\packages\Xamarin.Android.Support.v7.Preference.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.Preference.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.Preference.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.Preference.targets')" />
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
MainActivity.instance.HideTabs();
|
||||
MainActivity.instance.HomeDetails = true;
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, PlaylistTracks.NewInstance(section.data, item.GetName(), false), true);
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, PlaylistTracks.NewInstance(section.data, item.GetName(), false, item.GetArtist(), -1, item.GetAlbum()), true);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -325,7 +325,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
MainActivity.instance.HideTabs();
|
||||
MainActivity.instance.HomeDetails = true;
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, PlaylistTracks.NewInstance(item.youtubeID, item.GetName(), false), true);
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, PlaylistTracks.NewInstance(item.youtubeID, item.GetName(), false, item.GetArtist(), -1, item.GetAlbum()), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
Google.Apis.YouTube.v3.Data.Playlist playlist = response.Items[i];
|
||||
YtPlaylists.Add(playlist);
|
||||
Song song = new Song(playlist.Snippet.Title, playlist.Snippet.ChannelTitle, playlist.Snippet.Thumbnails.Default__.Url, playlist.Id, -1, -1, playlist.Id, true, true);
|
||||
Song song = new Song(playlist.Snippet.Title, playlist.Snippet.ChannelTitle, playlist.Snippet.Thumbnails.High.Url, playlist.Id, -1, -1, playlist.Id, true, true, (int)playlist.ContentDetails.ItemCount);
|
||||
ytPlaylists.Add(song);
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Google.Apis.YouTube.v3.Data.Playlist playlist = plResponse.Items[0];
|
||||
playlist.Kind = "youtube#saved";
|
||||
YtPlaylists.Add(playlist);
|
||||
Song song = new Song(playlist.Snippet.Title, playlist.Snippet.ChannelTitle, playlist.Snippet.Thumbnails.Default__.Url, playlist.Id, -1, -1, playlist.Id, true, false);
|
||||
Song song = new Song(playlist.Snippet.Title, playlist.Snippet.ChannelTitle, playlist.Snippet.Thumbnails.High.Url, playlist.Id, -1, -1, playlist.Id, true, false, (int)playlist.ContentDetails.ItemCount);
|
||||
ytPlaylists.Add(song);
|
||||
forkedFound = true;
|
||||
}
|
||||
@@ -285,7 +285,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
if (local)
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, PlaylistTracks.NewInstance(playlist.GetID(), playlist.GetName()), true);
|
||||
else
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, PlaylistTracks.NewInstance(playlist.youtubeID, playlist.GetName(), playlist.isParsed), true);
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, PlaylistTracks.NewInstance(playlist.youtubeID, playlist.GetName(), playlist.isParsed, playlist.GetArtist(), playlist.queueSlot, playlist.GetAlbum()), true);
|
||||
}
|
||||
|
||||
private void ListView_ItemLongClick(object sender, int position)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Android.Content;
|
||||
using Android.Database;
|
||||
using Android.Graphics;
|
||||
using Android.Net;
|
||||
using Android.OS;
|
||||
using Android.Provider;
|
||||
@@ -8,14 +9,18 @@ using Android.Support.V4.App;
|
||||
using Android.Support.V7.App;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Google.Apis.YouTube.v3;
|
||||
using Google.Apis.YouTube.v3.Data;
|
||||
using MusicApp.Resources.values;
|
||||
using Square.Picasso;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using static Android.Provider.MediaStore.Audio;
|
||||
|
||||
namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
public class PlaylistTracks : ListFragment
|
||||
public class PlaylistTracks : ListFragment, PopupMenu.IOnMenuItemClickListener
|
||||
{
|
||||
public static PlaylistTracks instance;
|
||||
public string playlistName;
|
||||
@@ -24,6 +29,9 @@ namespace MusicApp.Resources.Portable_Class
|
||||
public List<Song> result;
|
||||
public long playlistId = 0;
|
||||
public string ytID = "";
|
||||
private string author;
|
||||
private int count;
|
||||
private Uri thumnailURI;
|
||||
private bool hasWriteAcess;
|
||||
private string nextPageToken = null;
|
||||
public bool isEmpty = false;
|
||||
@@ -46,11 +54,134 @@ namespace MusicApp.Resources.Portable_Class
|
||||
MainActivity.instance.contentRefresh.Refresh += OnRefresh;
|
||||
MainActivity.instance.OnPaddingChanged += OnPaddingChanged;
|
||||
MainActivity.instance.DisplaySearch(1);
|
||||
Activity.FindViewById<RelativeLayout>(Resource.Id.playlistHeader).Visibility = ViewStates.Visible;
|
||||
((AppBarLayout.LayoutParams)Activity.FindViewById<CollapsingToolbarLayout>(Resource.Id.collapsingToolbar).LayoutParameters).ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagScroll | AppBarLayout.LayoutParams.ScrollFlagEnterAlwaysCollapsed;
|
||||
|
||||
#pragma warning disable CS4014
|
||||
PopulateList();
|
||||
|
||||
|
||||
Activity.FindViewById<RelativeLayout>(Resource.Id.playlistHeader).Visibility = ViewStates.Visible;
|
||||
((AppBarLayout.LayoutParams)Activity.FindViewById<CollapsingToolbarLayout>(Resource.Id.collapsingToolbar).LayoutParameters).ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagScroll | AppBarLayout.LayoutParams.ScrollFlagExitUntilCollapsed;
|
||||
Activity.FindViewById<TextView>(Resource.Id.headerTitle).Text = playlistName;
|
||||
Activity.FindViewById<ImageButton>(Resource.Id.headerPlay).Click += (sender, e0) => { PlayInOrder(0); };
|
||||
Activity.FindViewById<ImageButton>(Resource.Id.headerShuffle).Click += (sender, e0) =>
|
||||
{
|
||||
if (playlistId != 0)
|
||||
Playlist.RandomPlay(playlistId, Activity);
|
||||
else
|
||||
YoutubeEngine.RandomPlay(ytID);
|
||||
};
|
||||
Activity.FindViewById<ImageButton>(Resource.Id.headerMore).Click += (sender, e0) =>
|
||||
{
|
||||
PopupMenu menu = new PopupMenu(Activity, Activity.FindViewById<ImageButton>(Resource.Id.headerMore));
|
||||
if(playlistId == 0 && hasWriteAcess)
|
||||
menu.Inflate(Resource.Menu.ytplaylist_header_more);
|
||||
else if(playlistId == 0)
|
||||
menu.Inflate(Resource.Menu.ytplaylistnowrite_header_more);
|
||||
else
|
||||
menu.Inflate(Resource.Menu.playlist_header_more)
|
||||
menu.SetOnMenuItemClickListener(this);
|
||||
menu.Show();
|
||||
};
|
||||
|
||||
|
||||
if (playlistId != 0)
|
||||
{
|
||||
Activity.FindViewById<TextView>(Resource.Id.headerAuthor).Text = MainActivity.account == null ? "by me" : "by " + MainActivity.account.DisplayName;
|
||||
}
|
||||
else if(ytID != null && ytID != "")
|
||||
{
|
||||
Activity.FindViewById<TextView>(Resource.Id.headerAuthor).Text = author;
|
||||
Activity.FindViewById<TextView>(Resource.Id.headerNumber).Text = count.ToString() + " songs";
|
||||
if(count == -1)
|
||||
Activity.FindViewById<TextView>(Resource.Id.headerNumber).Text = "NaN songs";
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(thumnailURI).Placeholder(Resource.Drawable.noAlbum).Resize(1080, 1080).CenterCrop().Into(Activity.FindViewById<ImageView>(Resource.Id.headerArt));
|
||||
}
|
||||
}
|
||||
|
||||
public bool OnMenuItemClick(IMenuItem item)
|
||||
{
|
||||
switch (item.ItemId)
|
||||
{
|
||||
case Resource.Id.download:
|
||||
YoutubeEngine.DownloadPlaylist(playlistName, ytID);
|
||||
break;
|
||||
case Resource.Id.rename:
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(Activity, MainActivity.dialogTheme);
|
||||
builder.SetTitle("Playlist name");
|
||||
View view = LayoutInflater.Inflate(Resource.Layout.CreatePlaylistDialog, null);
|
||||
builder.SetView(view);
|
||||
builder.SetNegativeButton("Cancel", (senderAlert, args) => { });
|
||||
builder.SetPositiveButton("Rename", (senderAlert, args) =>
|
||||
{
|
||||
Rename(view.FindViewById<EditText>(Resource.Id.playlistName).Text);
|
||||
});
|
||||
builder.Show();
|
||||
break;
|
||||
case Resource.Id.delete:
|
||||
Delete();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async void Rename(string newName)
|
||||
{
|
||||
if(playlistId == 0)
|
||||
{
|
||||
Google.Apis.YouTube.v3.Data.Playlist playlist = new Google.Apis.YouTube.v3.Data.Playlist
|
||||
{
|
||||
Snippet = new PlaylistSnippet()
|
||||
};
|
||||
playlist.Snippet.Title = newName;
|
||||
playlist.Id = ytID;
|
||||
|
||||
await YoutubeEngine.youtubeService.Playlists.Update(playlist, "snippet").ExecuteAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
ContentValues value = new ContentValues();
|
||||
value.Put(Playlists.InterfaceConsts.Name, newName);
|
||||
Activity.ContentResolver.Update(Playlists.ExternalContentUri, value, Playlists.InterfaceConsts.Id + "=?", new string[] { playlistId.ToString() });
|
||||
}
|
||||
|
||||
playlistName = newName;
|
||||
Activity.FindViewById<TextView>(Resource.Id.headerTitle).Text = playlistName;
|
||||
}
|
||||
|
||||
async void Delete()
|
||||
{
|
||||
if(playlistId == 0)
|
||||
{
|
||||
if (hasWriteAcess)
|
||||
{
|
||||
PlaylistsResource.DeleteRequest deleteRequest = YoutubeEngine.youtubeService.Playlists.Delete(ytID);
|
||||
await deleteRequest.ExecuteAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
ChannelSectionsResource.ListRequest forkedRequest = YoutubeEngine.youtubeService.ChannelSections.List("snippet,contentDetails");
|
||||
forkedRequest.Mine = true;
|
||||
ChannelSectionListResponse forkedResponse = await forkedRequest.ExecuteAsync();
|
||||
|
||||
foreach (ChannelSection section in forkedResponse.Items)
|
||||
{
|
||||
if (section.Snippet.Title == "Saved Playlists")
|
||||
{
|
||||
section.ContentDetails.Playlists.Remove(ytID);
|
||||
ChannelSectionsResource.UpdateRequest request = YoutubeEngine.youtubeService.ChannelSections.Update(section, "snippet,contentDetails");
|
||||
ChannelSection response = await request.ExecuteAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ContentResolver resolver = Activity.ContentResolver;
|
||||
Uri uri = Playlists.ExternalContentUri;
|
||||
resolver.Delete(Playlists.ExternalContentUri, Playlists.InterfaceConsts.Id + "=?", new string[] { playlistId.ToString() });
|
||||
}
|
||||
MainActivity.instance.SupportFragmentManager.PopBackStack();
|
||||
}
|
||||
|
||||
private void ListView_ScrollStateChanged(object sender, AbsListView.ScrollStateChangedEventArgs e)
|
||||
@@ -95,12 +226,15 @@ namespace MusicApp.Resources.Portable_Class
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static Fragment NewInstance(string ytID, string playlistName, bool hasWriteAcess)
|
||||
public static Fragment NewInstance(string ytID, string playlistName, bool hasWriteAcess, string author, int count, string thumbnailURI)
|
||||
{
|
||||
instance = new PlaylistTracks { Arguments = new Bundle() };
|
||||
instance.ytID = ytID;
|
||||
instance.hasWriteAcess = hasWriteAcess;
|
||||
instance.playlistName = playlistName;
|
||||
instance.author = author;
|
||||
instance.count = count;
|
||||
instance.thumnailURI = Uri.Parse(thumbnailURI);
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -162,6 +296,12 @@ namespace MusicApp.Resources.Portable_Class
|
||||
isEmpty = true;
|
||||
Activity.AddContentView(emptyView, View.LayoutParameters);
|
||||
}
|
||||
|
||||
Activity.FindViewById<TextView>(Resource.Id.headerNumber).Text = tracks.Count.ToString() + " songs";
|
||||
var songCover = Uri.Parse("content://media/external/audio/albumart");
|
||||
var songAlbumArtUri = ContentUris.WithAppendedId(songCover, tracks[0].GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.noAlbum).Resize(1080, 1080).CenterCrop().Into(Activity.FindViewById<ImageView>(Resource.Id.headerArt));
|
||||
}
|
||||
else if (ytID != null)
|
||||
{
|
||||
@@ -251,34 +391,9 @@ namespace MusicApp.Resources.Portable_Class
|
||||
ListAdapter = adapter;
|
||||
}
|
||||
|
||||
private async void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
|
||||
private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
|
||||
{
|
||||
List<Song> songs = tracks.GetRange(e.Position, tracks.Count - e.Position);
|
||||
if (result != null && result.Count - 1 >= e.Position)
|
||||
songs = result.GetRange(e.Position, result.Count - e.Position);
|
||||
|
||||
if (MusicPlayer.isRunning)
|
||||
MusicPlayer.queue.Clear();
|
||||
|
||||
if (!songs[0].IsYt)
|
||||
{
|
||||
Browse.act = Activity;
|
||||
Browse.Play(songs[0]);
|
||||
}
|
||||
else
|
||||
YoutubeEngine.Play(songs[0].youtubeID, songs[0].GetName(), songs[0].GetArtist(), songs[0].GetAlbum());
|
||||
|
||||
songs.RemoveAt(0);
|
||||
songs.Reverse();
|
||||
|
||||
while (MusicPlayer.instance == null)
|
||||
await Task.Delay(10);
|
||||
|
||||
foreach (Song song in songs)
|
||||
{
|
||||
MusicPlayer.instance.AddToQueue(song);
|
||||
}
|
||||
Player.instance?.UpdateNext();
|
||||
PlayInOrder(e.Position);
|
||||
}
|
||||
|
||||
private void ListView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
|
||||
@@ -309,38 +424,13 @@ namespace MusicApp.Resources.Portable_Class
|
||||
builder.SetTitle("Pick an action");
|
||||
if (hasWriteAcess && ytID != "")
|
||||
{
|
||||
builder.SetItems(action.ToArray(), async (senderAlert, args) =>
|
||||
builder.SetItems(action.ToArray(), (senderAlert, args) =>
|
||||
{
|
||||
switch (args.Which)
|
||||
{
|
||||
case 0:
|
||||
int Position = tracks.IndexOf(item);
|
||||
List<Song> songs = tracks.GetRange(Position + 1, tracks.Count - Position - 1);
|
||||
if (result != null && result.Count - 1 >= Position)
|
||||
songs = result.GetRange(Position + 1, result.Count - Position - 1);
|
||||
|
||||
if (MusicPlayer.isRunning)
|
||||
MusicPlayer.queue.Clear();
|
||||
|
||||
if (!songs[0].IsYt)
|
||||
{
|
||||
Browse.act = Activity;
|
||||
Browse.Play(songs[0]);
|
||||
}
|
||||
else
|
||||
YoutubeEngine.Play(songs[0].youtubeID, songs[0].GetName(), songs[0].GetArtist(), songs[0].GetAlbum());
|
||||
|
||||
songs.RemoveAt(0);
|
||||
songs.Reverse();
|
||||
|
||||
while (MusicPlayer.instance == null)
|
||||
await Task.Delay(10);
|
||||
|
||||
foreach (Song song in songs)
|
||||
{
|
||||
MusicPlayer.instance.AddToQueue(song);
|
||||
}
|
||||
Player.instance?.UpdateNext();
|
||||
PlayInOrder(Position);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@@ -390,38 +480,13 @@ namespace MusicApp.Resources.Portable_Class
|
||||
else
|
||||
{
|
||||
action.Remove("Remove Track from playlist");
|
||||
builder.SetItems(action.ToArray(), async (senderAlert, args) =>
|
||||
builder.SetItems(action.ToArray(), (senderAlert, args) =>
|
||||
{
|
||||
switch (args.Which)
|
||||
{
|
||||
case 0:
|
||||
int Position = tracks.IndexOf(item);
|
||||
List<Song> songs = tracks.GetRange(Position + 1, tracks.Count - Position - 1);
|
||||
if (result != null && result.Count - 1 >= Position)
|
||||
songs = result.GetRange(Position + 1, result.Count - Position - 1);
|
||||
|
||||
if (MusicPlayer.isRunning)
|
||||
MusicPlayer.queue.Clear();
|
||||
|
||||
if (!songs[0].IsYt)
|
||||
{
|
||||
Browse.act = Activity;
|
||||
Browse.Play(songs[0]);
|
||||
}
|
||||
else
|
||||
YoutubeEngine.Play(songs[0].youtubeID, songs[0].GetName(), songs[0].GetArtist(), songs[0].GetAlbum());
|
||||
|
||||
songs.RemoveAt(0);
|
||||
songs.Reverse();
|
||||
|
||||
while (MusicPlayer.instance == null)
|
||||
await Task.Delay(10);
|
||||
|
||||
foreach (Song song in songs)
|
||||
{
|
||||
MusicPlayer.instance.AddToQueue(song);
|
||||
}
|
||||
Player.instance?.UpdateNext();
|
||||
PlayInOrder(Position);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
@@ -457,6 +522,36 @@ namespace MusicApp.Resources.Portable_Class
|
||||
builder.Show();
|
||||
}
|
||||
|
||||
async void PlayInOrder(int fromPosition)
|
||||
{
|
||||
List<Song> songs = tracks.GetRange(fromPosition, tracks.Count - fromPosition);
|
||||
if (result != null && result.Count - 1 >= fromPosition)
|
||||
songs = result.GetRange(fromPosition, result.Count - fromPosition);
|
||||
|
||||
if (MusicPlayer.isRunning)
|
||||
MusicPlayer.queue.Clear();
|
||||
|
||||
if (!songs[0].IsYt)
|
||||
{
|
||||
Browse.act = Activity;
|
||||
Browse.Play(songs[0]);
|
||||
}
|
||||
else
|
||||
YoutubeEngine.Play(songs[0].youtubeID, songs[0].GetName(), songs[0].GetArtist(), songs[0].GetAlbum());
|
||||
|
||||
songs.RemoveAt(0);
|
||||
songs.Reverse();
|
||||
|
||||
while (MusicPlayer.instance == null)
|
||||
await Task.Delay(10);
|
||||
|
||||
foreach (Song song in songs)
|
||||
{
|
||||
MusicPlayer.instance.AddToQueue(song);
|
||||
}
|
||||
Player.instance?.UpdateNext();
|
||||
}
|
||||
|
||||
private void RemoveFromYtPlaylist(Song item, string ytTrackID)
|
||||
{
|
||||
tracks.Remove(item);
|
||||
|
||||
@@ -176,7 +176,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
public void SignedIn()
|
||||
{
|
||||
System.Console.WriteLine("&Preference sign in callback");
|
||||
AccountPreference accountPreference = (AccountPreference)PreferenceScreen.FindPreference("account");
|
||||
accountPreference.Title = "Logged in as:";
|
||||
accountPreference.Summary = MainActivity.account.DisplayName;
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
await MainActivity.instance.WaitForYoutube();
|
||||
|
||||
SearchResource.ListRequest searchResult = youtubeService.Search.List("snippet");
|
||||
searchResult.Fields = "items(id/videoId,id/playlistId,id/kind,snippet/title,snippet/thumbnails/default/url,snippet/channelTitle)";
|
||||
searchResult.Fields = "items(id/videoId,id/playlistId,id/kind,snippet/title,snippet/thumbnails/high/url,snippet/channelTitle)";
|
||||
searchResult.Q = search.Replace(" ", "+-");
|
||||
searchResult.Type = "video";
|
||||
switch (querryType)
|
||||
@@ -166,7 +166,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
foreach (var video in searchReponse.Items)
|
||||
{
|
||||
Song videoInfo = new Song(video.Snippet.Title, video.Snippet.ChannelTitle, video.Snippet.Thumbnails.Default__.Url, video.Id.VideoId ?? video.Id.PlaylistId, -1, -1, video.Id.VideoId ?? video.Id.PlaylistId, true);
|
||||
Song videoInfo = new Song(video.Snippet.Title, video.Snippet.ChannelTitle, video.Snippet.Thumbnails.High.Url, video.Id.VideoId ?? video.Id.PlaylistId, -1, -1, video.Id.VideoId ?? video.Id.PlaylistId, true);
|
||||
YtKind kind = YtKind.Null;
|
||||
|
||||
switch (video.Id.Kind)
|
||||
@@ -256,7 +256,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
instances = null;
|
||||
MainActivity.youtubeParcel = ListView.GetLayoutManager().OnSaveInstanceState();
|
||||
MainActivity.youtubeInstanceSave = "YoutubeEngine" + "-" + querryType;
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, PlaylistTracks.NewInstance(item.youtubeID, item.GetName(), false), true);
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, PlaylistTracks.NewInstance(item.youtubeID, item.GetName(), false, item.GetArtist(), -1, item.GetAlbum()), true);
|
||||
break;
|
||||
case YtKind.Channel:
|
||||
Toast.MakeText(Activity, "Action comming soon", ToastLength.Short).Show();
|
||||
|
||||
Generated
+124
-103
@@ -3088,8 +3088,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0051
|
||||
public const int META = 2131361873;
|
||||
|
||||
// aapt resource value: 0x7f0a0110
|
||||
public const int PreferenceScreen = 2131362064;
|
||||
// aapt resource value: 0x7f0a0112
|
||||
public const int PreferenceScreen = 2131362066;
|
||||
|
||||
// aapt resource value: 0x7f0a0052
|
||||
public const int SHIFT = 2131361874;
|
||||
@@ -3097,8 +3097,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0053
|
||||
public const int SYM = 2131361875;
|
||||
|
||||
// aapt resource value: 0x7f0a0111
|
||||
public const int accountPreference = 2131362065;
|
||||
// aapt resource value: 0x7f0a0113
|
||||
public const int accountPreference = 2131362067;
|
||||
|
||||
// aapt resource value: 0x7f0a00e2
|
||||
public const int action0 = 2131362018;
|
||||
@@ -3208,8 +3208,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a00dc
|
||||
public const int bottomView = 2131362012;
|
||||
|
||||
// aapt resource value: 0x7f0a012e
|
||||
public const int browseLayout = 2131362094;
|
||||
// aapt resource value: 0x7f0a0130
|
||||
public const int browseLayout = 2131362096;
|
||||
|
||||
// aapt resource value: 0x7f0a00ae
|
||||
public const int browseList = 2131361966;
|
||||
@@ -3223,8 +3223,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a00e3
|
||||
public const int cancel_action = 2131362019;
|
||||
|
||||
// aapt resource value: 0x7f0a011a
|
||||
public const int cardPlayer = 2131362074;
|
||||
// aapt resource value: 0x7f0a011c
|
||||
public const int cardPlayer = 2131362076;
|
||||
|
||||
// aapt resource value: 0x7f0a0060
|
||||
public const int center = 2131361888;
|
||||
@@ -3286,6 +3286,9 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0082
|
||||
public const int default_activity_button = 2131361922;
|
||||
|
||||
// aapt resource value: 0x7f0a0135
|
||||
public const int delete = 2131362101;
|
||||
|
||||
// aapt resource value: 0x7f0a00b9
|
||||
public const int design_bottom_sheet = 2131361977;
|
||||
|
||||
@@ -3307,11 +3310,14 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0103
|
||||
public const int downFAB = 2131362051;
|
||||
|
||||
// aapt resource value: 0x7f0a0130
|
||||
public const int downloadMDfromYT = 2131362096;
|
||||
// aapt resource value: 0x7f0a013a
|
||||
public const int download = 2131362106;
|
||||
|
||||
// aapt resource value: 0x7f0a0126
|
||||
public const int edit = 2131362086;
|
||||
// aapt resource value: 0x7f0a0132
|
||||
public const int downloadMDfromYT = 2131362098;
|
||||
|
||||
// aapt resource value: 0x7f0a0128
|
||||
public const int edit = 2131362088;
|
||||
|
||||
// aapt resource value: 0x7f0a00a0
|
||||
public const int edit_query = 2131361952;
|
||||
@@ -3415,8 +3421,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0063
|
||||
public const int fill_vertical = 2131361891;
|
||||
|
||||
// aapt resource value: 0x7f0a0134
|
||||
public const int filter = 2131362100;
|
||||
// aapt resource value: 0x7f0a0138
|
||||
public const int filter = 2131362104;
|
||||
|
||||
// aapt resource value: 0x7f0a0076
|
||||
public const int fit = 2131361910;
|
||||
@@ -3445,20 +3451,26 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a000a
|
||||
public const int ghost_view = 2131361802;
|
||||
|
||||
// aapt resource value: 0x7f0a0108
|
||||
public const int headerMore = 2131362056;
|
||||
|
||||
// aapt resource value: 0x7f0a0105
|
||||
public const int headerNumber = 2131362053;
|
||||
// aapt resource value: 0x7f0a0104
|
||||
public const int headerArt = 2131362052;
|
||||
|
||||
// aapt resource value: 0x7f0a0106
|
||||
public const int headerPlay = 2131362054;
|
||||
public const int headerAuthor = 2131362054;
|
||||
|
||||
// aapt resource value: 0x7f0a010a
|
||||
public const int headerMore = 2131362058;
|
||||
|
||||
// aapt resource value: 0x7f0a0107
|
||||
public const int headerShuffle = 2131362055;
|
||||
public const int headerNumber = 2131362055;
|
||||
|
||||
// aapt resource value: 0x7f0a0104
|
||||
public const int headerTitle = 2131362052;
|
||||
// aapt resource value: 0x7f0a0108
|
||||
public const int headerPlay = 2131362056;
|
||||
|
||||
// aapt resource value: 0x7f0a0109
|
||||
public const int headerShuffle = 2131362057;
|
||||
|
||||
// aapt resource value: 0x7f0a0105
|
||||
public const int headerTitle = 2131362053;
|
||||
|
||||
// aapt resource value: 0x7f0a0005
|
||||
public const int home = 2131361797;
|
||||
@@ -3469,8 +3481,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0084
|
||||
public const int icon = 2131361924;
|
||||
|
||||
// aapt resource value: 0x7f0a0109
|
||||
public const int icon_frame = 2131362057;
|
||||
// aapt resource value: 0x7f0a010b
|
||||
public const int icon_frame = 2131362059;
|
||||
|
||||
// aapt resource value: 0x7f0a00f0
|
||||
public const int icon_group = 2131362032;
|
||||
@@ -3511,14 +3523,14 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0017
|
||||
public const int line1 = 2131361815;
|
||||
|
||||
// aapt resource value: 0x7f0a012a
|
||||
public const int line2 = 2131362090;
|
||||
// aapt resource value: 0x7f0a012c
|
||||
public const int line2 = 2131362092;
|
||||
|
||||
// aapt resource value: 0x7f0a0018
|
||||
public const int line3 = 2131361816;
|
||||
|
||||
// aapt resource value: 0x7f0a010b
|
||||
public const int list = 2131362059;
|
||||
// aapt resource value: 0x7f0a010d
|
||||
public const int list = 2131362061;
|
||||
|
||||
// aapt resource value: 0x7f0a003a
|
||||
public const int listMode = 2131361850;
|
||||
@@ -3526,23 +3538,23 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0083
|
||||
public const int list_item = 2131361923;
|
||||
|
||||
// aapt resource value: 0x7f0a0113
|
||||
public const int localPlay = 2131362067;
|
||||
// aapt resource value: 0x7f0a0115
|
||||
public const int localPlay = 2131362069;
|
||||
|
||||
// aapt resource value: 0x7f0a00d4
|
||||
public const int logButton = 2131362004;
|
||||
|
||||
// aapt resource value: 0x7f0a012c
|
||||
public const int masked = 2131362092;
|
||||
// aapt resource value: 0x7f0a012e
|
||||
public const int masked = 2131362094;
|
||||
|
||||
// aapt resource value: 0x7f0a0119
|
||||
public const int maxValue = 2131362073;
|
||||
// aapt resource value: 0x7f0a011b
|
||||
public const int maxValue = 2131362075;
|
||||
|
||||
// aapt resource value: 0x7f0a00e5
|
||||
public const int media_actions = 2131362021;
|
||||
|
||||
// aapt resource value: 0x7f0a0129
|
||||
public const int message = 2131362089;
|
||||
// aapt resource value: 0x7f0a012b
|
||||
public const int message = 2131362091;
|
||||
|
||||
// aapt resource value: 0x7f0a00c8
|
||||
public const int metadataAlbum = 2131361992;
|
||||
@@ -3568,20 +3580,20 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a004d
|
||||
public const int middle = 2131361869;
|
||||
|
||||
// aapt resource value: 0x7f0a0118
|
||||
public const int minValue = 2131362072;
|
||||
// aapt resource value: 0x7f0a011a
|
||||
public const int minValue = 2131362074;
|
||||
|
||||
// aapt resource value: 0x7f0a006e
|
||||
public const int mini = 2131361902;
|
||||
|
||||
// aapt resource value: 0x7f0a0127
|
||||
public const int moreButton = 2131362087;
|
||||
// aapt resource value: 0x7f0a0129
|
||||
public const int moreButton = 2131362089;
|
||||
|
||||
// aapt resource value: 0x7f0a0044
|
||||
public const int multiply = 2131361860;
|
||||
|
||||
// aapt resource value: 0x7f0a012d
|
||||
public const int musicLayout = 2131362093;
|
||||
// aapt resource value: 0x7f0a012f
|
||||
public const int musicLayout = 2131362095;
|
||||
|
||||
// aapt resource value: 0x7f0a00bc
|
||||
public const int navigation_header_container = 2131361980;
|
||||
@@ -3625,8 +3637,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0075
|
||||
public const int one = 2131361909;
|
||||
|
||||
// aapt resource value: 0x7f0a0128
|
||||
public const int pager = 2131362088;
|
||||
// aapt resource value: 0x7f0a012a
|
||||
public const int pager = 2131362090;
|
||||
|
||||
// aapt resource value: 0x7f0a0067
|
||||
public const int parallax = 2131361895;
|
||||
@@ -3667,17 +3679,17 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a00d6
|
||||
public const int playlistHeader = 2131362006;
|
||||
|
||||
// aapt resource value: 0x7f0a012f
|
||||
public const int playlistLayout = 2131362095;
|
||||
// aapt resource value: 0x7f0a0131
|
||||
public const int playlistLayout = 2131362097;
|
||||
|
||||
// aapt resource value: 0x7f0a00b3
|
||||
public const int playlistName = 2131361971;
|
||||
|
||||
// aapt resource value: 0x7f0a0116
|
||||
public const int playlistURL = 2131362070;
|
||||
// aapt resource value: 0x7f0a0118
|
||||
public const int playlistURL = 2131362072;
|
||||
|
||||
// aapt resource value: 0x7f0a010f
|
||||
public const int preferenceContent = 2131362063;
|
||||
// aapt resource value: 0x7f0a0111
|
||||
public const int preferenceContent = 2131362065;
|
||||
|
||||
// aapt resource value: 0x7f0a0006
|
||||
public const int progress_circular = 2131361798;
|
||||
@@ -3685,11 +3697,11 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0007
|
||||
public const int progress_horizontal = 2131361799;
|
||||
|
||||
// aapt resource value: 0x7f0a0115
|
||||
public const int quickPlay = 2131362069;
|
||||
// aapt resource value: 0x7f0a0117
|
||||
public const int quickPlay = 2131362071;
|
||||
|
||||
// aapt resource value: 0x7f0a0112
|
||||
public const int quickPlayLinear = 2131362066;
|
||||
// aapt resource value: 0x7f0a0114
|
||||
public const int quickPlayLinear = 2131362068;
|
||||
|
||||
// aapt resource value: 0x7f0a0097
|
||||
public const int radio = 2131361943;
|
||||
@@ -3697,11 +3709,14 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a00d3
|
||||
public const int recycler = 2131362003;
|
||||
|
||||
// aapt resource value: 0x7f0a0123
|
||||
public const int reorder = 2131362083;
|
||||
// aapt resource value: 0x7f0a0134
|
||||
public const int rename = 2131362100;
|
||||
|
||||
// aapt resource value: 0x7f0a0133
|
||||
public const int repeat = 2131362099;
|
||||
// aapt resource value: 0x7f0a0125
|
||||
public const int reorder = 2131362085;
|
||||
|
||||
// aapt resource value: 0x7f0a0137
|
||||
public const int repeat = 2131362103;
|
||||
|
||||
// aapt resource value: 0x7f0a0065
|
||||
public const int right = 2131361893;
|
||||
@@ -3739,8 +3754,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0070
|
||||
public const int scrollable = 2131361904;
|
||||
|
||||
// aapt resource value: 0x7f0a0117
|
||||
public const int search = 2131362071;
|
||||
// aapt resource value: 0x7f0a0119
|
||||
public const int search = 2131362073;
|
||||
|
||||
// aapt resource value: 0x7f0a00a2
|
||||
public const int search_badge = 2131361954;
|
||||
@@ -3772,17 +3787,17 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a00ab
|
||||
public const int search_voice_btn = 2131361963;
|
||||
|
||||
// aapt resource value: 0x7f0a010c
|
||||
public const int seekbar = 2131362060;
|
||||
// aapt resource value: 0x7f0a010e
|
||||
public const int seekbar = 2131362062;
|
||||
|
||||
// aapt resource value: 0x7f0a010d
|
||||
public const int seekbar_value = 2131362061;
|
||||
// aapt resource value: 0x7f0a010f
|
||||
public const int seekbar_value = 2131362063;
|
||||
|
||||
// aapt resource value: 0x7f0a00ac
|
||||
public const int select_dialog_listview = 2131361964;
|
||||
|
||||
// aapt resource value: 0x7f0a0135
|
||||
public const int settings = 2131362101;
|
||||
// aapt resource value: 0x7f0a0139
|
||||
public const int settings = 2131362105;
|
||||
|
||||
// aapt resource value: 0x7f0a0096
|
||||
public const int shortcut = 2131361942;
|
||||
@@ -3799,8 +3814,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0041
|
||||
public const int showTitle = 2131361857;
|
||||
|
||||
// aapt resource value: 0x7f0a0132
|
||||
public const int shuffle = 2131362098;
|
||||
// aapt resource value: 0x7f0a0136
|
||||
public const int shuffle = 2131362102;
|
||||
|
||||
// aapt resource value: 0x7f0a00b4
|
||||
public const int smallLabel = 2131361972;
|
||||
@@ -3823,35 +3838,35 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0102
|
||||
public const int songTimer = 2131362050;
|
||||
|
||||
// aapt resource value: 0x7f0a011c
|
||||
public const int spArt = 2131362076;
|
||||
|
||||
// aapt resource value: 0x7f0a011e
|
||||
public const int spArtist = 2131362078;
|
||||
|
||||
// aapt resource value: 0x7f0a011b
|
||||
public const int spContainer = 2131362075;
|
||||
|
||||
// aapt resource value: 0x7f0a0121
|
||||
public const int spLast = 2131362081;
|
||||
|
||||
// aapt resource value: 0x7f0a011f
|
||||
public const int spNext = 2131362079;
|
||||
public const int spArt = 2131362078;
|
||||
|
||||
// aapt resource value: 0x7f0a0120
|
||||
public const int spPlay = 2131362080;
|
||||
|
||||
// aapt resource value: 0x7f0a0122
|
||||
public const int spProgress = 2131362082;
|
||||
public const int spArtist = 2131362080;
|
||||
|
||||
// aapt resource value: 0x7f0a011d
|
||||
public const int spTitle = 2131362077;
|
||||
public const int spContainer = 2131362077;
|
||||
|
||||
// aapt resource value: 0x7f0a0123
|
||||
public const int spLast = 2131362083;
|
||||
|
||||
// aapt resource value: 0x7f0a0121
|
||||
public const int spNext = 2131362081;
|
||||
|
||||
// aapt resource value: 0x7f0a0122
|
||||
public const int spPlay = 2131362082;
|
||||
|
||||
// aapt resource value: 0x7f0a0124
|
||||
public const int spProgress = 2131362084;
|
||||
|
||||
// aapt resource value: 0x7f0a011f
|
||||
public const int spTitle = 2131362079;
|
||||
|
||||
// aapt resource value: 0x7f0a0086
|
||||
public const int spacer = 2131361926;
|
||||
|
||||
// aapt resource value: 0x7f0a010a
|
||||
public const int spinner = 2131362058;
|
||||
// aapt resource value: 0x7f0a010c
|
||||
public const int spinner = 2131362060;
|
||||
|
||||
// aapt resource value: 0x7f0a0008
|
||||
public const int split_action_bar = 2131361800;
|
||||
@@ -3871,8 +3886,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0066
|
||||
public const int start = 2131361894;
|
||||
|
||||
// aapt resource value: 0x7f0a0124
|
||||
public const int status = 2131362084;
|
||||
// aapt resource value: 0x7f0a0126
|
||||
public const int status = 2131362086;
|
||||
|
||||
// aapt resource value: 0x7f0a00e4
|
||||
public const int status_bar_latest_event_content = 2131362020;
|
||||
@@ -3886,8 +3901,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a007a
|
||||
public const int surface_view = 2131361914;
|
||||
|
||||
// aapt resource value: 0x7f0a010e
|
||||
public const int switchWidget = 2131362062;
|
||||
// aapt resource value: 0x7f0a0110
|
||||
public const int switchWidget = 2131362064;
|
||||
|
||||
// aapt resource value: 0x7f0a003c
|
||||
public const int tabMode = 2131361852;
|
||||
@@ -3967,8 +3982,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0013
|
||||
public const int transition_transform = 2131361811;
|
||||
|
||||
// aapt resource value: 0x7f0a0131
|
||||
public const int undoChange = 2131362097;
|
||||
// aapt resource value: 0x7f0a0133
|
||||
public const int undoChange = 2131362099;
|
||||
|
||||
// aapt resource value: 0x7f0a0049
|
||||
public const int uniform = 2131361865;
|
||||
@@ -3982,8 +3997,8 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a0016
|
||||
public const int view_offset_helper = 2131361814;
|
||||
|
||||
// aapt resource value: 0x7f0a012b
|
||||
public const int visible = 2131362091;
|
||||
// aapt resource value: 0x7f0a012d
|
||||
public const int visible = 2131362093;
|
||||
|
||||
// aapt resource value: 0x7f0a0036
|
||||
public const int wide = 2131361846;
|
||||
@@ -3994,11 +4009,11 @@ namespace MusicApp
|
||||
// aapt resource value: 0x7f0a004a
|
||||
public const int wrap_content = 2131361866;
|
||||
|
||||
// aapt resource value: 0x7f0a0125
|
||||
public const int youtubeIcon = 2131362085;
|
||||
// aapt resource value: 0x7f0a0127
|
||||
public const int youtubeIcon = 2131362087;
|
||||
|
||||
// aapt resource value: 0x7f0a0114
|
||||
public const int ytPlay = 2131362068;
|
||||
// aapt resource value: 0x7f0a0116
|
||||
public const int ytPlay = 2131362070;
|
||||
|
||||
// aapt resource value: 0x7f0a00d2
|
||||
public const int ytProgress = 2131362002;
|
||||
@@ -4424,10 +4439,16 @@ namespace MusicApp
|
||||
public const int metaData_items = 2131558401;
|
||||
|
||||
// aapt resource value: 0x7f0d0002
|
||||
public const int QueueItems = 2131558402;
|
||||
public const int playlist_header_more = 2131558402;
|
||||
|
||||
// aapt resource value: 0x7f0d0003
|
||||
public const int toolbar_menu = 2131558403;
|
||||
public const int QueueItems = 2131558403;
|
||||
|
||||
// aapt resource value: 0x7f0d0004
|
||||
public const int toolbar_menu = 2131558404;
|
||||
|
||||
// aapt resource value: 0x7f0d0005
|
||||
public const int ytplaylist_header_more = 2131558405;
|
||||
|
||||
static Menu()
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:src="@drawable/noAlbum"
|
||||
android:id="@+id/headerArt"
|
||||
android:scaleType="fitCenter"
|
||||
android:adjustViewBounds="true" />
|
||||
<ImageView
|
||||
@@ -32,7 +33,7 @@
|
||||
android:textStyle="bold"
|
||||
android:text="Title of the playlist" />
|
||||
<TextView
|
||||
android:id="@+id/headerNumber"
|
||||
android:id="@+id/headerAuthor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ffffff"
|
||||
@@ -59,7 +60,7 @@
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:tint="#ffffff"
|
||||
android:src="@drawable/ic_pause_black_24dp"
|
||||
android:src="@drawable/ic_play_arrow_black_24dp"
|
||||
android:background="@null" />
|
||||
<ImageButton
|
||||
android:id="@+id/headerShuffle"
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:id="@+id/rename"
|
||||
android:title="Rename" />
|
||||
<item
|
||||
android:id="@+id/delete"
|
||||
android:title="Delete" />
|
||||
</menu>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:id="@+id/download"
|
||||
android:title="Download" />
|
||||
<item
|
||||
android:id="@+id/rename"
|
||||
android:title="Rename" />
|
||||
<item
|
||||
android:id="@+id/delete"
|
||||
android:title="Delete" />
|
||||
</menu>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:id="@+id/download"
|
||||
android:title="Download" />
|
||||
<item
|
||||
android:id="@+id/delete"
|
||||
android:title="Delete" />
|
||||
</menu>
|
||||
Reference in New Issue
Block a user