Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@

namespace EssentialMAUIUIKit.AppLayout.Controls
{
public class ParallaxListView : ListView
public class ParallaxListView : CollectionView
{
public ParallaxListView()
: base(ListViewCachingStrategy.RetainElement)
: base()
{
if (DeviceInfo.Platform != DevicePlatform.iOS)
{
this.ItemSelected += ParallaxListView_ItemSelected1;
}
}

private void ParallaxListView_ItemSelected1(object? sender, SelectedItemChangedEventArgs e)
private void ParallaxListView_SelectionChanged(object? sender, SelectionChangedEventArgs e)
{
OnSelectionChanged(this, e);
OnSelectionChanged(this, e.CurrentSelection);
}

public event EventHandler<SelectedItemChangedEventArgs>? SelectionChanged;

public event EventHandler<ScrollChangedEventArgs>? ScrollChanged;

public double WidthInPixel { get; set; }
Expand All @@ -29,25 +23,14 @@ public static void OnScrollChanged(object sender, ScrollChangedEventArgs e)
((ParallaxListView)sender)?.ScrollChanged?.Invoke((ParallaxListView)sender, e);
}

public static void OnSelectionChanged(object sender, SelectedItemChangedEventArgs e)
{
ParallaxListView listView = (ParallaxListView)sender;
if (listView != null)
{
listView.SelectionChanged?.Invoke(sender, e);
listView.SelectedItem = e?.SelectedItem;
listView.SelectedItem = null;
}
}

public static void OnSelectionChanged(object sender, int index)
public static void OnSelectionChanged(object sender, object selectedItem)
{
if (sender is ParallaxListView)
{
var listView = sender as ParallaxListView;
if (listView != null)
{
OnSelectionChanged(sender, new SelectedItemChangedEventArgs(((IList)listView.ItemsSource)[index], index));
OnSelectionChanged(sender, new SelectedItemChangedEventArgs(selectedItem, ((IList)listView.ItemsSource).IndexOf(selectedItem)));
}
}
}
Expand All @@ -62,4 +45,4 @@ public ScrollChangedEventArgs(int position)

public int Position { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,49 +123,46 @@

<listView:SfListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<!-- The image at the left will be rendered with some space. -->
<Grid
Margin="0,10,10,8"
ColumnDefinitions="Auto, *"
RowSpacing="8">
<!-- The image at the left will be rendered with some space. -->
<Grid
Margin="0,10,10,8"
ColumnDefinitions="Auto, *"
RowSpacing="8">

<Image Margin="10,0,10,0"
Grid.RowSpan="2"
Grid.Column="0"
Aspect="AspectFit"
HeightRequest="32"
Style="{DynamicResource ItemImageStyle}"
WidthRequest="32"/>
<Image Margin="10,0,10,0"
Grid.RowSpan="2"
Grid.Column="0"
Aspect="AspectFit"
HeightRequest="32"
Style="{DynamicResource ItemImageStyle}"
WidthRequest="32"/>

<Grid ColumnDefinitions="*,*"
Grid.Column="1"
Grid.ColumnSpan="2">
<Label FontSize="14"
VerticalOptions="Center"
TextColor="{AppThemeBinding Light={DynamicResource PrimaryTextColorLight}, Dark={DynamicResource PrimaryTextColorDark}}"
Style="{DynamicResource ItemTitleStyle}"/>

<Border Grid.Column="1"
HorizontalOptions="End"
Stroke="Transparent"
WidthRequest="100"
HeightRequest="20"
VerticalOptions="Center"
Margin="0"
Padding="0"
BackgroundColor="{AppThemeBinding Light=#EDF0F3, Dark={DynamicResource BackgroundColorDark}}"
StrokeShape="RoundRectangle 10">
<Border.Content>
<Label HorizontalOptions="Center"
Padding="10,0,10,0"
Style="{DynamicResource ItemCountLabelStyle}"/>
</Border.Content>
</Border>
</Grid>
<Grid ColumnDefinitions="*,*"
Grid.Column="1"
Grid.ColumnSpan="2">
<Label FontSize="14"
VerticalOptions="Center"
TextColor="{AppThemeBinding Light={DynamicResource PrimaryTextColorLight}, Dark={DynamicResource PrimaryTextColorDark}}"
Style="{DynamicResource ItemTitleStyle}"/>

<Border Grid.Column="1"
HorizontalOptions="End"
Stroke="Transparent"
WidthRequest="100"
HeightRequest="20"
VerticalOptions="Center"
Margin="0"
Padding="0"
BackgroundColor="{AppThemeBinding Light=#EDF0F3, Dark={DynamicResource BackgroundColorDark}}"
StrokeShape="RoundRectangle 10">
<Border.Content>
<Label HorizontalOptions="Center"
Padding="10,0,10,0"
Style="{DynamicResource ItemCountLabelStyle}"/>
</Border.Content>
</Border>
</Grid>
</ViewCell>
</Grid>
</DataTemplate>
</listView:SfListView.ItemTemplate>
</listView:SfListView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
<ResourceDictionary Source="AppLayoutStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<Style TargetType="Grid">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor"
Value="Transparent" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</ContentPage.Resources>

<ContentPage.BindingContext>
Expand All @@ -34,63 +48,59 @@
Grid.Row="0"
Grid.RowSpan="2"
BackgroundColor="{AppThemeBinding Light={DynamicResource BackgroundColorLight}, Dark={DynamicResource BackgroundColorDark}}"
HasUnevenRows="True"
ItemsSource="{Binding Categories}"
SelectionChanged="ListView_OnSelectionChanged"
SeparatorVisibility="None"
ScrollChanged="listView_ScrollChanged"
ItemTapped="listView_ItemTapped">
SelectionMode="Single">

<ListView.ItemTemplate>
<CollectionView.ItemTemplate>
<DataTemplate>
<ViewCell>
<!-- The image at the left will be rendered with some space. -->
<Grid BackgroundColor="Transparent"
<!-- The image at the left will be rendered with some space. -->
<Grid BackgroundColor="Transparent"
Margin="0,16,16,8"
ColumnDefinitions="Auto, *"
RowDefinitions="Auto, Auto"
RowSpacing="8">

<Image Margin="20,0,20,0"
<Image Margin="20,0,20,0"
Grid.RowSpan="2"
Grid.Column="0"
Aspect="AspectFit"
HeightRequest="40"
Style="{DynamicResource ItemImageStyle}"
WidthRequest="40"/>

<Grid ColumnDefinitions="*,*"
<Grid ColumnDefinitions="*,*"
Grid.Row="0"
Grid.Column="1"
Grid.ColumnSpan="2">
<Label Style="{DynamicResource ItemTitleStyle}"/>
<Label Style="{DynamicResource ItemTitleStyle}"/>

<Border Grid.Column="1"
<Border Grid.Column="1"
BackgroundColor="{AppThemeBinding Light={DynamicResource BackgroundColorLight}, Dark={DynamicResource BackgroundColorDark}}"
HorizontalOptions="End"
Stroke="Transparent"
Margin="0"
Padding="0"
StrokeShape="RoundRectangle 40">
<Border.Content>
<Label Padding="10,0,10,0"
<Border.Content>
<Label Padding="10,0,10,0"
Style="{DynamicResource ItemCountLabelStyle}"/>
</Border.Content>
</Border>
</Grid>
</Border.Content>
</Border>
</Grid>

<Label
<Label
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
Style="{DynamicResource ItemDescriptionStyle}"/>

</Grid>
</ViewCell>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</CollectionView.ItemTemplate>

<ListView.Header>
<CollectionView.Header>
<Grid
x:Name="ListViewHeader"
BackgroundColor="#5470FF"
Expand Down Expand Up @@ -195,7 +205,7 @@


</Grid>
</ListView.Header>
</CollectionView.Header>
</controls:ParallaxListView>

<Grid Grid.RowSpan="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,20 @@ protected override bool OnBackButtonPressed()
return true;
}

private void ListView_OnSelectionChanged(object sender, SelectedItemChangedEventArgs e)
private void ListView_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection == null)
{
return;
}

Category? category = e.CurrentSelection?.FirstOrDefault() as Category;
if (category == null)
{
return;
}

this.Navigation.PushAsync(new TemplatePage(category, category.Pages[0]));
}

private void ShowSettings(object sender, EventArgs e)
Expand Down Expand Up @@ -95,22 +107,6 @@ private async void GotoCodeViewer(object sender, EventArgs e)
await Browser.Default.OpenAsync(address, BrowserLaunchMode.SystemPreferred);
}

private void listView_ItemTapped(object sender, ItemTappedEventArgs e)
{
if (e.Item == null)
{
return;
}

Category? category = e.Item as Category;
if (category == null)
{
return;
}

this.Navigation.PushAsync(new TemplatePage(category, category.Pages[0]));
}

private void PropertiesTapped(object sender, TappedEventArgs e)
{
this.propertyFrame.IsVisible = !this.propertyFrame.IsVisible;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks>net10.0-android;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</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);net8.0-tizen</TargetFrameworks> -->

Expand Down Expand Up @@ -36,7 +36,7 @@
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
Expand Down Expand Up @@ -272,7 +272,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.10" />
<PackageReference Include="Syncfusion.Maui.Buttons" Version="*" />
<PackageReference Include="Syncfusion.Maui.Cards" Version="*" />
<PackageReference Include="Syncfusion.Maui.Charts" Version="*" />
Expand Down
11 changes: 0 additions & 11 deletions EssentialMAUIUIKit/EssentialMAUIUIKit/Resources/Styles/Styles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@
</Setter>
</Style>

<Style TargetType="Frame">
<Setter Property="HasShadow" Value="False" />
<Setter Property="BorderColor" Value="{AppThemeBinding Light={DynamicResource Gray200}, Dark={DynamicResource Gray950}}" />
<Setter Property="CornerRadius" Value="8" />
</Style>

<Style TargetType="ImageButton">
<Setter Property="Opacity" Value="1" />
<Setter Property="BorderColor" Value="Transparent"/>
Expand Down Expand Up @@ -197,11 +191,6 @@
<Setter Property="HorizontalTextAlignment" Value="Center" />
</Style>

<Style TargetType="ListView">
<Setter Property="SeparatorColor" Value="{AppThemeBinding Light={DynamicResource Gray200}, Dark={DynamicResource Gray500}}" />
<Setter Property="RefreshControlColor" Value="{AppThemeBinding Light={DynamicResource Gray900}, Dark={DynamicResource Gray200}}" />
</Style>

<Style TargetType="Picker">
<Setter Property="TextColor" Value="{AppThemeBinding Light={DynamicResource Gray900}, Dark={DynamicResource White}}" />
<Setter Property="TitleColor" Value="{AppThemeBinding Light={DynamicResource Gray900}, Dark={DynamicResource Gray200}}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<Setter Property="Margin" Value="8,3,0,-3" />
<Setter Property="HeightRequest" Value="40" />
<Setter Property="DropDownStroke" Value="{DynamicResource Gray-300}" />
<Setter Property="SelectedDropDownItemBackground" Value="Transparent" />
<Setter Property="DropDownBackground" Value="{AppThemeBinding Light={DynamicResource BackgroundColorLight}, Dark={DynamicResource BackgroundColorDark}}" />
<Setter Property="DropDownItemTextColor" Value="{AppThemeBinding Light={DynamicResource PrimaryTextColorLight}, Dark={DynamicResource PrimaryTextColorDark}}" />
</Style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Style x:Key="SegmentedControlStyle" TargetType="buttons:SfSegmentedControl">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="StrokeThickness" Value="0" />
<Setter Property="SegmentBackground" Value="{DynamicResource Gray-Bg}" />
<Setter Property="SegmentBackground" Value="{AppThemeBinding Light=#ffffff, Dark=#2F343C}" />
<Setter Property="SegmentCornerRadius" Value="20" />
<Setter Property="SegmentHeight" Value="40" />
<Setter Property="SegmentWidth" Value="40" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<styles:EditorStyles />
<styles:RadioButtonStyles />
<styles:SegmentedControlStyles />
<styles:ComboBoxStyles />
</ResourceDictionary.MergedDictionaries>

<Color x:Key="PrimaryDarkColor">#2A89FF</Color>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<styles:EditorStyles />
<styles:RadioButtonStyles />
<styles:SegmentedControlStyles />
<styles:ComboBoxStyles />
</ResourceDictionary.MergedDictionaries>

<Color x:Key="PrimaryDarkColor">#d0424f</Color>
Expand Down
Loading