Skip to content

Commit f909a62

Browse files
https://github.com/AndreiMisiukevich/CardView/issues/175
1 parent c068993 commit f909a62

13 files changed

+65
-24
lines changed

PanCardView.Droid/CardsViewRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public CardsViewRenderer(Context context) : base(context)
3535
}
3636

3737
public static void Preserve()
38-
=> CardsView.Preserve();
38+
=> Preserver.Preserve();
3939

4040
public override bool OnInterceptTouchEvent(MotionEvent ev)
4141
{

PanCardView.iOS/CardsViewRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class CardsViewRenderer : VisualElementRenderer<CardsView>
1818
private readonly UISwipeGestureRecognizer _downSwipeGesture;
1919

2020
public static void Preserve()
21-
=> CardsView.Preserve();
21+
=> Preserver.Preserve();
2222

2323
public CardsViewRenderer()
2424
{

PanCardView/CardsView.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.Runtime.CompilerServices;
1818
using PanCardView.EventArgs;
1919
using PanCardView.Delegates;
20+
using System.ComponentModel;
2021

2122
namespace PanCardView
2223
{
@@ -432,24 +433,9 @@ public ICommand ItemSwipedCommand
432433

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

436+
[EditorBrowsable(EditorBrowsableState.Never)]
435437
public static void Preserve()
436438
{
437-
ArrowControl.Preserve();
438-
CircleFrame.Preserve();
439-
IndicatorsControl.Preserve();
440-
ParentScrollView.Preserve();
441-
new List<Type>
442-
{
443-
typeof(CarouselView),
444-
typeof(CoverFlowView),
445-
typeof(ArrowControl),
446-
typeof(LeftArrowControl),
447-
typeof(RightArrowControl),
448-
typeof(CircleFrame),
449-
typeof(IndicatorItemView),
450-
typeof(IndicatorsControl),
451-
typeof(ParentScrollView)
452-
}.Clear();
453439
}
454440

455441
public void OnPanUpdated(object sender, PanUpdatedEventArgs e)

PanCardView/CarouselView.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using PanCardView.Processors;
2+
using System.ComponentModel;
23

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

1819
protected override bool DefaultIsCyclical => true;
20+
21+
[EditorBrowsable(EditorBrowsableState.Never)]
22+
public new static void Preserve()
23+
{
24+
}
1925
}
2026
}

PanCardView/Controls/ArrowControl.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using PanCardView.Extensions;
55
using PanCardView.Utility;
66
using System.Threading.Tasks;
7+
using System.ComponentModel;
78

89
namespace PanCardView.Controls
910
{
@@ -124,7 +125,8 @@ public ArrowControl()
124125
});
125126
}
126127

127-
public static void Preserve()
128+
[EditorBrowsable(EditorBrowsableState.Never)]
129+
public new static void Preserve()
128130
{
129131
}
130132

PanCardView/Controls/CircleFrame.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using PanCardView.Extensions;
1+
using System.ComponentModel;
2+
using PanCardView.Extensions;
23
using Xamarin.Forms;
34

45
namespace PanCardView.Controls
@@ -19,6 +20,7 @@ public CircleFrame()
1920
Padding = 0;
2021
}
2122

23+
[EditorBrowsable(EditorBrowsableState.Never)]
2224
public static void Preserve()
2325
{
2426
}

PanCardView/Controls/IndicatorItemView.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Xamarin.Forms;
1+
using System.ComponentModel;
22

33
namespace PanCardView.Controls
44
{
@@ -8,5 +8,10 @@ public IndicatorItemView()
88
{
99
Size = 10;
1010
}
11+
12+
[EditorBrowsable(EditorBrowsableState.Never)]
13+
public new static void Preserve()
14+
{
15+
}
1116
}
1217
}

PanCardView/Controls/IndicatorsControl.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Threading.Tasks;
99
using System.Threading;
1010
using PanCardView.Utility;
11+
using System.ComponentModel;
1112

1213
namespace PanCardView.Controls
1314
{
@@ -155,6 +156,7 @@ public int ToFadeDuration
155156

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

159+
[EditorBrowsable(EditorBrowsableState.Never)]
158160
public static void Preserve()
159161
{
160162
}

PanCardView/Controls/LeftArrowControl.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using PanCardView.Extensions;
1+
using System.ComponentModel;
22
using Xamarin.Forms;
33

44
namespace PanCardView.Controls
@@ -21,5 +21,10 @@ public LeftArrowControl()
2121
Rotation = 180
2222
};
2323
}
24+
25+
[EditorBrowsable(EditorBrowsableState.Never)]
26+
public new static void Preserve()
27+
{
28+
}
2429
}
2530
}

PanCardView/Controls/ParentScrollView.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
using Xamarin.Forms;
1+
using System.ComponentModel;
2+
using Xamarin.Forms;
23

34
namespace PanCardView.Controls
45
{
56
public class ParentScrollView : ScrollView, IOrdinateHandlerParentView
67
{
78
private double _prevY;
89

10+
[EditorBrowsable(EditorBrowsableState.Never)]
911
public static void Preserve()
1012
{
1113
}

PanCardView/Controls/RightArrowControl.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Xamarin.Forms;
2-
using PanCardView.Extensions;
2+
using System.ComponentModel;
33

44
namespace PanCardView.Controls
55
{
@@ -19,5 +19,10 @@ public RightArrowControl()
1919
Text = "➤"
2020
};
2121
}
22+
23+
[EditorBrowsable(EditorBrowsableState.Never)]
24+
public new static void Preserve()
25+
{
26+
}
2227
}
2328
}

PanCardView/CoverFlowView.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Specialized;
2+
using System.ComponentModel;
23
using PanCardView.Extensions;
34
using PanCardView.Processors;
45
using Xamarin.Forms;
@@ -48,6 +49,11 @@ public double PositionShiftValue
4849
set => SetValue(PositionShiftValueProperty, value);
4950
}
5051

52+
[EditorBrowsable(EditorBrowsableState.Never)]
53+
public new static void Preserve()
54+
{
55+
}
56+
5157
protected override int DefaultBackViewsDepth => 2;
5258

5359
protected override int DefaultMaxChildrenCount => 17;

PanCardView/Preserver.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using PanCardView.Controls;
2+
namespace PanCardView
3+
{
4+
public static class Preserver
5+
{
6+
public static void Preserve()
7+
{
8+
CardsView.Preserve();
9+
CarouselView.Preserve();
10+
CoverFlowView.Preserve();
11+
ArrowControl.Preserve();
12+
LeftArrowControl.Preserve();
13+
RightArrowControl.Preserve();
14+
CircleFrame.Preserve();
15+
IndicatorItemView.Preserve();
16+
IndicatorsControl.Preserve();
17+
ParentScrollView.Preserve();
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)