* Pixiview/Illust/MainPage.xaml.cs: auto hide search bar when

scrolling

* Pixiview/Illust/ViewIllustPage.xaml.cs: activity indicator binding
This commit is contained in:
Tsanie Lily 2020-05-16 16:51:07 +08:00
parent 72b6c77c3d
commit 8a471b6272
2 changed files with 9 additions and 7 deletions

View File

@ -91,6 +91,10 @@ namespace Pixiview.Illust
if (scrollDirection != ScrollDirection.Down && y > searchBarHeight - topOffset) if (scrollDirection != ScrollDirection.Down && y > searchBarHeight - topOffset)
{ {
scrollDirection = ScrollDirection.Down; scrollDirection = ScrollDirection.Down;
if (searchBar.IsFocused)
{
searchBar.Unfocus();
}
ViewExtensions.CancelAnimations(searchBar); ViewExtensions.CancelAnimations(searchBar);
ViewExtensions.CancelAnimations(panelBar); ViewExtensions.CancelAnimations(panelBar);
searchBar.TranslateTo(0, -searchBarHeight, easing: Easing.CubicIn); searchBar.TranslateTo(0, -searchBarHeight, easing: Easing.CubicIn);

View File

@ -209,12 +209,10 @@ namespace Pixiview.Illust
CornerRadius = 8, CornerRadius = 8,
HorizontalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center,
Content = new ActivityIndicator Content = new ActivityIndicator()
{ .Binding(IsVisibleProperty, nameof(IllustDetailItem.Loading))
IsRunning = true, .Binding(ActivityIndicator.IsRunningProperty, nameof(IllustDetailItem.Loading))
IsVisible = true .DynamicResource(ActivityIndicator.ColorProperty, ThemeBase.WindowColor)
}
.DynamicResource(ActivityIndicator.ColorProperty, ThemeBase.WindowColor)
} }
.Binding(IsVisibleProperty, nameof(IllustDetailItem.Loading)) .Binding(IsVisibleProperty, nameof(IllustDetailItem.Loading))
.DynamicResource(BackgroundColorProperty, ThemeBase.MaskColor); .DynamicResource(BackgroundColorProperty, ThemeBase.MaskColor);
@ -222,12 +220,12 @@ namespace Pixiview.Illust
// loading original // loading original
var original = new ActivityIndicator var original = new ActivityIndicator
{ {
IsRunning = true,
Margin = new Thickness(10), Margin = new Thickness(10),
HorizontalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.Start,
VerticalOptions = LayoutOptions.Start VerticalOptions = LayoutOptions.Start
} }
.Binding(IsVisibleProperty, nameof(IllustDetailItem.Downloading)) .Binding(IsVisibleProperty, nameof(IllustDetailItem.Downloading))
.Binding(ActivityIndicator.IsRunningProperty, nameof(IllustDetailItem.Downloading))
.DynamicResource(ActivityIndicator.ColorProperty, ThemeBase.TextColor); .DynamicResource(ActivityIndicator.ColorProperty, ThemeBase.TextColor);
var tap = new TapGestureRecognizer(); var tap = new TapGestureRecognizer();