Skip to content

Commit

Permalink
working ios sample maui version released (3.0.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
roubachof committed Dec 7, 2022
1 parent 7e1eb5f commit 8451764
Show file tree
Hide file tree
Showing 66 changed files with 4,626 additions and 599 deletions.
3 changes: 3 additions & 0 deletions Docs/maui_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions Maui/MauiSample/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

using Sharpnado.CollectionView;
using Sharpnado.Tabs;
using SkiaSharp.Views.Maui.Controls.Hosting;

namespace MauiSample;

Expand All @@ -16,9 +15,8 @@ public static MauiApp CreateMauiApp()
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseSkiaSharp()
.UseSharpnadoTabs(loggerEnable: false)
.UseSharpnadoCollectionView(loggerEnable: false)
.UseSharpnadoCollectionView(loggerEnable: true, debugLogEnable: false)
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
Expand Down
33 changes: 15 additions & 18 deletions Maui/MauiSample/MauiSample.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net6.0-ios;net6.0-android</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
Expand All @@ -12,7 +11,7 @@
<ImplicitUsings>enable</ImplicitUsings>

<!-- Display name -->
<ApplicationTitle>MauiSample</ApplicationTitle>
<ApplicationTitle>MauiCollectionView</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.sharpnado.collectionview</ApplicationId>
Expand All @@ -30,12 +29,21 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0-ios|AnyCPU'">
<MtouchLink>None</MtouchLink>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net6.0-ios'">
<CodesignKey>Apple Development: Created via API (K8Q3S2AN24)</CodesignKey>
<CodesignProvision>VS: WildCard Development</CodesignProvision>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\logo.png" Color="#d81b60" BaseSize="256,128" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<MauiSplashScreen Include="Resources\Splash\logo.png" Color="#d81b60" BaseSize="256,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
Expand All @@ -55,23 +63,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AlohaKit" Version="1.0.74" />
<PackageReference Include="Sharpnado.Maui.TaskLoaderView" Version="2.5.1" />
<PackageReference Include="Sharpnado.Tabs.Maui" Version="3.0.0" />
<PackageReference Include="SimpleInjector" Version="5.4.1" />
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="2.88.3" />
<PackageReference Include="SkiaSharp.Views.Maui.Core" Version="2.88.3" />
</ItemGroup>

<ItemGroup>
<MauiXaml Update="Resources\Styles\Shadows.xaml">
<SubType>Designer</SubType>
</MauiXaml>
<MauiXaml Update="Resources\Styles\Text.xaml">
<SubType>Designer</SubType>
</MauiXaml>
<MauiXaml Update="Resources\Styles\Border.xaml">
<SubType>Designer</SubType>
</MauiXaml>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionMauiSampleHideInfoBar="True" /></VisualStudio></ProjectExtensions>

</Project>
9 changes: 8 additions & 1 deletion Maui/MauiSample/MauiSample.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiSample", "MauiSample.csproj", "{ADABD103-2CEE-40B2-9EC4-BDA08DB009D8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sharpnado.CollectionView.Maui", "..\Sharpnado.CollectionView.Maui\Sharpnado.CollectionView.Maui.csproj", "{6CBC693C-5270-448E-BE40-3E03B713BBC7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sharpnado.CollectionView.Maui", "..\Sharpnado.CollectionView.Maui\Sharpnado.CollectionView.Maui.csproj", "{6CBC693C-5270-448E-BE40-3E03B713BBC7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "configuration", "configuration", "{E6CDC5C8-6D84-4EFF-BB42-1F92ED8D06DE}"
ProjectSection(SolutionItems) = preProject
..\..\README.md = ..\..\README.md
..\..\Settings.XamlStyler = ..\..\Settings.XamlStyler
..\..\StyleCopRules.ruleset = ..\..\StyleCopRules.ruleset
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
28 changes: 17 additions & 11 deletions Maui/MauiSample/Presentation/Views/ChoosePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@
xmlns:converters="clr-namespace:MauiSample.Presentation.Converters"
xmlns:sho="http://sharpnado.com"
xmlns:viewModels="clr-namespace:MauiSample.Presentation.ViewModels"
Padding="0"
x:DataType="viewModels:ChoosePageViewModel"
BackgroundColor="{StaticResource DarkerSurface}"
NavigationPage.HasNavigationBar="False">
<StackLayout>
<VerticalStackLayout>
<VerticalStackLayout.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS">0, -45, 0, -35</On>
<On Platform="Android">0</On>
</OnPlatform>
</VerticalStackLayout.Margin>

<StackLayout
<VerticalStackLayout
BackgroundColor="{StaticResource DarkSurface}"
Orientation="Vertical"
Shadow="{StaticResource DarkBottomShadow}"
Spacing="0">
<StackLayout.Padding>
<VerticalStackLayout.Padding>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS">20, 60, 20, 20</On>
<On Platform="Android">20, 40, 20, 20</On>
</OnPlatform>
</StackLayout.Padding>
</VerticalStackLayout.Padding>

<Grid ColumnDefinitions="*, 60" RowDefinitions="Auto,Auto">
<Label
Expand Down Expand Up @@ -49,18 +55,18 @@
Text="MAUI"
TextColor="{StaticResource Accent}" />
</Grid>
</StackLayout>
</VerticalStackLayout>

<!-- HorizontalListView Logo -->
<sho:GridView
x:Name="HorizontalListView"
CollectionPadding="30,30,30,0"
CollectionPadding="30"
ColumnCount="3"
EnableDragAndDrop="True"
HeightRequest="360"
HeightRequest="390"
HorizontalOptions="Fill"
ItemHeight="110"
ItemsSource="{Binding Logo, Mode=OneTime}"
VerticalOptions="Fill"
ZIndex="100">
<sho:GridView.ItemTemplate>
<DataTemplate x:DataType="viewModels:LogoLetterVmo">
Expand Down Expand Up @@ -126,7 +132,7 @@
</sho:GridView>

<StackLayout
Margin="0,30"
Margin="0,15"
Spacing="20"
ZIndex="10">
<Button
Expand All @@ -153,5 +159,5 @@

</StackLayout>

</StackLayout>
</VerticalStackLayout>
</ContentPage>
13 changes: 12 additions & 1 deletion Maui/MauiSample/Presentation/Views/ChoosePage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using MauiSample.Presentation.Navigables;
using System.Collections.ObjectModel;

using MauiSample.Presentation.Navigables;
using MauiSample.Presentation.Navigables.Impl;
using MauiSample.Presentation.ViewModels;
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;

namespace MauiSample.Presentation.Views
{
Expand All @@ -14,6 +18,13 @@ public ChoosePage(FormsNavigationService navigationService)
_navigationService = navigationService;

InitializeComponent();
On<iOS>().SetUseSafeArea(false);
}

protected override void OnAppearing()
{
base.OnAppearing();
Padding = new Thickness(0);
}

private async void LayoutButton_OnClicked(object sender, EventArgs e)
Expand Down
90 changes: 29 additions & 61 deletions Maui/MauiSample/Presentation/Views/GridPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
xmlns:taskLoaderView="clr-namespace:Sharpnado.TaskLoaderView;assembly=Sharpnado.Maui.TaskLoaderView"
xmlns:viewModels="clr-namespace:MauiSample.Presentation.ViewModels"
xmlns:views="clr-namespace:MauiSample.Presentation.Views"
Padding="0"
x:DataType="viewModels:GridPageViewModel"
BackgroundColor="{StaticResource DarkerSurface}"
NavigationPage.HasNavigationBar="False">
Expand All @@ -35,7 +36,7 @@
Binding="{Binding Source={x:Reference DraggableViewCell}, Path=IsDragAndDropping}"
TargetType="views:SillyGridCell"
Value="True">
<Setter Property="Background" Value="{StaticResource DarklessSurface}" />
<Setter Property="Background" Value="{StaticResource DarkDraggedSurface}" />
</DataTrigger>
</views:SillyGridCell.Triggers>
</views:SillyGridCell>
Expand All @@ -55,7 +56,7 @@
Binding="{Binding Source={x:Reference DraggableViewCell}, Path=IsDragAndDropping}"
TargetType="views:SillyHorizontalCell"
Value="True">
<Setter Property="Background" Value="{StaticResource DarklessSurface}" />
<Setter Property="Background" Value="{StaticResource DarkDraggedSurface}" />
</DataTrigger>
</views:SillyHorizontalCell.Triggers>
</views:SillyHorizontalCell>
Expand All @@ -75,7 +76,7 @@
Binding="{Binding Source={x:Reference DraggableViewCell}, Path=IsDragAndDropping}"
TargetType="views:SillyListCell"
Value="True">
<Setter Property="Background" Value="{StaticResource DarklessSurface}" />
<Setter Property="Background" Value="{StaticResource DarkDraggedSurface}" />
</DataTrigger>
</views:SillyListCell.Triggers>
</views:SillyListCell>
Expand All @@ -94,13 +95,19 @@

<ContentPage.Content>
<Grid RowDefinitions="Auto,*">
<Grid.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS">0, -45, 0, -35</On>
<On Platform="Android">0</On>
</OnPlatform>
</Grid.Margin>

<taskLoaderView:TaskLoaderView
Grid.Row="1"
IsClippedToBounds="False"
Style="{StaticResource SillyTaskLoader}"
TaskLoaderNotifier="{Binding SillyPeopleLoaderNotifier}"
VerticalOptions="FillAndExpand">
VerticalOptions="Fill">
<RefreshView
Command="{Binding SillyPeopleLoaderNotifier.RefreshCommand}"
IsClippedToBounds="False"
Expand All @@ -127,53 +134,6 @@
ScrollEndedCommand="{Binding OnScrollEndCommand}"
TapCommand="{Binding TapCommand}" />


<!-- Testing the ViewCacheSize property -->
<!--<sho:CollectionView
x:Name="HorizontalListView"
CollectionLayout="{Binding Mode, Converter={converters:ListModeToListLayout}}"
CollectionLayoutChanging="ListLayoutChanging"
CollectionPadding="10,30,10,75"
ColumnCount="2"
CurrentIndex="{Binding CurrentIndex}"
DragAndDropEndedCommand="{Binding OnDragEnded}"
DragAndDropStartedCommand="{Binding OnDragStarted}"
DragAndDropTrigger="Pan"
EnableDragAndDrop="{Binding Source={x:Reference DragAndDropSwitch}, Path=IsToggled}"
InfiniteListLoader="{Binding SillyPeoplePaginator}"
ItemHeight="120"
ItemWidth="120"
ItemsSource="{Binding SillyPeople}"
ScrollBeganCommand="{Binding OnScrollBeginCommand}"
ScrollEndedCommand="{Binding OnScrollEndCommand}"
TapCommand="{Binding TapCommand}"
ViewCacheSize="100">
<sho:CollectionView.ItemTemplate>
<DataTemplate>
<sho:DraggableViewCell x:Name="DraggableViewCell">
<sho:Shadows
x:Name="Shadow"
CornerRadius="10"
Shades="{StaticResource ThinDarkerNeumorphism}">
<views:SillyGridCell
Margin="16,13,16,13"
BackgroundColor="{StaticResource DarkerSurface}"
CornerRadius="10">
<views:SillyGridCell.Triggers>
<DataTrigger
Binding="{Binding Source={x:Reference DraggableViewCell}, Path=IsDragAndDropping}"
TargetType="views:SillyGridCell"
Value="True">
<Setter Property="BackgroundColor" Value="{StaticResource DarkSurface}" />
</DataTrigger>
</views:SillyGridCell.Triggers>
</views:SillyGridCell>
</sho:Shadows>
</sho:DraggableViewCell>
</DataTemplate>
</sho:CollectionView.ItemTemplate>
</sho:CollectionView>-->

</RefreshView>
</taskLoaderView:TaskLoaderView>

Expand All @@ -188,7 +148,7 @@
</OnPlatform>
</VerticalStackLayout.Padding>

<Grid ColumnDefinitions="60,*, 60" RowDefinitions="30, 30, 50">
<Grid ColumnDefinitions="60,*, 60" RowDefinitions="30, 30, 15, 40">
<ImageButton
Grid.RowSpan="2"
BackgroundColor="{StaticResource DarkSurface}"
Expand Down Expand Up @@ -233,39 +193,47 @@
</Image>

<HorizontalStackLayout
Grid.Row="2"
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="3"
HeightRequest="40"
HorizontalOptions="End"
Spacing="10">

<HorizontalStackLayout
Margin="16,0,0,0"
Spacing="10"
VerticalOptions="End">
VerticalOptions="Fill">
<Label
Margin="0,0,0,2"
FontSize="12"
Text="Drag and Drop"
TextColor="White"
VerticalOptions="Center" />
VerticalOptions="Center"
VerticalTextAlignment="Center" />
<Switch x:Name="DragAndDropSwitch" VerticalOptions="Center" />
</HorizontalStackLayout>

<HorizontalStackLayout x:Name="ColumnCountContainer" VerticalOptions="End">
<HorizontalStackLayout x:Name="ColumnCountContainer" VerticalOptions="Fill">
<Label
Margin="0,0,0,2"
FontSize="12"
Text="Column Count"
TextColor="White"
VerticalOptions="Center" />
VerticalOptions="Center"
VerticalTextAlignment="Center" />
<Picker
x:Name="ColumnPicker"
Margin="10,0,0,0"
BackgroundColor="{StaticResource DarkSurface}"
FontAttributes="Bold"
FontSize="15"
TextColor="{StaticResource Primary}" />
FontSize="18"
TextColor="{StaticResource Primary}">
<Picker.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS">10,-5,0,0</On>
<On Platform="Android">10,0,0,0</On>
</OnPlatform>
</Picker.Margin>
</Picker>
</HorizontalStackLayout>
</HorizontalStackLayout>

Expand Down
5 changes: 5 additions & 0 deletions Maui/MauiSample/Presentation/Views/GridPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using MauiSample.Presentation.Navigables;
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;

using Sharpnado.CollectionView;

namespace MauiSample.Presentation.Views
Expand All @@ -12,6 +15,8 @@ public GridPage()
{
InitializeComponent();

On<iOS>().SetUseSafeArea(false);

HorizontalListView.PreRevealAnimationAsync = async (viewCell) =>
{
viewCell.View.Opacity = 0;
Expand Down
Loading

0 comments on commit 8451764

Please sign in to comment.