Skip to content

Commit

Permalink
Merge pull request #1 from Eel2000/control
Browse files Browse the repository at this point in the history
Control implementation
  • Loading branch information
Eel2000 authored Jul 8, 2023
2 parents 74218db + 791034b commit 228668d
Show file tree
Hide file tree
Showing 10 changed files with 469 additions and 5 deletions.
7 changes: 6 additions & 1 deletion RatingView.Sample/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:rv="clr-namespace:RatingView.Views;assembly=RatingView"
x:Class="RatingView.Sample.MainPage">

<ScrollView>
Expand All @@ -16,7 +17,7 @@
HorizontalOptions="Center" />

<Label
Text="Hello, World!"
Text="Hello, World! this is a RatingView Sample"
SemanticProperties.HeadingLevel="Level1"
FontSize="32"
HorizontalOptions="Center" />
Expand All @@ -28,6 +29,10 @@
FontSize="18"
HorizontalOptions="Center" />

<rv:RatingView Maximum="5" Value="3" StarSize="40" AllowClickRating="True"/>

<rv:RatingView Maximum="5" Value="2.5" StarSize="40" StarColor="BlueViolet"/>

<Button
x:Name="CounterBtn"
Text="Click me"
Expand Down
2 changes: 2 additions & 0 deletions RatingView.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging;
using RatingView.Extensions;

namespace RatingView.Sample
{
Expand All @@ -9,6 +10,7 @@ public static MauiApp CreateMauiApp()
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureRatingView()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
Expand Down
4 changes: 4 additions & 0 deletions RatingView.Sample/RatingView.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,8 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\RatingView\RatingView.csproj" />
</ItemGroup>

</Project>
17 changes: 17 additions & 0 deletions RatingView/Extensions/AppHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace RatingView.Extensions
{
public static class AppHostBuilderExtensions
{
public static MauiAppBuilder ConfigureRatingView(this MauiAppBuilder app)
{

app.ConfigureFonts(fonts =>
{
fonts.AddFont("Font Awesome 6 Brands-Regular-400.otf", "FontRegular");
fonts.AddFont("Font Awesome 6 Free-Solid-900.otf", "FontSolid");
});

return app;
}
}
}
7 changes: 6 additions & 1 deletion RatingView/RatingView.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
Expand All @@ -17,4 +17,9 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
</ItemGroup>

</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion RatingView/Shared/BaseTemplateView.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace RatingView.Shared;

public class BaseTemplateView<TControl> : TemplatedView where TControl : View, new()
public abstract class BaseTemplateView<TControl> : TemplatedView where TControl : View, new()
{
protected TControl? Control { get; private set; }

Expand Down
Loading

0 comments on commit 228668d

Please sign in to comment.