Skip to content

Commit

Permalink
https://github.com/AndreiMisiukevich/CardView/issues/175
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiMisiukevich committed Mar 24, 2019
1 parent c068993 commit f909a62
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 24 deletions.
2 changes: 1 addition & 1 deletion PanCardView.Droid/CardsViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public CardsViewRenderer(Context context) : base(context)
}

public static void Preserve()
=> CardsView.Preserve();
=> Preserver.Preserve();

public override bool OnInterceptTouchEvent(MotionEvent ev)
{
Expand Down
2 changes: 1 addition & 1 deletion PanCardView.iOS/CardsViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CardsViewRenderer : VisualElementRenderer<CardsView>
private readonly UISwipeGestureRecognizer _downSwipeGesture;

public static void Preserve()
=> CardsView.Preserve();
=> Preserver.Preserve();

public CardsViewRenderer()
{
Expand Down
18 changes: 2 additions & 16 deletions PanCardView/CardsView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System.Runtime.CompilerServices;
using PanCardView.EventArgs;
using PanCardView.Delegates;
using System.ComponentModel;

namespace PanCardView
{
Expand Down Expand Up @@ -432,24 +433,9 @@ public ICommand ItemSwipedCommand

public object this[int index] => ItemsSource?.FindValue(index);

[EditorBrowsable(EditorBrowsableState.Never)]
public static void Preserve()
{
ArrowControl.Preserve();
CircleFrame.Preserve();
IndicatorsControl.Preserve();
ParentScrollView.Preserve();
new List<Type>
{
typeof(CarouselView),
typeof(CoverFlowView),
typeof(ArrowControl),
typeof(LeftArrowControl),
typeof(RightArrowControl),
typeof(CircleFrame),
typeof(IndicatorItemView),
typeof(IndicatorsControl),
typeof(ParentScrollView)
}.Clear();
}

public void OnPanUpdated(object sender, PanUpdatedEventArgs e)
Expand Down
6 changes: 6 additions & 0 deletions PanCardView/CarouselView.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PanCardView.Processors;
using System.ComponentModel;

namespace PanCardView
{
Expand All @@ -16,5 +17,10 @@ public CarouselView(ICardProcessor frontViewProcessor, ICardBackViewProcessor ba
protected override double DefaultMoveWidthPercentage => .3;

protected override bool DefaultIsCyclical => true;

[EditorBrowsable(EditorBrowsableState.Never)]
public new static void Preserve()
{
}
}
}
4 changes: 3 additions & 1 deletion PanCardView/Controls/ArrowControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using PanCardView.Extensions;
using PanCardView.Utility;
using System.Threading.Tasks;
using System.ComponentModel;

namespace PanCardView.Controls
{
Expand Down Expand Up @@ -124,7 +125,8 @@ public ArrowControl()
});
}

public static void Preserve()
[EditorBrowsable(EditorBrowsableState.Never)]
public new static void Preserve()
{
}

Expand Down
4 changes: 3 additions & 1 deletion PanCardView/Controls/CircleFrame.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PanCardView.Extensions;
using System.ComponentModel;
using PanCardView.Extensions;
using Xamarin.Forms;

namespace PanCardView.Controls
Expand All @@ -19,6 +20,7 @@ public CircleFrame()
Padding = 0;
}

[EditorBrowsable(EditorBrowsableState.Never)]
public static void Preserve()
{
}
Expand Down
7 changes: 6 additions & 1 deletion PanCardView/Controls/IndicatorItemView.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Xamarin.Forms;
using System.ComponentModel;

namespace PanCardView.Controls
{
Expand All @@ -8,5 +8,10 @@ public IndicatorItemView()
{
Size = 10;
}

[EditorBrowsable(EditorBrowsableState.Never)]
public new static void Preserve()
{
}
}
}
2 changes: 2 additions & 0 deletions PanCardView/Controls/IndicatorsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using System.Threading;
using PanCardView.Utility;
using System.ComponentModel;

namespace PanCardView.Controls
{
Expand Down Expand Up @@ -155,6 +156,7 @@ public int ToFadeDuration

public object this[int index] => IndicatorsContexts?.FindValue(index);

[EditorBrowsable(EditorBrowsableState.Never)]
public static void Preserve()
{
}
Expand Down
7 changes: 6 additions & 1 deletion PanCardView/Controls/LeftArrowControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using PanCardView.Extensions;
using System.ComponentModel;
using Xamarin.Forms;

namespace PanCardView.Controls
Expand All @@ -21,5 +21,10 @@ public LeftArrowControl()
Rotation = 180
};
}

[EditorBrowsable(EditorBrowsableState.Never)]
public new static void Preserve()
{
}
}
}
4 changes: 3 additions & 1 deletion PanCardView/Controls/ParentScrollView.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using Xamarin.Forms;
using System.ComponentModel;
using Xamarin.Forms;

namespace PanCardView.Controls
{
public class ParentScrollView : ScrollView, IOrdinateHandlerParentView
{
private double _prevY;

[EditorBrowsable(EditorBrowsableState.Never)]
public static void Preserve()
{
}
Expand Down
7 changes: 6 additions & 1 deletion PanCardView/Controls/RightArrowControl.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Xamarin.Forms;
using PanCardView.Extensions;
using System.ComponentModel;

namespace PanCardView.Controls
{
Expand All @@ -19,5 +19,10 @@ public RightArrowControl()
Text = ""
};
}

[EditorBrowsable(EditorBrowsableState.Never)]
public new static void Preserve()
{
}
}
}
6 changes: 6 additions & 0 deletions PanCardView/CoverFlowView.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Specialized;
using System.ComponentModel;
using PanCardView.Extensions;
using PanCardView.Processors;
using Xamarin.Forms;
Expand Down Expand Up @@ -48,6 +49,11 @@ public double PositionShiftValue
set => SetValue(PositionShiftValueProperty, value);
}

[EditorBrowsable(EditorBrowsableState.Never)]
public new static void Preserve()
{
}

protected override int DefaultBackViewsDepth => 2;

protected override int DefaultMaxChildrenCount => 17;
Expand Down
20 changes: 20 additions & 0 deletions PanCardView/Preserver.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using PanCardView.Controls;
namespace PanCardView
{
public static class Preserver
{
public static void Preserve()
{
CardsView.Preserve();
CarouselView.Preserve();
CoverFlowView.Preserve();
ArrowControl.Preserve();
LeftArrowControl.Preserve();
RightArrowControl.Preserve();
CircleFrame.Preserve();
IndicatorItemView.Preserve();
IndicatorsControl.Preserve();
ParentScrollView.Preserve();
}
}
}

0 comments on commit f909a62

Please sign in to comment.