change: favorite merge rule

fix: page progress renderer
This commit is contained in:
2020-05-16 00:02:14 +08:00
parent 8433b44d4f
commit ffb789b8b7
2 changed files with 70 additions and 49 deletions

View File

@@ -122,7 +122,8 @@ namespace Pixiview.Illust
private IllustUgoiraData ugoiraData;
private Ugoira ugoira;
private volatile int downloaded = 0;
private readonly object sync = new object();
private int downloaded = 0;
private int pageCount;
public ViewIllustPage(IllustItem illust, bool save)
@@ -413,11 +414,15 @@ namespace Pixiview.Illust
return;
}
downloaded++;
lock (sync)
{
downloaded++;
}
if (downloaded >= pageCount)
{
MainThread.BeginInvokeOnMainThread(async () =>
{
ViewExtensions.CancelAnimations(progress);
await progress.ProgressTo(1, 250, Easing.CubicIn);
await progress.FadeTo(0, easing: Easing.CubicIn);
ProgressVisible = false;