tiles design, home page development
This commit is contained in:
@@ -99,7 +99,7 @@ namespace FoxTube
|
||||
|
||||
private void SubsMore_Clicked()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
@@ -256,21 +256,39 @@ namespace FoxTube
|
||||
}
|
||||
}
|
||||
|
||||
void LoadSubscriptions()
|
||||
async void LoadSubscriptions()
|
||||
{
|
||||
try
|
||||
{
|
||||
List<SearchResult> items = new List<SearchResult>();
|
||||
SearchResource.ListRequest request = SecretsVault.Service.Search.List("snippet");
|
||||
request.Type = "video";
|
||||
request.MaxResults = 20;
|
||||
request.Order = SearchResource.ListRequest.OrderEnum.Date;
|
||||
|
||||
foreach (Subscription i in SecretsVault.Subscriptions)
|
||||
{
|
||||
request.ChannelId = i.Snippet.ResourceId.ChannelId;
|
||||
SearchListResponse response = await request.ExecuteAsync();
|
||||
foreach (SearchResult result in response.Items)
|
||||
items.Add(result);
|
||||
}
|
||||
subsMore.Complete(true);
|
||||
|
||||
items.OrderBy(x => x.Snippet.PublishedAt.Value);
|
||||
|
||||
foreach (SearchResult i in items)
|
||||
subsGrid.Add(new VideoCard(i.Id.VideoId));
|
||||
|
||||
subsLoading.Close();
|
||||
subsLoaded = true;
|
||||
subsLoading.Block();
|
||||
}
|
||||
catch (System.Net.Http.HttpRequestException)
|
||||
{
|
||||
subsLoading.Error("System.Net.Http.HttpRequestException", "Unable to connect to Google servers.", true);
|
||||
}
|
||||
catch
|
||||
catch (Exception e)
|
||||
{
|
||||
subsLoading.Error();
|
||||
subsLoading.Error(e.ToString(), e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user