Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Maui Compatibility #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion samples/SwipeCardView.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public static MauiApp CreateMauiApp()
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseSwipeCardView()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
Expand Down
8 changes: 6 additions & 2 deletions samples/SwipeCardView.Sample/SwipeCardView.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.92" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../../src/Plugin.Maui.SwipeCardView/Plugin.Maui.SwipeCardView.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.92" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/SwipeCardView.Sample/Views/ColorsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Threshold="100">
<swipeCardView:SwipeCardView.ItemTemplate>
<DataTemplate>
<Frame CornerRadius="10" Padding="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Frame CornerRadius="10" Padding="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" InputTransparent="True">
<StackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
<Label Text="{Binding .}" FontSize="Large" />
<Label x:Name="DirectionLabel" />
Expand Down
2 changes: 1 addition & 1 deletion samples/SwipeCardView.Sample/Views/CustomizablePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
LoopCards="{Binding IsLoopCards}">
<swipeCardView:SwipeCardView.ItemTemplate>
<DataTemplate>
<Frame CornerRadius="10" Padding="0" BorderColor="Orange" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Beige">
<Frame CornerRadius="10" Padding="0" BorderColor="Orange" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Beige" InputTransparent="True">
<StackLayout HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
<Label Text="{Binding .}" FontSize="Large" />
<Label x:Name="DirectionLabel" />
Expand Down
2 changes: 1 addition & 1 deletion samples/SwipeCardView.Sample/Views/TinderPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<swipeCardView:SwipeCardView.ItemTemplate>
<DataTemplate>
<StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Frame CornerRadius="10" Padding="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Frame CornerRadius="10" Padding="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" InputTransparent="True">
<AbsoluteLayout>
<Image Source="{Binding Photo}" Aspect="AspectFill" AbsoluteLayout.LayoutBounds=".5,0.5,1,1" AbsoluteLayout.LayoutFlags="All" />
<Frame x:Name="LikeFrame" BorderColor="#63DD99" BackgroundColor="Transparent" Padding="0" CornerRadius="20" AbsoluteLayout.LayoutBounds="0.1,.1, 150, 50"
Expand Down
21 changes: 0 additions & 21 deletions src/Plugin.Maui.SwipeCardView/AppBuilderExtensions.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.92" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>

<!-- Package additions -->
<ItemGroup>
<None Include="..\..\nuget.png" PackagePath="icon.png" Pack="true" />
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.92" />
</ItemGroup>
</Project>
31 changes: 31 additions & 0 deletions src/Plugin.Maui.SwipeCardView/SwipeCardDirectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Plugin.Maui.SwipeCardView.Core;

namespace Plugin.Maui.SwipeCardView;

internal static class SwipeCardDirectionExtensions
{
public static bool IsLeft(this SwipeCardDirection self)
{
return (self & SwipeCardDirection.Left) == SwipeCardDirection.Left;
}

public static bool IsRight(this SwipeCardDirection self)
{
return (self & SwipeCardDirection.Right) == SwipeCardDirection.Right;
}

public static bool IsUp(this SwipeCardDirection self)
{
return (self & SwipeCardDirection.Up) == SwipeCardDirection.Up;
}

public static bool IsDown(this SwipeCardDirection self)
{
return (self & SwipeCardDirection.Down) == SwipeCardDirection.Down;
}

public static bool IsSupported(this SwipeCardDirection self, SwipeCardDirection other)
{
return (self & other) == other;
}
}
Loading