From 03b83b16c412cc7dc41c7816817ecc5336cabc8a Mon Sep 17 00:00:00 2001 From: Tsanie Lily Date: Sun, 17 May 2020 11:30:28 +0800 Subject: [PATCH] feature: anime status icon --- Pixiview/Illust/IllustCollectionPage.cs | 2 +- Pixiview/Illust/ViewIllustPage.xaml | 9 +++++++++ Pixiview/Illust/ViewIllustPage.xaml.cs | 9 +++++++++ Pixiview/UI/StyleDefinition.cs | 1 + Pixiview/UI/Theme/DarkTheme.cs | 2 +- Pixiview/UI/Theme/LightTheme.cs | 2 +- 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Pixiview/Illust/IllustCollectionPage.cs b/Pixiview/Illust/IllustCollectionPage.cs index c5dcc6d..f1fd1ea 100644 --- a/Pixiview/Illust/IllustCollectionPage.cs +++ b/Pixiview/Illust/IllustCollectionPage.cs @@ -659,7 +659,7 @@ namespace Pixiview.Illust { return; } - if (y - lastRefreshY > 100) + if (y - lastRefreshY > 200) { if (CheckRefresh()) { diff --git a/Pixiview/Illust/ViewIllustPage.xaml b/Pixiview/Illust/ViewIllustPage.xaml index 5f62139..f662955 100644 --- a/Pixiview/Illust/ViewIllustPage.xaml +++ b/Pixiview/Illust/ViewIllustPage.xaml @@ -44,6 +44,15 @@ FontSize="Micro" TextColor="White" IsVisible="{Binding IsPageVisible}"/> + + (int)GetValue(CurrentPageProperty); set => SetValue(CurrentPageProperty, value); } + public string AnimeStatus + { + get => (string)GetValue(AnimeStatusProperty); + set => SetValue(AnimeStatusProperty, value); + } public bool IsScrollAnimated { get => (bool)GetValue(IsScrollAnimatedProperty); @@ -493,6 +500,7 @@ namespace Pixiview.Illust if (ugoira != null) { var playing = !ugoira.IsPlaying; + AnimeStatus = playing ? StyleDefinition.IconPause : StyleDefinition.IconPlay; IsAnimateSliderEnabled = !playing; ugoira.TogglePlay(playing); illustItem.IsPlaying = playing; @@ -506,6 +514,7 @@ namespace Pixiview.Illust ugoira = new Ugoira(ugoiraData, item); ugoira.FrameChanged += OnUgoiraFrameChanged; + AnimeStatus = StyleDefinition.IconPause; illustItem.IsPlaying = true; ugoira.TogglePlay(true); } diff --git a/Pixiview/UI/StyleDefinition.cs b/Pixiview/UI/StyleDefinition.cs index 07c1cc9..daf0f07 100644 --- a/Pixiview/UI/StyleDefinition.cs +++ b/Pixiview/UI/StyleDefinition.cs @@ -46,6 +46,7 @@ namespace Pixiview.UI //public const string IconCaretUp = "\uf0d8"; public const string IconCircleCheck = "\uf058"; public const string IconPlay = "\uf04b"; + public const string IconPause = "\uf04c"; public const string IconMore = "\uf142"; public const string IconCaretCircleLeft = "\uf32e"; public const string IconCaretCircleRight = "\uf330"; diff --git a/Pixiview/UI/Theme/DarkTheme.cs b/Pixiview/UI/Theme/DarkTheme.cs index b736eaa..d8945a0 100644 --- a/Pixiview/UI/Theme/DarkTheme.cs +++ b/Pixiview/UI/Theme/DarkTheme.cs @@ -33,7 +33,7 @@ namespace Pixiview.UI.Theme Add(TextColor, Color.White); Add(SubTextColor, Color.LightGray); Add(CardBackgroundColor, Color.FromRgb(0x33, 0x33, 0x33)); - Add(MaskColor, Color.FromRgba(0xff, 0xff, 0xff, 0x50)); + Add(MaskColor, Color.FromRgba(0xff, 0xff, 0xff, 0x64)); Add(NavColor, Color.FromRgb(0x11, 0x11, 0x11)); Add(NavSelectedColor, Color.FromRgb(0x22, 0x22, 0x22)); Add(OptionBackColor, Color.Black); diff --git a/Pixiview/UI/Theme/LightTheme.cs b/Pixiview/UI/Theme/LightTheme.cs index 146d513..5e2bdc4 100644 --- a/Pixiview/UI/Theme/LightTheme.cs +++ b/Pixiview/UI/Theme/LightTheme.cs @@ -33,7 +33,7 @@ namespace Pixiview.UI.Theme Add(TextColor, Color.Black); Add(SubTextColor, Color.DimGray); Add(CardBackgroundColor, Color.FromRgb(0xf3, 0xf3, 0xf3)); - Add(MaskColor, Color.FromRgba(0, 0, 0, 0x50)); + Add(MaskColor, Color.FromRgba(0, 0, 0, 0x64)); Add(NavColor, Color.FromRgb(0xf0, 0xf0, 0xf0)); Add(NavSelectedColor, Color.LightGray); Add(OptionBackColor, Color.FromRgb(0xf0, 0xf0, 0xf0));