From 0071d090521838ce4795473ed8d3c7f7b7a9acb4 Mon Sep 17 00:00:00 2001 From: Andrei Misiukevich Date: Wed, 4 Nov 2020 01:49:56 +0300 Subject: [PATCH] https://github.com/AndreiMisiukevich/CardView/issues/359 --- PanCardView/CardsView.cs | 9 ++------- PanCardView/Controls/TabsControl.cs | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/PanCardView/CardsView.cs b/PanCardView/CardsView.cs index fe4ebab..d64ae81 100644 --- a/PanCardView/CardsView.cs +++ b/PanCardView/CardsView.cs @@ -749,12 +749,6 @@ protected virtual async Task HardSetAsync() var scale = Scale; var time = 150u; - var rollbackAction = new Action(() => - { - Opacity = opacity; - Scale = scale; - }); - try { await Task.WhenAll( @@ -771,7 +765,8 @@ await Task.WhenAll( } catch { - rollbackAction?.Invoke(); + Opacity = opacity; + Scale = scale; } } diff --git a/PanCardView/Controls/TabsControl.cs b/PanCardView/Controls/TabsControl.cs index ec9b1bc..f4566af 100644 --- a/PanCardView/Controls/TabsControl.cs +++ b/PanCardView/Controls/TabsControl.cs @@ -396,7 +396,7 @@ private void UpdateStripePositionNonBatch() affectedIndex = affectedIndex.ToCyclicalIndex(itemsCount); } - if (affectedIndex < 0 || affectedIndex >= itemsCount) + if (affectedIndex < 0 || affectedIndex >= ItemsStackLayout.Children.Count) { return; }