Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
使用更低分辨率的方形图加载时间线背景
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichiamane committed May 8, 2019
1 parent 65b7808 commit bfb110e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/IllustDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static IllustDetail FromJsonValue(JsonValue Source)
foreach (var tool in tools)
toret.Tools.Add(tool.AsString());
toret.CreateDate = Source.TryGetProperty("illust").Value.TryGetProperty("create_date").Value.AsString();
toret.MediumUrl = Source.TryGetProperty("illust").Value.TryGetProperty("image_urls").Value.TryGetProperty("medium").Value.AsString();
toret.MediumUrl = Source.TryGetProperty("illust").Value.TryGetProperty("image_urls").Value.TryGetProperty("square_medium").Value.AsString();
var pgCount = Source.TryGetProperty("illust").Value.TryGetProperty("page_count").Value.AsInteger();
toret.OriginalUrls = new List<string>();
if (pgCount == 1) toret.OriginalUrls.Add(Source.TryGetProperty("illust").Value.TryGetProperty("meta_single_page").Value.TryGetProperty("original_image_url").Value.AsString());
Expand Down
4 changes: 0 additions & 4 deletions PixivFSUWP/Data/OverAll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ public static PasswordCredential GetCredentialFromLocker(string resourceName)
return credential;
}

static UserActivitySession _currentActivity;

//时间线支持
public static async Task GenerateActivityAsync(string DisplayText, AdaptiveCard Card, Uri ActivationUri, string ActivityID)
{
Expand All @@ -144,8 +142,6 @@ public static async Task GenerateActivityAsync(string DisplayText, AdaptiveCard
userActivity.VisualElements.Content = AdaptiveCardBuilder.CreateAdaptiveCardFromJson(Card.ToJson());
userActivity.ActivationUri = ActivationUri;
await userActivity.SaveAsync();
_currentActivity?.Dispose();
_currentActivity = userActivity.CreateSession();
}
}
}
6 changes: 5 additions & 1 deletion PixivFSUWP/IllustDetailPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ private async Task loadContent()
MaxLines = 3
});
var build = SystemInformation.OperatingSystemVersion.Build;
if (build >= 18362) card.BackgroundImage = new AdaptiveBackgroundImage(new Uri(await Data.OverAll.GetDataUri(illust.MediumUrl)));
if (build >= 18362)
{
var data = await Data.OverAll.GetDataUri(illust.MediumUrl);
card.BackgroundImage = new AdaptiveBackgroundImage(new Uri(data));
}
await Data.OverAll.GenerateActivityAsync(illust.Title, card, new Uri(string.Format("pixiv://illust?id={0}", illustID)), illustID.ToString());
int counter = 0;
foreach (var i in illust.OriginalUrls)
Expand Down

0 comments on commit bfb110e

Please sign in to comment.