* Pixiview/UI/StyleDefinition.cs: issue in simulator iPad Pro

11-inch

* Pixiview/UI/FlowLayout.cs:
* Pixiview/Illust/RankingPage.xaml:
* Pixiview/Illust/RankingPage.xaml.cs: fix: scrolling issue

* Pixiview/Illust/ViewIllustPage.xaml:
* Pixiview/Illust/ViewIllustPage.xaml.cs: fix: swipe page indicator
  issue
This commit is contained in:
2020-05-14 20:22:24 +08:00
parent a2b91a2406
commit 29fd8e9667
6 changed files with 33 additions and 20 deletions

View File

@@ -48,7 +48,7 @@
<Grid>
<ScrollView x:Name="scrollView" Scrolled="ScrollView_Scrolled"
HorizontalOptions="Fill" HorizontalScrollBarVisibility="Never">
<u:FlowLayout ItemsSource="{Binding Illusts}"
<u:FlowLayout ItemsSource="{Binding Illusts}" MaxHeightChanged="FlowLayout_MaxHeightChanged"
HorizontalOptions="Fill" Column="{Binding Columns}"
Margin="16, 16, 16, 16" RowSpacing="16" ColumnSpacing="16"
ItemTemplate="{StaticResource cardView}"/>

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Pixiview.Resources;
using Pixiview.UI;
using Pixiview.Utils;
using Xamarin.Essentials;
using Xamarin.Forms;
@@ -77,9 +78,10 @@ namespace Pixiview.Illust
public Command<string> ToolbarCommand { get; private set; }
private double lastScrollY = double.MinValue;
public bool previousEnabled;
public bool dateEnabled;
public bool nextEnabled;
private bool previousEnabled;
private bool dateEnabled;
private bool nextEnabled;
private double offset;
private bool isFilterVisible;
private string lastQueryKey;
@@ -126,6 +128,14 @@ namespace Pixiview.Illust
}
}
private void FlowLayout_MaxHeightChanged(object sender, HeightEventArgs e)
{
if (e.ContentHeight > 0)
{
offset = e.ContentHeight - scrollView.Bounds.Height - 33;
}
}
protected override void DoIllustsLoaded(IllustCollection collection)
{
var now = IllustCollection;
@@ -333,8 +343,7 @@ namespace Pixiview.Illust
}
lastScrollY = y;
var bottomOffset = scrollView.ContentSize.Height - (scrollView.LayoutAreaOverride.Height * 2);
if (y > 0 && y + topOffset > bottomOffset)
if (y > 0 && offset > 0 && y - topOffset > offset)
{
bool refresh = false;
lock (sync)

View File

@@ -22,8 +22,7 @@
<CarouselView ItemsSource="{Binding Illusts}" HorizontalScrollBarVisibility="Never"
Position="{Binding CurrentPage}"
ItemTemplate="{StaticResource carouselView}"
IsScrollAnimated="{Binding IsScrollAnimated}"
PositionChanged="CarouselView_PositionChanged">
IsScrollAnimated="{Binding IsScrollAnimated}">
<CarouselView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical" ItemSpacing="20"/>
</CarouselView.ItemsLayout>

View File

@@ -86,7 +86,7 @@ namespace Pixiview.Illust
public int CurrentPage
{
get => (int)GetValue(CurrentPageProperty);
private set => SetValue(CurrentPageProperty, value);
set => SetValue(CurrentPageProperty, value);
}
public bool IsScrollAnimated
{
@@ -413,11 +413,6 @@ namespace Pixiview.Illust
item.Loading = false;
}
private void CarouselView_PositionChanged(object sender, PositionChangedEventArgs e)
{
CurrentPage = e.CurrentPosition;
}
private void TapPrevious_Tapped(object sender, EventArgs e)
{
var index = CurrentPage;
@@ -520,7 +515,7 @@ namespace Pixiview.Illust
var illustItem = IllustItem;
var result = await DisplayActionSheet(
illustItem.Title,
$"{illustItem.Title} (id: {illustItem.Id})",
ResourceHelper.Cancel,
saveOriginal,
extras.ToArray());