Skip to content

Commit 662d8ad

Browse files
Removed CodeFixer.
Moved and renamed RatingViewShape
1 parent 716f0ce commit 662d8ad

File tree

11 files changed

+141
-345
lines changed

11 files changed

+141
-345
lines changed

samples/CommunityToolkit.Maui.Sample/Pages/Views/RatingView/RatingViewCsharpPage.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
using CommunityToolkit.Maui.Alerts;
44
using CommunityToolkit.Maui.Core;
5+
using CommunityToolkit.Maui.Core.Primitives;
56
using CommunityToolkit.Maui.Markup;
67
using CommunityToolkit.Maui.Sample.ViewModels.Views;
78
using CommunityToolkit.Maui.Views;
@@ -152,7 +153,7 @@ public RatingViewCsharpPage(RatingViewCsharpViewModel viewModel) : base(viewMode
152153
EmptyColor = Colors.White,
153154
FilledColor = Colors.Blue,
154155
Rating = 2,
155-
ItemShape = RatingViewShape.Star,
156+
ItemShape = RatingViewShapes.Star,
156157
ShapeBorderThickness = 1
157158
}
158159
.Start()
@@ -171,7 +172,7 @@ public RatingViewCsharpPage(RatingViewCsharpViewModel viewModel) : base(viewMode
171172
EmptyColor = Colors.Red,
172173
FilledColor = Colors.Blue,
173174
Rating = 2,
174-
ItemShape = RatingViewShape.Circle,
175+
ItemShape = RatingViewShapes.Circle,
175176
ShapeBorderThickness = 1
176177
}
177178
.Start()
@@ -189,7 +190,7 @@ public RatingViewCsharpPage(RatingViewCsharpViewModel viewModel) : base(viewMode
189190
MaximumRating = 5,
190191
FilledColor = Colors.White,
191192
Rating = 5,
192-
ItemShape = RatingViewShape.Heart,
193+
ItemShape = RatingViewShapes.Heart,
193194
ShapeBorderThickness = 1
194195
}
195196
.Start()
@@ -207,7 +208,7 @@ public RatingViewCsharpPage(RatingViewCsharpViewModel viewModel) : base(viewMode
207208
MaximumRating = 5,
208209
Rating = 5,
209210
FilledColor = Colors.Red,
210-
ItemShape = RatingViewShape.Like,
211+
ItemShape = RatingViewShapes.Like,
211212
ShapeBorderThickness = 1
212213
}
213214
.Start()
@@ -225,7 +226,7 @@ public RatingViewCsharpPage(RatingViewCsharpViewModel viewModel) : base(viewMode
225226
MaximumRating = 5,
226227
Rating = 5,
227228
FilledColor = Colors.White,
228-
ItemShape = RatingViewShape.Dislike,
229+
ItemShape = RatingViewShapes.Dislike,
229230
ShapeBorderThickness = 1
230231
}
231232
.Start()
@@ -245,7 +246,7 @@ public RatingViewCsharpPage(RatingViewCsharpViewModel viewModel) : base(viewMode
245246
MaximumRating = 5,
246247
FilledColor = Colors.Red,
247248
Rating = 5,
248-
ItemShape = RatingViewShape.Custom,
249+
ItemShape = RatingViewShapes.Custom,
249250
ShapeBorderThickness = 1,
250251
}
251252
.Start()
@@ -265,7 +266,7 @@ public RatingViewCsharpPage(RatingViewCsharpViewModel viewModel) : base(viewMode
265266
FilledColor = Colors.White,
266267
MaximumRating = 5,
267268
Rating = 5,
268-
ItemShape = RatingViewShape.Custom,
269+
ItemShape = RatingViewShapes.Custom,
269270
ShapeBorderColor = Colors.Grey,
270271
ShapeBorderThickness = 1,
271272
}

src/CommunityToolkit.Maui.Analyzers.Benchmarks/MaximumRatingRangeAnalyzerBenchmarks.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/CommunityToolkit.Maui.Analyzers.Benchmarks/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ public static void Main(string[] args)
1111
BenchmarkRunner.Run<UseMauiCommunityToolkitAnalyzerBenchmarks>(config, args);
1212
BenchmarkRunner.Run<UseMauiCommunityToolkitCameraAnalyzerBenchmarks>(config, args);
1313
BenchmarkRunner.Run<UseMauiCommunityToolkitMediaElementInitializationAnalyzerBenchmarks>(config, args);
14-
BenchmarkRunner.Run<MaximumRatingRangeAnalyzerBenchmarks>(config, args);
1514
}
1615
}

src/CommunityToolkit.Maui.Analyzers.CodeFixes/MaximumRatingAnalyzerCodeFixProvider.cs

Lines changed: 0 additions & 91 deletions
This file was deleted.

src/CommunityToolkit.Maui.Analyzers.UnitTests/MaximumRatingRangeAnalyzerTests.cs

Lines changed: 0 additions & 100 deletions
This file was deleted.
Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Ignore Spelling: color
22
using System.ComponentModel;
3+
using CommunityToolkit.Maui.Core.Primitives;
34

45
namespace CommunityToolkit.Maui.Core;
56

@@ -14,7 +15,7 @@ public interface IRatingViewShape
1415
string? CustomItemShape { get; }
1516

1617
/// <summary>Gets a value indicating the Rating View shape.</summary>
17-
RatingViewShape ItemShape { get; }
18+
RatingViewShapes ItemShape { get; }
1819

1920
/// <summary>Gets a value indicating the Rating View item padding.</summary>
2021
Thickness ItemPadding { get; }
@@ -30,26 +31,4 @@ public interface IRatingViewShape
3031

3132
/// <summary>Get a value indicating the rating item background filled color.</summary>
3233
Color FilledColor { get; }
33-
}
34-
35-
/// <summary>Rating view shape enumerator.</summary>
36-
public enum RatingViewShape
37-
{
38-
/// <summary>A star rating shape.</summary>
39-
Star,
40-
41-
/// <summary>A heart rating shape.</summary>
42-
Heart,
43-
44-
/// <summary>A circle rating shape.</summary>
45-
Circle,
46-
47-
/// <summary>A like/thumbs up rating shape.</summary>
48-
Like,
49-
50-
/// <summary>A dislike/thumbs down rating shape.</summary>
51-
Dislike,
52-
53-
/// <summary>A custom rating shape.</summary>
54-
Custom
5534
}

src/CommunityToolkit.Maui.Core/Primitives/Defaults/RatingViewDefaults.shared.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Ignore Spelling: color
22

33
using System.ComponentModel;
4+
using CommunityToolkit.Maui.Core.Primitives;
45

56
namespace CommunityToolkit.Maui.Core;
67

@@ -50,7 +51,7 @@ public static class RatingViewDefaults
5051

5152
/// <summary>Default rating shape.</summary>
5253
[EditorBrowsable(EditorBrowsableState.Never)]
53-
public static RatingViewShape Shape { get; } = RatingViewShape.Star;
54+
public static RatingViewShapes Shape { get; } = RatingViewShapes.Star;
5455

5556
/// <summary>Default border color for a rating shape.</summary>
5657
[EditorBrowsable(EditorBrowsableState.Never)]

src/CommunityToolkit.Maui.Core/Primitives/RatingViewShape.cs renamed to src/CommunityToolkit.Maui.Core/Primitives/RatingViewShapeHandler.shared.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
namespace CommunityToolkit.Maui.Core.Primitives;
22

33
/// <summary>Shapes available for the rating view.</summary>
4-
public sealed class RatingViewShape
4+
public sealed class RatingViewShapeHandler
55
{
66
/// <summary>Custom data path for the shape of the rating.</summary>
77
public string PathData { get; }
88

99
/// <summary>Private constructor to initialize a new shape.</summary>
1010
/// <param name="pathData">Path shape data from <see cref="PathShapes"/>.</param>
11-
RatingViewShape(string pathData)
11+
RatingViewShapeHandler(string pathData)
1212
{
1313
PathData = pathData;
1414
}
1515

1616
/// <summary>Star shape.</summary>
1717
/// <remarks>Default shape.</remarks>
18-
public static readonly RatingViewShape Star = new(PathShapes.Star);
18+
public static readonly RatingViewShapeHandler Star = new(PathShapes.Star);
1919

2020
/// <summary>Heart shape.</summary>
21-
public static readonly RatingViewShape Heart = new(PathShapes.Heart);
21+
public static readonly RatingViewShapeHandler Heart = new(PathShapes.Heart);
2222

2323
/// <summary>Circle shape.</summary>
24-
public static readonly RatingViewShape Circle = new(PathShapes.Circle);
24+
public static readonly RatingViewShapeHandler Circle = new(PathShapes.Circle);
2525

2626
/// <summary>Thumb like shape.</summary>
27-
public static readonly RatingViewShape Like = new(PathShapes.Like);
27+
public static readonly RatingViewShapeHandler Like = new(PathShapes.Like);
2828

2929
/// <summary>Thumb dislike shape.</summary>
30-
public static readonly RatingViewShape Dislike = new(PathShapes.Dislike);
30+
public static readonly RatingViewShapeHandler Dislike = new(PathShapes.Dislike);
3131
}
3232

3333
/// <summary>SVG defined path shapes.</summary>

0 commit comments

Comments
 (0)