diff --git a/Pixiview.Android/Properties/AndroidManifest.xml b/Pixiview.Android/Properties/AndroidManifest.xml index ecca179..35ba62d 100644 --- a/Pixiview.Android/Properties/AndroidManifest.xml +++ b/Pixiview.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/Pixiview.Android/Renderers/AppShellSection/AppShellBottomNavViewAppearanceTracker.cs b/Pixiview.Android/Renderers/AppShellSection/AppShellBottomNavViewAppearanceTracker.cs index d84d4d3..0ac5004 100644 --- a/Pixiview.Android/Renderers/AppShellSection/AppShellBottomNavViewAppearanceTracker.cs +++ b/Pixiview.Android/Renderers/AppShellSection/AppShellBottomNavViewAppearanceTracker.cs @@ -65,7 +65,7 @@ namespace Pixiview.Droid.Renderers.AppShellSection bottomView.ItemIconTintList = _colorStateList; var menu = bottomView.Menu; - if (menu != null && menu.HasVisibleItems) + if (menu != null && menu.HasVisibleItems && menu.Size() == 4) { var itemUser = menu.GetItem(0); itemUser.SetIcon(itemUser.IsChecked ? diff --git a/Pixiview.iOS.OpenExtension/Info.plist b/Pixiview.iOS.OpenExtension/Info.plist index 955865e..8932c22 100644 --- a/Pixiview.iOS.OpenExtension/Info.plist +++ b/Pixiview.iOS.OpenExtension/Info.plist @@ -29,8 +29,8 @@ com.apple.share-services CFBundleShortVersionString - 1.0.522 + 1.0.523 CFBundleVersion - 11 + 12 diff --git a/Pixiview.iOS/Info.plist b/Pixiview.iOS/Info.plist index 6e48660..a87bdf5 100644 --- a/Pixiview.iOS/Info.plist +++ b/Pixiview.iOS/Info.plist @@ -79,8 +79,8 @@ CFBundleShortVersionString - 1.0.522 + 1.0.523 CFBundleVersion - 11 + 12 diff --git a/Pixiview.iOS/Renderers/AppShellSection/AppAppearanceTracker.cs b/Pixiview.iOS/Renderers/AppShellSection/AppAppearanceTracker.cs index 0aca86e..00a7e78 100644 --- a/Pixiview.iOS/Renderers/AppShellSection/AppAppearanceTracker.cs +++ b/Pixiview.iOS/Renderers/AppShellSection/AppAppearanceTracker.cs @@ -111,7 +111,6 @@ namespace Pixiview.iOS.Renderers.AppShellSection tabBar.UnselectedItemTintColor = _defaultUnselectedTint; } - [SuppressMessage("Code Notifications", "XI0001:Notifies you with advices on how to use Apple APIs", Justification = "")] public void SetAppearance(UITabBarController controller, ShellAppearance appearance) { IShellAppearanceElement appearanceElement = appearance; @@ -120,21 +119,6 @@ namespace Pixiview.iOS.Renderers.AppShellSection var tintColor = appearanceElement.EffectiveTabBarForegroundColor; // appearanceElement.EffectiveTabBarTitleColor; var tabBar = controller.TabBar; - if (tabBar.Items != null && tabBar.Items.Length == 4) - { - var tabUser = tabBar.Items[0]; - tabUser.Image = UIImage.FromBundle("IconUserRegular"); - tabUser.SelectedImage = UIImage.FromBundle("IconUser"); - var tabRecommend = tabBar.Items[1]; - tabRecommend.Image = UIImage.FromBundle("IconSparklesRegular"); - tabRecommend.SelectedImage = UIImage.FromBundle("IconSparkles"); - var tabRank = tabBar.Items[2]; - tabRank.Image = UIImage.FromBundle("IconSortRegular"); - tabRank.SelectedImage = UIImage.FromBundle("IconSort"); - var tabFavorite = tabBar.Items[3]; - tabFavorite.Image = UIImage.FromBundle("IconBookmarkRegular"); - tabFavorite.SelectedImage = UIImage.FromBundle("IconBookmark"); - } if (_defaultTint == null) { @@ -163,8 +147,25 @@ namespace Pixiview.iOS.Renderers.AppShellSection { } + [SuppressMessage("Code Notifications", "XI0001:Notifies you with advices on how to use Apple APIs", Justification = "")] public void UpdateLayout(UITabBarController controller) { + var tabBar = controller.TabBar; + if (tabBar != null && tabBar.Items != null && tabBar.Items.Length == 4) + { + var tabUser = tabBar.Items[0]; + tabUser.Image = UIImage.FromBundle("IconUserRegular"); + tabUser.SelectedImage = UIImage.FromBundle("IconUser"); + var tabRecommend = tabBar.Items[1]; + tabRecommend.Image = UIImage.FromBundle("IconSparklesRegular"); + tabRecommend.SelectedImage = UIImage.FromBundle("IconSparkles"); + var tabRank = tabBar.Items[2]; + tabRank.Image = UIImage.FromBundle("IconSortRegular"); + tabRank.SelectedImage = UIImage.FromBundle("IconSort"); + var tabFavorite = tabBar.Items[3]; + tabFavorite.Image = UIImage.FromBundle("IconBookmarkRegular"); + tabFavorite.SelectedImage = UIImage.FromBundle("IconBookmark"); + } } } } diff --git a/Pixiview/Illust/IllustCollectionPage.cs b/Pixiview/Illust/IllustCollectionPage.cs index eebf3a1..a4ff6b4 100644 --- a/Pixiview/Illust/IllustCollectionPage.cs +++ b/Pixiview/Illust/IllustCollectionPage.cs @@ -67,6 +67,7 @@ namespace Pixiview.Illust protected virtual bool IsFavoriteVisible => true; protected virtual bool IsAutoReload => true; protected virtual bool IsRedirectLogin => false; + protected virtual bool NeedCookie => false; protected virtual ActivityIndicator LoadingIndicator => null; protected virtual double IndicatorMarginTop => 16; @@ -195,6 +196,7 @@ namespace Pixiview.Illust protected abstract T DoLoadIllustData(bool force); protected abstract IEnumerable DoGetIllustList(T data); + protected virtual IllustCollection GetIllustsLoadedCollection(IllustCollection collection, bool bottom) { IllustCollection = collection; @@ -563,7 +565,7 @@ namespace Pixiview.Illust { extra = string.Empty; } - _ = DisplayAlert(ResourceHelper.Title, + await DisplayAlert(ResourceHelper.Title, ResourceHelper.FailedResponse + extra, ResourceHelper.Ok); } @@ -591,7 +593,7 @@ namespace Pixiview.Illust #if DEBUG App.DebugPrint($"start loading data, force: {force}"); #endif - if (force && string.IsNullOrEmpty(Configs.Cookie)) + if (force && NeedCookie && string.IsNullOrEmpty(Configs.Cookie)) { MainThread.BeginInvokeOnMainThread(RedirectFailed); App.DebugPrint($"no cookie found"); @@ -703,8 +705,8 @@ namespace Pixiview.Illust { protected const int SCROLL_OFFSET = 33; protected ScrollDirection scrollDirection = ScrollDirection.Stop; + protected double lastScrollY = double.MinValue; - private double lastScrollY = double.MinValue; private double lastRefreshY = double.MinValue; private double offset; @@ -763,6 +765,10 @@ namespace Pixiview.Illust { lastScrollY = y; + if (scrollDirection == ScrollDirection.Up) + { + return; + } if (y > 0 && offset > 0 && y - topOffset > offset) { if (IsLoading || IsBottomLoading) diff --git a/Pixiview/Illust/MainPage.xaml.cs b/Pixiview/Illust/MainPage.xaml.cs index 062ae10..32d1098 100644 --- a/Pixiview/Illust/MainPage.xaml.cs +++ b/Pixiview/Illust/MainPage.xaml.cs @@ -36,6 +36,7 @@ namespace Pixiview.Illust } protected override bool IsRedirectLogin => true; + protected override bool NeedCookie => true; protected override ActivityIndicator LoadingIndicator => activityLoading; protected override double IndicatorMarginTop => 66; diff --git a/Pixiview/Illust/RankingPage.xaml b/Pixiview/Illust/RankingPage.xaml index 79aa4c5..1719527 100644 --- a/Pixiview/Illust/RankingPage.xaml +++ b/Pixiview/Illust/RankingPage.xaml @@ -109,6 +109,8 @@ ios:DatePicker.UpdateMode="WhenFinished" Date="{Binding SelectedDate}" MaximumDate="{Binding MaximumDate}" + Focused="DatePicker_Focused" + Unfocused="DatePicker_Focused" DateSelected="DatePicker_DateSelected"/> diff --git a/Pixiview/Illust/RankingPage.xaml.cs b/Pixiview/Illust/RankingPage.xaml.cs index fd499b1..19b428e 100644 --- a/Pixiview/Illust/RankingPage.xaml.cs +++ b/Pixiview/Illust/RankingPage.xaml.cs @@ -97,6 +97,7 @@ namespace Pixiview.Illust private bool nextEnabled; private bool isFilterVisible; + private bool isDatePickerVisible; private string lastQueryKey; private string queryDate; private string previousDate; @@ -264,7 +265,7 @@ namespace Pixiview.Illust } } - private void OnDateTrigger(string action) + private async void OnDateTrigger(string action) { if (IsLoading) { @@ -272,6 +273,8 @@ namespace Pixiview.Illust } if (action == "select") { + // stop the scrolling + await scrollView.ScrollToAsync(scrollView.ScrollX, scrollView.ScrollY, false); datePicker.Focus(); } else @@ -303,6 +306,11 @@ namespace Pixiview.Illust } } + private void DatePicker_Focused(object sender, FocusEventArgs e) + { + isDatePickerVisible = e.IsFocused; + } + private void DatePicker_DateSelected(object sender, DateChangedEventArgs e) { if (e.OldDate == DateTime.Today || IsLoading) @@ -348,6 +356,11 @@ namespace Pixiview.Illust ToggleFilterPanel(false); } } + if (isDatePickerVisible) + { + isDatePickerVisible = false; + datePicker.Unfocus(); + } OnScrolled(y); } diff --git a/Pixiview/Illust/RecommendsPage.xaml.cs b/Pixiview/Illust/RecommendsPage.xaml.cs index c4a41d7..5ce3f1c 100644 --- a/Pixiview/Illust/RecommendsPage.xaml.cs +++ b/Pixiview/Illust/RecommendsPage.xaml.cs @@ -43,6 +43,7 @@ namespace Pixiview.Illust InitializeComponent(); } + protected override bool NeedCookie => true; protected override ActivityIndicator LoadingIndicator => activityLoading; public override void OnUnload()