Skip to content

Commit

Permalink
opened internal classes and small processors fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiMisiukevich committed Mar 1, 2018
1 parent 7c4bebb commit 44f8f1f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions PanCardView/Extensions/CardViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

namespace PanCardView.Extensions
{
internal static class CardViewExtensions
public static class CardViewExtensions
{
internal static CardsView AsCardView(this BindableObject bindable)
public static CardsView AsCardView(this BindableObject bindable)
=> bindable as CardsView;

internal static IndicatorsControl AsIndicatorsControl(this BindableObject bindable)
public static IndicatorsControl AsIndicatorsControl(this BindableObject bindable)
=> bindable as IndicatorsControl;
}
}
4 changes: 2 additions & 2 deletions PanCardView/Extensions/IntExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
namespace PanCardView.Extensions
{
internal static class IntExtensions
public static class IntExtensions
{
internal static int ToRecycledIndex(this int index, int itemsCount)
public static int ToRecycledIndex(this int index, int itemsCount)
{
if (itemsCount <= 0)
{
Expand Down
11 changes: 5 additions & 6 deletions PanCardView/Processors/BaseCardFrontViewProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Xamarin.Forms;
using Xamarin.Forms;
using System.Threading.Tasks;
using PanCardView.Enums;
using static PanCardView.Processors.Constants;
Expand Down Expand Up @@ -32,16 +31,16 @@ public virtual void AutoNavigate(View view, CardsView cardsView, PanItemPosition

public virtual void HandlePanChanged(View view, CardsView cardsView, double xPos, PanItemPosition panItemPosition)
{
var multiplier = 0.3;
var multiplier = 1;
if (panItemPosition == PanItemPosition.Null)
{
xPos = Sign(xPos) * Min(Abs(xPos / 4), 20);
xPos = Sign(xPos) * Min(Abs(xPos / 4), 25);
multiplier = -multiplier;
}

view.TranslationX = xPos;
view.TranslationY = Abs(xPos) / 10;
view.Rotation = multiplier * Rad * (xPos / cardsView.Width);
view.TranslationY = multiplier * Abs(xPos) / 10;
view.Rotation = multiplier * 0.3 * Rad * (xPos / cardsView.Width);
}

public virtual Task HandlePanReset(View view, CardsView cardsView, PanItemPosition panItemPosition)
Expand Down
4 changes: 2 additions & 2 deletions PanCardView/Processors/BaseCarouselBackViewProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
using System.Threading.Tasks;
using PanCardView.Enums;
using Xamarin.Forms;

using static System.Math;

namespace PanCardView.Processors
Expand Down
2 changes: 1 addition & 1 deletion PanCardView/Processors/BaseCarouselFrontViewProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public virtual void HandlePanChanged(View view, CardsView cardsView, double xPos

if (panItemPosition == PanItemPosition.Null)
{
xPos = Sign(xPos) * Min(Abs(xPos / 4), 20);
xPos = Sign(xPos) * Min(Abs(xPos / 4), 25);
}

view.TranslationX = xPos;
Expand Down

0 comments on commit 44f8f1f

Please sign in to comment.