* 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)
{
scrollDirection = ScrollDirection.Down;
if (searchBar.IsFocused)
{
searchBar.Unfocus();
}
ViewExtensions.CancelAnimations(searchBar);
ViewExtensions.CancelAnimations(panelBar);
searchBar.TranslateTo(0, -searchBarHeight, easing: Easing.CubicIn);

View File

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