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

Rating view #2191

Open
wants to merge 82 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
2a25d1d
Implemented basic TemplatedView.
GeorgeLeithead Aug 21, 2024
b42e811
Added better properties.
GeorgeLeithead Aug 23, 2024
467e145
Implemented Element abstraction
GeorgeLeithead Aug 30, 2024
ec26921
Merge branch 'CommunityToolkit:main' into RatingView
GeorgeLeithead Aug 30, 2024
e7d947f
Moved more to the Item Element
GeorgeLeithead Aug 30, 2024
fce062f
Renamed Inspirations to Showcase
GeorgeLeithead Sep 2, 2024
1662b75
Added most of the unit tests
GeorgeLeithead Sep 4, 2024
a7293e2
Fixed the filled, partially filled and empty.
GeorgeLeithead Sep 5, 2024
859ffba
Fixed the filled, partially filled, empty colors.
GeorgeLeithead Sep 5, 2024
7e8ce5b
Added EventArgs for rating changed
GeorgeLeithead Sep 6, 2024
50cfa05
Made event handler visible in C# markup
GeorgeLeithead Sep 9, 2024
3b0decf
Merge from MAIN
GeorgeLeithead Sep 9, 2024
ecc4b29
Fixed the unit test
GeorgeLeithead Sep 9, 2024
cd64619
Tidy up
GeorgeLeithead Sep 9, 2024
c432d11
Fixed IsEnabled binding and add/remove of gesture recognisers.
GeorgeLeithead Sep 9, 2024
0956abd
Undone some un-wanted changes
GeorgeLeithead Sep 9, 2024
5dba38c
Removed file from original implementation.
GeorgeLeithead Sep 9, 2024
69910a7
We don't need the enum int assigned
GeorgeLeithead Sep 9, 2024
31e91bb
Finished the XAML samples page.
GeorgeLeithead Sep 9, 2024
6be86b9
Further work on the C# syntax samples page.
GeorgeLeithead Sep 11, 2024
c648dc8
Merge branch 'main' into RatingView
GeorgeLeithead Sep 11, 2024
2faac26
Merge branch 'CommunityToolkit:main' into RatingView
GeorgeLeithead Sep 17, 2024
cf9be24
Fixed issue with backgrounds not being set correctly when rating chan…
GeorgeLeithead Sep 17, 2024
dbdf9cc
Removed un-completed Showcase
GeorgeLeithead Sep 18, 2024
97c961b
If CustomShape is NullOrEmpty default to Star.
GeorgeLeithead Sep 18, 2024
a9e9d10
Removed Theory test for Star
GeorgeLeithead Sep 18, 2024
139d0fe
Fixed type in unit test value check
GeorgeLeithead Sep 18, 2024
1ecf9d8
Merge branch 'CommunityToolkit:main' into RatingView
GeorgeLeithead Sep 18, 2024
8d5fd85
Moved all tests to Fluid Assertions
GeorgeLeithead Sep 18, 2024
834e4c3
Removed redundant code
GeorgeLeithead Sep 19, 2024
9a1a8dd
Fixed issue with Item fill.
GeorgeLeithead Sep 19, 2024
31b12ed
Completed C# syntax samples page, to match XAML
GeorgeLeithead Sep 19, 2024
212bdf7
Merge branch 'main' into RatingView
GeorgeLeithead Sep 19, 2024
0efff16
Merge updated with main.
GeorgeLeithead Sep 19, 2024
e4a46c0
Fixed issue with Spacing not being applied.
GeorgeLeithead Sep 20, 2024
596839e
Added new Custom shape example
GeorgeLeithead Sep 20, 2024
eb79b40
Updated shapes sample.
GeorgeLeithead Sep 20, 2024
0a60d17
Reduced unit test duration by 112ms
GeorgeLeithead Sep 20, 2024
11694dc
Changed property IsEnabled to IsReadOnly
GeorgeLeithead Sep 20, 2024
8de6547
Renamed EmptyColorProperty to EmptyProperty
GeorgeLeithead Sep 20, 2024
b6c09c7
Merge branch 'main' into RatingView
pictos Sep 22, 2024
41c452c
Update src/CommunityToolkit.Maui.Core/Interfaces/RatingView/IRatingVi…
GeorgeLeithead Sep 23, 2024
64986ba
Eliminated nullable forgiver.
GeorgeLeithead Sep 23, 2024
fcae236
Added property validator to RatingProperty, to make sure is in range.
GeorgeLeithead Sep 23, 2024
66263c3
Refactored PartialFill into method
GeorgeLeithead Sep 23, 2024
11df9d2
Changed RatingViewShape to a sealed class with private constructor.
GeorgeLeithead Sep 23, 2024
c0b9eec
Fixed light mode sample display issue
GeorgeLeithead Sep 25, 2024
0e56a9d
Simplified updating item fill.
GeorgeLeithead Sep 25, 2024
1177332
Set child background color
GeorgeLeithead Sep 25, 2024
fb8ea88
Merge branch 'main' into RatingView
pictos Sep 26, 2024
66ce357
Updated unit tests to mirror code changes.
GeorgeLeithead Sep 27, 2024
07238a1
Merge branch 'RatingView' of https://github.com/GeorgeLeithead/Commun…
GeorgeLeithead Sep 27, 2024
d5e4f25
Improved Code Coverage
GeorgeLeithead Sep 27, 2024
c351c8f
Merge branch 'CommunityToolkit:main' into RatingView
GeorgeLeithead Sep 27, 2024
c325afe
Alphabetize
brminnick Sep 30, 2024
f70caa7
Refactor C# RatingView Page
brminnick Oct 1, 2024
65a46be
Fix RatingView XAML Logic
brminnick Oct 1, 2024
a2087e6
Add Default Rating
brminnick Oct 1, 2024
45e79b2
Merge branch 'main' into RatingView
brminnick Oct 1, 2024
cc504d4
`dotnet format`
brminnick Oct 1, 2024
839a186
Merge branch 'RatingView' of https://github.com/GeorgeLeithead/Commun…
brminnick Oct 1, 2024
4f1470b
Remove duplicate `RatingViewShowcaseViewModel` reference
brminnick Oct 1, 2024
6fdc74e
Fix `Shape padding` bindings
brminnick Oct 1, 2024
904076f
Use One-time Binding
brminnick Oct 1, 2024
2dafe9b
Sample adjusted to fix on Pixel6. Fixed discrepancy between C# and XA…
GeorgeLeithead Oct 1, 2024
9b09e3c
Merge branch 'RatingView' of https://github.com/GeorgeLeithead/Commun…
brminnick Oct 1, 2024
b760796
Update Picker Bindings
brminnick Oct 1, 2024
1a23339
Fix Bug causing `event MaximumRating` to fire for multiple RatingViews
brminnick Oct 1, 2024
8cafe3e
Put Slider + Value in same Row, Remove Unused Code
brminnick Oct 1, 2024
d5c385d
Add lower bounds to `ShapeBorderThickness`
brminnick Oct 1, 2024
00f77be
Remove `Debug.Assert`, Remove Null-Forgiving Operator (`!`), `byte` -…
brminnick Oct 1, 2024
ff638e7
Remove `_ = `
brminnick Oct 1, 2024
9f5f957
Remove `VerticalStackLayout`
brminnick Oct 1, 2024
6e7778e
Add Additional ArgumentOutOfRangeException Tests
brminnick Oct 1, 2024
c7f322e
Remove `HorizontalLayout`
brminnick Oct 1, 2024
8b07d93
Remove `Auto`
brminnick Oct 1, 2024
8eb51fb
Rename `Shape` -> `ItemShape` + `SizeProperty` -> `ItemShapeSizePrope…
brminnick Oct 1, 2024
ebbb059
Update RatingViewTests.cs
brminnick Oct 1, 2024
941d413
Simplified XAML view model and aligned XAML page with C# page
GeorgeLeithead Oct 2, 2024
6972f26
As Control is internal, it can not be modified externally.
GeorgeLeithead Oct 3, 2024
2fd09ce
Fixed some formatting issues
GeorgeLeithead Oct 3, 2024
ccf04b1
Added additional tests around AllowNULL
GeorgeLeithead Oct 3, 2024
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
3 changes: 3 additions & 0 deletions samples/CommunityToolkit.Maui.Sample/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ public partial class AppShell : Shell
CreateViewModelMapping<SemanticOrderViewPage, SemanticOrderViewPageViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<ShowPopupInOnAppearingPage, ShowPopupInOnAppearingPageViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<StylePopupPage, StylePopupViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<RatingViewXamlPage, RatingViewXamlViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<RatingViewCsharpPage, RatingViewCsharpViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),
CreateViewModelMapping<RatingViewShowcasePage, RatingViewShowcaseViewModel, ViewsGalleryPage, ViewsGalleryViewModel>(),

// Add PlatformSpecific View Models
CreateViewModelMapping<NavigationBarPage, NavigationBarAndroidViewModel, PlatformSpecificGalleryPage, PlatformSpecificGalleryViewModel>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))=='windows' and $(Configuration) == 'Release'">
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))=='android'">
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<RuntimeIdentifiers>android-arm;android-arm64;android-x86;android-x64</RuntimeIdentifiers>
Expand Down
40 changes: 20 additions & 20 deletions samples/CommunityToolkit.Maui.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,32 +74,31 @@ public static MauiApp CreateMauiApp()
fonts.AddFont("Font Awesome 6 Brands-Regular-400.otf", FontFamilies.FontAwesomeBrands);
});


builder.ConfigureLifecycleEvents(events =>
{
#if WINDOWS10_0_17763_0_OR_GREATER
events.AddWindows(static windowLifeCycleBuilder =>
{
windowLifeCycleBuilder.OnWindowCreated(window =>
{
window.SystemBackdrop = new MicaBackdrop { Kind = MicaKind.Base };
events.AddWindows(static windowLifeCycleBuilder =>
{
windowLifeCycleBuilder.OnWindowCreated(window =>
{
window.SystemBackdrop = new MicaBackdrop { Kind = MicaKind.Base };

var titleBar = window.GetAppWindow()?.TitleBar ?? throw new InvalidOperationException("App Window Cannot be Null");
var titleBar = window.GetAppWindow()?.TitleBar ?? throw new InvalidOperationException("App Window Cannot be Null");

titleBar.PreferredHeightOption = TitleBarHeightOption.Tall;
titleBar.PreferredHeightOption = TitleBarHeightOption.Tall;

window.ExtendsContentIntoTitleBar = false;
window.ExtendsContentIntoTitleBar = false;

IntPtr nativeWindowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window);
WindowId win32WindowsId = Win32Interop.GetWindowIdFromWindow(nativeWindowHandle);
AppWindow winuiAppWindow = AppWindow.GetFromWindowId(win32WindowsId);
IntPtr nativeWindowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window);
WindowId win32WindowsId = Win32Interop.GetWindowIdFromWindow(nativeWindowHandle);
AppWindow winuiAppWindow = AppWindow.GetFromWindowId(win32WindowsId);

if (winuiAppWindow.Presenter is OverlappedPresenter p)
{
p.SetBorderAndTitleBar(true, true);
}
});
});
if (winuiAppWindow.Presenter is OverlappedPresenter p)
{
p.SetBorderAndTitleBar(true, true);
}
});
});
#endif
});

Expand Down Expand Up @@ -131,7 +130,6 @@ static void RegisterViewsAndViewModels(in IServiceCollection services)
services.AddTransient<ViewsGalleryPage, ViewsGalleryViewModel>();
services.AddTransient<PlatformSpecificGalleryPage, PlatformSpecificGalleryViewModel>();


// Add Alerts Pages + ViewModels
services.AddTransientWithShellRoute<SnackbarPage, SnackbarViewModel>();
services.AddTransientWithShellRoute<ToastPage, ToastViewModel>();
Expand Down Expand Up @@ -237,7 +235,9 @@ static void RegisterViewsAndViewModels(in IServiceCollection services)
services.AddTransientWithShellRoute<MapsPinsPage, MapsPinsViewModel>();
services.AddTransientWithShellRoute<MediaElementPage, MediaElementViewModel>();
services.AddTransientWithShellRoute<MediaElementCarouselViewPage, MediaElementCarouselViewViewModel>();
services.AddTransientWithShellRoute<MediaElementCollectionViewPage, MediaElementCollectionViewViewModel>();
services.AddTransientWithShellRoute<RatingViewXamlPage, RatingViewXamlViewModel>();
services.AddTransientWithShellRoute<RatingViewCsharpPage, RatingViewCsharpViewModel>();
services.AddTransientWithShellRoute<RatingViewShowcasePage, RatingViewShowcaseViewModel>();
services.AddTransientWithShellRoute<MultiplePopupPage, MultiplePopupViewModel>();
services.AddTransientWithShellRoute<PopupAnchorPage, PopupAnchorViewModel>();
services.AddTransientWithShellRoute<PopupLayoutAlignmentPage, PopupLayoutAlignmentViewModel>();
Expand Down
Loading