Skip to content

Commit

Permalink
updated to .net7, sample to .net8, added update layout command
Browse files Browse the repository at this point in the history
  • Loading branch information
roubachof committed Jan 15, 2024
1 parent c6759dc commit 7e524dd
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Maui/MauiSample/Domain/Silly/SillyDudeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public SillyDudeService(ErrorEmulator errorEmulator)
#if LOCAL_DATA
"will_ferrell.jpg",
#else
"https://news.usc.edu/files/2017/03/Will-Ferrell-Step-Brothers_Horizontal_web-824x549.jpg",
"https://cdn.britannica.com/43/219743-050-DA91906B/American-actor-and-writer-Will-Ferrell-2015.jpg",
#endif
4,
string.Empty,
Expand Down
7 changes: 1 addition & 6 deletions Maui/MauiSample/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using MauiSample.Domain.Silly;
using MauiSample.Infrastructure;
using MauiSample.Presentation.Navigables;
using MauiSample.Presentation.Navigables.Impl;

using Sharpnado.CollectionView;
using Sharpnado.CollectionView;
using Sharpnado.Tabs;

namespace MauiSample;
Expand Down
2 changes: 1 addition & 1 deletion Maui/MauiSample/MauiSample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0-ios;net6.0-android</TargetFrameworks>
<TargetFrameworks>net8.0-ios;net8.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 Down
60 changes: 30 additions & 30 deletions Maui/MauiSample/Presentation/Views/GridPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
<sho:DraggableViewCell x:Name="DraggableViewCell">
<ContentView>
<views:SillyGridCell
Style="{StaticResource BorderDarkerNeumorphismBottom}"
Margin="10"
Background="{StaticResource DarkSurface}"
Style="{StaticResource BorderDarkerNeumorphismBottom}">
Background="{StaticResource DarkSurface}">
<views:SillyGridCell.Triggers>
<DataTrigger
Binding="{Binding Source={x:Reference DraggableViewCell}, Path=IsDragAndDropping}"
Expand All @@ -48,9 +48,9 @@
<sho:DraggableViewCell x:Name="DraggableViewCell">
<ContentView>
<views:SillyHorizontalCell
Style="{StaticResource BorderDarkerNeumorphismBottom}"
Margin="10"
Background="{StaticResource DarkSurface}"
Style="{StaticResource BorderDarkerNeumorphismBottom}">
Background="{StaticResource DarkSurface}">
<views:SillyHorizontalCell.Triggers>
<DataTrigger
Binding="{Binding Source={x:Reference DraggableViewCell}, Path=IsDragAndDropping}"
Expand All @@ -68,9 +68,9 @@
<sho:DraggableViewCell x:Name="DraggableViewCell">
<ContentView>
<views:SillyListCell
Style="{StaticResource BorderDarkerNeumorphismBottom}"
Margin="16,8"
Background="{StaticResource DarkSurface}"
Style="{StaticResource BorderDarkerNeumorphismBottom}">
Background="{StaticResource DarkSurface}">
<views:SillyListCell.Triggers>
<DataTrigger
Binding="{Binding Source={x:Reference DraggableViewCell}, Path=IsDragAndDropping}"
Expand Down Expand Up @@ -104,10 +104,10 @@

<taskLoaderView:TaskLoaderView
Grid.Row="1"
IsClippedToBounds="False"
Style="{StaticResource SillyTaskLoader}"
TaskLoaderNotifier="{Binding SillyPeopleLoaderNotifier}"
VerticalOptions="Fill">
VerticalOptions="Fill"
IsClippedToBounds="False"
TaskLoaderNotifier="{Binding SillyPeopleLoaderNotifier}">
<RefreshView
Command="{Binding SillyPeopleLoaderNotifier.RefreshCommand}"
IsClippedToBounds="False"
Expand Down Expand Up @@ -151,11 +151,11 @@
<Grid ColumnDefinitions="60,*, 60" RowDefinitions="30, 30, 15, 40">
<ImageButton
Grid.RowSpan="2"
HeightRequest="40"
VerticalOptions="Center"
BackgroundColor="{StaticResource DarkSurface}"
Command="{Binding GoBackCommand}"
HeightRequest="40"
Source="leftarrow.png"
VerticalOptions="Center" />
Source="leftarrow.png" />

<Label
Grid.Row="0"
Expand All @@ -179,11 +179,11 @@
Grid.RowSpan="2"
Grid.Column="1"
Grid.ColumnSpan="2"
WidthRequest="60"
HeightRequest="60"
HorizontalOptions="End"
Source="island.png"
VerticalOptions="Center"
WidthRequest="60">
Source="island.png">
<Image.Shadow>
<Shadow
Brush="{StaticResource Primary}"
Expand All @@ -202,26 +202,26 @@

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

<HorizontalStackLayout x:Name="ColumnCountContainer" VerticalOptions="Fill">
<Label
Margin="0,0,0,2"
VerticalOptions="Center"
VerticalTextAlignment="Center"
FontSize="12"
Text="Column Count"
TextColor="White"
VerticalOptions="Center"
VerticalTextAlignment="Center" />
TextColor="White" />
<Picker
x:Name="ColumnPicker"
FontAttributes="Bold"
Expand All @@ -242,17 +242,17 @@

<sho:TabHostView
x:Name="TabHost"
WidthRequest="280"
HeightRequest="50"
Margin="0,10,0,0"
HorizontalOptions="Center"
VerticalOptions="EndAndExpand"
BackgroundColor="{StaticResource DarklessSurface}"
CornerRadius="25"
HeightRequest="50"
HorizontalOptions="Center"
IsSegmented="True"
SegmentedOutlineColor="#303030"
SelectedIndex="{Binding Mode, Converter={converters:ListModeToInt}, Mode=TwoWay}"
TabType="Fixed"
VerticalOptions="EndAndExpand"
WidthRequest="280">
TabType="Fixed">
<sho:TabHostView.Shadow>
<Shadow
Brush="#303030"
Expand All @@ -261,9 +261,9 @@
Offset="0,10" />
</sho:TabHostView.Shadow>
<sho:TabHostView.Tabs>
<sho:UnderlinedTabItem Label="Grid" Style="{StaticResource SegmentedTabStyle}" />
<sho:UnderlinedTabItem Label="Horizontal" Style="{StaticResource SegmentedTabStyle}" />
<sho:UnderlinedTabItem Label="Vertical" Style="{StaticResource SegmentedTabStyle}" />
<sho:UnderlinedTabItem Style="{StaticResource SegmentedTabStyle}" Label="Grid" />
<sho:UnderlinedTabItem Style="{StaticResource SegmentedTabStyle}" Label="Horizontal" />
<sho:UnderlinedTabItem Style="{StaticResource SegmentedTabStyle}" Label="Vertical" />
</sho:TabHostView.Tabs>
</sho:TabHostView>
</VerticalStackLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ private void CreateView(CollectionView collection)
}
}

Element.UpdateLayout = new Command(UpdateListLayout);

_preDrawListener = new PreDrawListener(this);
Control.ViewTreeObserver.AddOnPreDrawListener(_preDrawListener);
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ private void CreateView()
};

SetCollectionView(_collectionView);

Element.UpdateLayout = new Command(UpdateListLayout);
}

private void SetCollectionView(UICollectionView collectionView)
Expand Down
2 changes: 1 addition & 1 deletion Maui/Sharpnado.CollectionView.Maui/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static MauiApp CreateMauiApp()
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp()
.UseSharpnadoCollectionView(loggerEnabled: false);
.UseSharpnadoCollectionView(loggerEnable: false);
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-ios;net6.0-android</TargetFrameworks>
<TargetFrameworks>net7.0;net7.0-ios;net7.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> -->
Expand All @@ -22,9 +22,9 @@

<PropertyGroup>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>3.0.0</AssemblyVersion>
<AssemblyFileVersion>3.0.0</AssemblyFileVersion>
<Version>3.0.0</Version>
<AssemblyVersion>3.1.0</AssemblyVersion>
<AssemblyFileVersion>3.1.0</AssemblyFileVersion>
<Version>3.1.0</Version>
<PackOnBuild>true</PackOnBuild>
<NeutralLanguage>en</NeutralLanguage>

Expand Down Expand Up @@ -72,22 +72,22 @@
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp()
.UseSharpnadoCollectionView(loggerEnabled: false);
.UseSharpnadoCollectionView(loggerEnable: false);
}
```
</Description>

<Owners>Jean-Marie Alfonsi</Owners>
<Authors>Jean-Marie Alfonsi</Authors>
<Copyright>Copyright 2022 Sharpnado</Copyright>
<Copyright>Copyright 2024 Sharpnado</Copyright>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseExpression>MIT</PackageLicenseExpression>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<FileVersion>3.0.0</FileVersion>
<FileVersion>3.1.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -126,6 +126,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<Folder Include="Platforms\MacCatalyst\" />
<Folder Include="Platforms\Tizen\" />
<Folder Include="Platforms\Windows\" />
</ItemGroup>

<!--
<Target Name="CopyContracts" AfterTargets="AfterBuild">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ public CollectionView()

public event EventHandler<CollectionLayoutChangedEventArgs> CollectionLayoutChanging;

/// <summary>
/// Force the layout of the collection view to be updated.
/// Useful if you changed a property that should impact the layout but the layout is not updated.
/// </summary>
public Command UpdateLayout { get; internal set; } = new Command(() => { });

public DragAndDropTrigger DragAndDropTrigger { get; set; } = DragAndDropTrigger.LongTap;

public int CurrentIndex
Expand Down

0 comments on commit 7e524dd

Please sign in to comment.