Skip to content

Commit

Permalink
Improve sample
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed Jul 29, 2024
1 parent 5b90dba commit bda3401
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 30 deletions.
18 changes: 14 additions & 4 deletions samples/SwipeCardView.Sample.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,30 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SwipeCardView.Sample", "SwipeCardView.Sample\SwipeCardView.Sample.csproj", "{FFFB25DF-5B56-456D-A43D-21A12DEB266B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SwipeCardView.Sample", "SwipeCardView.Sample\SwipeCardView.Sample.csproj", "{FFFB25DF-5B56-456D-A43D-21A12DEB266B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plugin.Maui.SwipeCardView", "..\src\Plugin.Maui.SwipeCardView\Plugin.Maui.SwipeCardView.csproj", "{02605263-CEB5-4A54-BFF1-1ABD22AEACBE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FFFB25DF-5B56-456D-A43D-21A12DEB266B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFFB25DF-5B56-456D-A43D-21A12DEB266B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFFB25DF-5B56-456D-A43D-21A12DEB266B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{FFFB25DF-5B56-456D-A43D-21A12DEB266B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFFB25DF-5B56-456D-A43D-21A12DEB266B}.Release|Any CPU.Build.0 = Release|Any CPU
{02605263-CEB5-4A54-BFF1-1ABD22AEACBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{02605263-CEB5-4A54-BFF1-1ABD22AEACBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{02605263-CEB5-4A54-BFF1-1ABD22AEACBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{02605263-CEB5-4A54-BFF1-1ABD22AEACBE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EC90BD18-ECDF-4F96-AFEF-248CF30B4FB7}
EndGlobalSection
EndGlobal
4 changes: 3 additions & 1 deletion samples/SwipeCardView.Sample/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SwipeCardView.Sample.MainPage"
Title="SwipeCardView">
Shell.BackgroundColor="{x:StaticResource Primary}"
Shell.TitleColor="{x:StaticResource White}"
Title="SwipeCardView Samples">

<VerticalStackLayout Spacing="5"
HorizontalOptions="Center"
Expand Down
4 changes: 2 additions & 2 deletions samples/SwipeCardView.Sample/ViewModels/BasePageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SwipeCardView.Sample.ViewModels;

public abstract class BasePageViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangedEventHandler? PropertyChanged;

protected void RaisePropertyChanged([CallerMemberName] string name = null) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
protected void RaisePropertyChanged([CallerMemberName] string? name = null) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
6 changes: 4 additions & 2 deletions samples/SwipeCardView.Sample/Views/ColorsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:swipeCardView="clr-namespace:Plugin.Maui.SwipeCardView;assembly=Plugin.Maui.SwipeCardView"
x:Class="SwipeCardView.Sample.Views.ColorsPage"
Shell.BackgroundColor="{x:StaticResource Primary}"
Shell.TitleColor="{x:StaticResource White}"
Title="Colors Page">
<ContentPage.Content>

<StackLayout Padding="10">
<swipeCardView:SwipeCardView
x:Name="SwipeCardView"
Expand Down Expand Up @@ -32,5 +34,5 @@
<Button Text="Add 5 Items" Command="{Binding AddItemsCommand}"></Button>
</StackLayout>
</StackLayout>
</ContentPage.Content>

</ContentPage>
2 changes: 2 additions & 0 deletions samples/SwipeCardView.Sample/Views/CustomizablePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
xmlns:swipeCardView="clr-namespace:Plugin.Maui.SwipeCardView;assembly=Plugin.Maui.SwipeCardView"
xmlns:local="clr-namespace:SwipeCardView.Sample"
x:Class="SwipeCardView.Sample.Views.CustomizablePage"
Shell.BackgroundColor="{x:StaticResource Primary}"
Shell.TitleColor="{x:StaticResource White}"
Title="Customizable Page">

<StackLayout Padding="10">
Expand Down
34 changes: 17 additions & 17 deletions samples/SwipeCardView.Sample/Views/SimplePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:swipeCardView="clr-namespace:Plugin.Maui.SwipeCardView;assembly=Plugin.Maui.SwipeCardView"
Shell.BackgroundColor="{x:StaticResource Primary}"
Shell.TitleColor="{x:StaticResource White}"
x:Class="SwipeCardView.Sample.Views.SimplePage">

<ContentPage.Content>
<StackLayout Padding="10">
<swipeCardView:SwipeCardView
<StackLayout Padding="10">
<swipeCardView:SwipeCardView
ItemsSource="{Binding CardItems}"
SwipedCommand="{Binding SwipedCommand}"
LoopCards="{Binding IsLoopCards}"
VerticalOptions="FillAndExpand">
<swipeCardView:SwipeCardView.ItemTemplate>
<DataTemplate>
<Label Text="{Binding .}" FontSize="Large" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="Beige" />
</DataTemplate>
</swipeCardView:SwipeCardView.ItemTemplate>
</swipeCardView:SwipeCardView>
<Label Text="{Binding Message}" HorizontalOptions="CenterAndExpand" />
<StackLayout Orientation="Horizontal" HorizontalOptions="Center" VerticalOptions="Center">
<Label Text="Loop Cards" />
<Switch IsToggled="{Binding IsLoopCards}" />
</StackLayout>
<Button Text="Clear Items" Command="{Binding ClearItemsCommand}"></Button>
<Button Text="Add 5 Items" Command="{Binding AddItemsCommand}"></Button>
<swipeCardView:SwipeCardView.ItemTemplate>
<DataTemplate>
<Label Text="{Binding .}" FontSize="Large" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="Beige" />
</DataTemplate>
</swipeCardView:SwipeCardView.ItemTemplate>
</swipeCardView:SwipeCardView>
<Label Text="{Binding Message}" HorizontalOptions="CenterAndExpand" />
<StackLayout Orientation="Horizontal" HorizontalOptions="Center" VerticalOptions="Center">
<Label Text="Loop Cards" />
<Switch IsToggled="{Binding IsLoopCards}" />
</StackLayout>
</ContentPage.Content>
<Button Text="Clear Items" Command="{Binding ClearItemsCommand}"></Button>
<Button Text="Add 5 Items" Command="{Binding AddItemsCommand}"></Button>
</StackLayout>

</ContentPage>
10 changes: 6 additions & 4 deletions samples/SwipeCardView.Sample/Views/TinderPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
xmlns:swipeCardView="clr-namespace:Plugin.Maui.SwipeCardView;assembly=Plugin.Maui.SwipeCardView"
x:Class="SwipeCardView.Sample.Views.TinderPage"
BackgroundColor="#EEE"
Shell.BackgroundColor="{x:StaticResource Primary}"
Shell.TitleColor="{x:StaticResource White}"
Title ="Tinder">
<ContentPage.Content>

<StackLayout>
<swipeCardView:SwipeCardView
x:Name="SwipeCardView"
Expand Down Expand Up @@ -52,7 +54,7 @@
</DataTemplate>
</swipeCardView:SwipeCardView.ItemTemplate>
</swipeCardView:SwipeCardView>
<StackLayout Orientation="Horizontal" HorizontalOptions="Center" Padding="10, 10, 10, 20" Spacing="30">
<HorizontalStackLayout HorizontalOptions="Center" Padding="10, 10, 10, 20" Spacing="30">
<StackLayout>
<Button x:Name="nopeButton" ImageSource="ic_tinder_nope.png" Clicked="OnDislikeClicked" WidthRequest="60" HeightRequest="60" CornerRadius="30" BackgroundColor="White" Scale="1"></Button>
</StackLayout>
Expand All @@ -62,7 +64,7 @@
<StackLayout>
<Button x:Name="likeButton" ImageSource="ic_tinder_like.png" Clicked="OnLikeClicked" WidthRequest="60" HeightRequest="60" CornerRadius="30" BackgroundColor="White" Scale="1"></Button>
</StackLayout>
</StackLayout>
</HorizontalStackLayout>
</StackLayout>
</ContentPage.Content>

</ContentPage>

0 comments on commit bda3401

Please sign in to comment.