Skip to content

Commit

Permalink
fix: code clean up and ready checkbox (#39)
Browse files Browse the repository at this point in the history
* feat: Freaky image is in town :)

* feat: Picker, DatePicker and Timepicker just got Freaky :D

* fix: handled some warnings

* feat: some changes to our files :)

* fix: TIL

* feat: TextInputLayout now has an outlined option :)

* fix: removed unwanted parts of the code

* fix: background color is now transparent for entry view

* feat: freaky image added for descriptions

* feat: final update for your freaky controls

* Update README.md

- updated readme with BMAC

* Update README.md

- Wiki configured and now control details are moved to the Wiki.

* fix: more information on properties

* feat: A UI for signatures + Handlers for unsupported platforms to avoid build errors  (#11)

* fix: starter commit

* Update README.md

* Update README.md

* fix: fixed build errors if apps target maccatalyst and windows

* Update README.md

updated readme + added headers

* Update README.md

* feat: Signature view basic  setup

* fix: compelete setup for a signature view

* Create issues.md

Template for issues

* feat: A fully setup SignatureView that can help you create signature's + better sample

* fix: code cleanup

* feat: SignatureView is a readySignatureView

* chore: code clesn up

* Delete issues.md

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* fix: code clean up and other fixes for performance (#16)

* fix: memory leak fixes

* fix: code clean up for signaturePadview

* fix: files moved to helper

* fix: events moved post ctor

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* fix: Circular Image now comes from our control. (#17)

* fix: Circular Image now inherits from our Image control

* fix: update changes for some controls

* fix: code clean up and updates (#18)

* fix: Circular Image now inherits from our Image control

* fix: update changes for some controls

* chore: code cleanup

* fix: changes to signatureview

* fix: clear icon instead of label

* fix: ui changes for signature view

* fix: updated clear icon

* fix:SignatureView is optimized and cleaned up

* chore: updated readme.md

* Update README.md

updated license in readme

* fix: signature view now has better documentation

* fix: signature view now has better documentation

* fix: better positioming for clear icon

* chore: setup for 0.3 (#19)

* fix: fix for nupkg and readme now has gifs (#20)

* fix: icon fix for nupkg

* Update README.md

- Added SignatureView for iOS

* Update README.md

fix: added screenshots for all controls :)

* Update README.md

updated the readme

* Update README.md

a better readme in general :)

* Update README.md

* fix: updated readme for better visual effects (#21)

* feat: merging new features to master (#14)

* feat: Freaky image is in town :)

* feat: Picker, DatePicker and Timepicker just got Freaky :D

* fix: handled some warnings

* feat: some changes to our files :)

* fix: TIL

* feat: TextInputLayout now has an outlined option :)

* fix: removed unwanted parts of the code

* fix: background color is now transparent for entry view

* feat: freaky image added for descriptions

* feat: final update for your freaky controls

* Update README.md

- updated readme with BMAC

* Update README.md

- Wiki configured and now control details are moved to the Wiki.

* fix: more information on properties

* feat: A UI for signatures + Handlers for unsupported platforms to avoid build errors  (#11)

* fix: starter commit

* Update README.md

* Update README.md

* fix: fixed build errors if apps target maccatalyst and windows

* Update README.md

updated readme + added headers

* Update README.md

* feat: Signature view basic  setup

* fix: compelete setup for a signature view

* Create issues.md

Template for issues

* feat: A fully setup SignatureView that can help you create signature's + better sample

* fix: code cleanup

* feat: SignatureView is a readySignatureView

* chore: code clesn up

* Delete issues.md

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* fix: code clean up and other fixes for performance (#16)

* fix: memory leak fixes

* fix: code clean up for signaturePadview

* fix: files moved to helper

* fix: events moved post ctor

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* fix: Circular Image now comes from our control. (#17)

* fix: Circular Image now inherits from our Image control

* fix: update changes for some controls

* fix: code clean up and updates (#18)

* fix: Circular Image now inherits from our Image control

* fix: update changes for some controls

* chore: code cleanup

* fix: changes to signatureview

* fix: clear icon instead of label

* fix: ui changes for signature view

* fix: updated clear icon

* fix:SignatureView is optimized and cleaned up

* chore: updated readme.md

* Update README.md

updated license in readme

* fix: signature view now has better documentation

* fix: signature view now has better documentation

* fix: better positioming for clear icon

* chore: setup for 0.3 (#19)

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* Update Maui.FreakyControls.csproj

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* fix: removed extra semi-colons

* chore: feature request template (#23)

* fix: better visuals for readme and other changes (#22)

* feat: Freaky image is in town :)

* feat: Picker, DatePicker and Timepicker just got Freaky :D

* fix: handled some warnings

* feat: some changes to our files :)

* fix: TIL

* feat: TextInputLayout now has an outlined option :)

* fix: removed unwanted parts of the code

* fix: background color is now transparent for entry view

* feat: freaky image added for descriptions

* feat: final update for your freaky controls

* Update README.md

- updated readme with BMAC

* Update README.md

- Wiki configured and now control details are moved to the Wiki.

* fix: more information on properties

* feat: A UI for signatures + Handlers for unsupported platforms to avoid build errors  (#11)

* fix: starter commit

* Update README.md

* Update README.md

* fix: fixed build errors if apps target maccatalyst and windows

* Update README.md

updated readme + added headers

* Update README.md

* feat: Signature view basic  setup

* fix: compelete setup for a signature view

* Create issues.md

Template for issues

* feat: A fully setup SignatureView that can help you create signature's + better sample

* fix: code cleanup

* feat: SignatureView is a readySignatureView

* chore: code clesn up

* Delete issues.md

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* fix: code clean up and other fixes for performance (#16)

* fix: memory leak fixes

* fix: code clean up for signaturePadview

* fix: files moved to helper

* fix: events moved post ctor

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* fix: Circular Image now comes from our control. (#17)

* fix: Circular Image now inherits from our Image control

* fix: update changes for some controls

* fix: code clean up and updates (#18)

* fix: Circular Image now inherits from our Image control

* fix: update changes for some controls

* chore: code cleanup

* fix: changes to signatureview

* fix: clear icon instead of label

* fix: ui changes for signature view

* fix: updated clear icon

* fix:SignatureView is optimized and cleaned up

* chore: updated readme.md

* Update README.md

updated license in readme

* fix: signature view now has better documentation

* fix: signature view now has better documentation

* fix: better positioming for clear icon

* chore: setup for 0.3 (#19)

* fix: fix for nupkg and readme now has gifs (#20)

* fix: icon fix for nupkg

* Update README.md

- Added SignatureView for iOS

* Update README.md

fix: added screenshots for all controls :)

* Update README.md

updated the readme

* Update README.md

a better readme in general :)

* Update README.md

* fix: updated readme for better visual effects (#21)

* feat: merging new features to master (#14)

* feat: Freaky image is in town :)

* feat: Picker, DatePicker and Timepicker just got Freaky :D

* fix: handled some warnings

* feat: some changes to our files :)

* fix: TIL

* feat: TextInputLayout now has an outlined option :)

* fix: removed unwanted parts of the code

* fix: background color is now transparent for entry view

* feat: freaky image added for descriptions

* feat: final update for your freaky controls

* Update README.md

- updated readme with BMAC

* Update README.md

- Wiki configured and now control details are moved to the Wiki.

* fix: more information on properties

* feat: A UI for signatures + Handlers for unsupported platforms to avoid build errors  (#11)

* fix: starter commit

* Update README.md

* Update README.md

* fix: fixed build errors if apps target maccatalyst and windows

* Update README.md

updated readme + added headers

* Update README.md

* feat: Signature view basic  setup

* fix: compelete setup for a signature view

* Create issues.md

Template for issues

* feat: A fully setup SignatureView that can help you create signature's + better sample

* fix: code cleanup

* feat: SignatureView is a readySignatureView

* chore: code clesn up

* Delete issues.md

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* fix: code clean up and other fixes for performance (#16)

* fix: memory leak fixes

* fix: code clean up for signaturePadview

* fix: files moved to helper

* fix: events moved post ctor

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* fix: Circular Image now comes from our control. (#17)

* fix: Circular Image now inherits from our Image control

* fix: update changes for some controls

* fix: code clean up and updates (#18)

* fix: Circular Image now inherits from our Image control

* fix: update changes for some controls

* chore: code cleanup

* fix: changes to signatureview

* fix: clear icon instead of label

* fix: ui changes for signature view

* fix: updated clear icon

* fix:SignatureView is optimized and cleaned up

* chore: updated readme.md

* Update README.md

updated license in readme

* fix: signature view now has better documentation

* fix: signature view now has better documentation

* fix: better positioming for clear icon

* chore: setup for 0.3 (#19)

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* Update Maui.FreakyControls.csproj

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* chore: feature request template

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>

* feat:support for .net7 (#31)

* feat:support for .net7

* fix: updated samples

* feat: freaky checkbox is here  (#28)

* fix: basic freaky checkbox is here

* fix: checkbox handler

* fix: issue with TIL background color now works

* feat: Hello Checkbox

* feat: Freaky checkbox is ready to rule

* fix: bug fixes and code clean up

* fix: design issues and more

* Update README.md

fix: added checkbox images to readme

* fix: code clean up (#34)

* feat: checkboxes are even freakier now (#36)

* feat: checkbox are even freakier now

* fix: code clean up

* fix: code clean up

* fix: updated assembly version

* fix: commit for code clean up (#38)

* fix: commit for code clean up

* Update README.md

fixed checkbox

* fix: code clean up

Co-authored-by: Gulam Ali Hakim <jimtiyg@Gulams-MacBook-Pro.local>
  • Loading branch information
FreakyAli and Gulam Ali Hakim authored Nov 25, 2022
1 parent 51df774 commit 16d6ed4
Show file tree
Hide file tree
Showing 61 changed files with 288 additions and 341 deletions.
20 changes: 10 additions & 10 deletions MAUI.FreakyControls/MAUI.FreakyControls/Maui.FreakyControls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">23.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>

<RootNamespace>Maui.FreakyControls</RootNamespace>
<AssemblyVersion>0.4.1</AssemblyVersion>
<AssemblyFileVersion>0.4.1</AssemblyFileVersion>
<Version>0.4.1</Version>
<NeutralLanguage>en</NeutralLanguage>

<!--Version of C# to use -->
<PackageId>FreakyControls</PackageId>
<LangVersion>latest</LangVersion>
Expand All @@ -34,11 +32,11 @@
<Copyright>Copyright 2022</Copyright>
<PackOnBuild>true</PackOnBuild>
<SynchReleaseVersion>false</SynchReleaseVersion>
<NoWarn>1701;1702;IL2121;CS1573;CS1591;CS1570;CS8632</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<WarningLevel>4</WarningLevel>
<LangVersion>latest</LangVersion>
<NoWarn>1701;1702;IL2121;CS1573;CS1591;CS1570;CS8632</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<LangVersion>latest</LangVersion>
Expand All @@ -49,7 +47,7 @@
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<ItemGroup>
<None Remove="Platforms\iOS\" />
Expand Down Expand Up @@ -133,18 +131,20 @@
</SubType>
</MauiXaml>
<MauiXaml Update="Shared\FreakySignatureView\SignaturePadView.xaml">
<SubType></SubType>
<SubType>
</SubType>
</MauiXaml>
<MauiXaml Update="Shared\FreakyAutoCompleteView\AutoCompleteView.xaml">
<SubType></SubType>
<SubType>
</SubType>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<None Condition=" '$(EnableDefaultCompileItems)' == 'true' " Update="Platforms\iOS\{&#xA; {">
<ExcludeFromCurrentConfiguration>true</ExcludeFromCurrentConfiguration>
</None>
<None Condition=" '$(EnableDefaultCompileItems)' == 'true' " Update="Platforms\iOS\{&#xA; {">
<ExcludeFromCurrentConfiguration>true</ExcludeFromCurrentConfiguration>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="clear_icon.svg" />
<EmbeddedResource Include="clear_icon.svg" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Android.Content.Res;
using Android.Graphics;
using Android.Graphics.Drawables;
Expand All @@ -13,7 +13,6 @@
using static Android.Views.View;
using static Microsoft.Maui.ApplicationModel.Platform;


namespace Maui.FreakyControls;

public partial class FreakyEntryHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ private void OnViewTouchBegan()
entry.ImageCommand?.ExecuteCommandIfAvailable(entry.ImageCommandParameter);
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,40 @@

using Microsoft.Maui.Platform;

namespace Maui.FreakyControls
namespace Maui.FreakyControls;

public partial class FreakySignatureCanvasViewHandler
{
public partial class FreakySignatureCanvasViewHandler
{
protected override Platforms.iOS.SignaturePadCanvasView
CreatePlatformView() => new();
protected override Platforms.iOS.SignaturePadCanvasView
CreatePlatformView() => new();

private void OnImageStreamRequested(object sender, ImageStreamRequestedEventArgs e)
private void OnImageStreamRequested(object sender, ImageStreamRequestedEventArgs e)
{
var ctrl = this.PlatformView;
if (ctrl != null)
{
var ctrl = this.PlatformView;
if (ctrl != null)
{
var format = e.ImageFormat;

var settings = new Platforms.iOS.ImageConstructionSettings();
if (e.Settings.BackgroundColor != null)
{
settings.BackgroundColor = e.Settings.BackgroundColor.ToPlatform();
}
if (e.Settings.DesiredSizeOrScale.HasValue)
{
var val = e.Settings.DesiredSizeOrScale.Value;
settings.DesiredSizeOrScale = new Platforms.iOS.SizeOrScale(val.X, val.Y,
(SizeOrScaleType)(int)val.Type, val.KeepAspectRatio);
}
settings.ShouldCrop = e.Settings.ShouldCrop;
if (e.Settings.StrokeColor != null)
{
settings.StrokeColor = e.Settings.StrokeColor.ToPlatform();
}
settings.StrokeWidth = e.Settings.StrokeWidth;
settings.Padding = e.Settings.Padding;
var format = e.ImageFormat;

e.ImageStreamTask = ctrl.GetImageStreamAsync(format, settings);
var settings = new Platforms.iOS.ImageConstructionSettings();
if (e.Settings.BackgroundColor != null)
{
settings.BackgroundColor = e.Settings.BackgroundColor.ToPlatform();
}
if (e.Settings.DesiredSizeOrScale.HasValue)
{
var val = e.Settings.DesiredSizeOrScale.Value;
settings.DesiredSizeOrScale = new Platforms.iOS.SizeOrScale(val.X, val.Y,
(SizeOrScaleType)(int)val.Type, val.KeepAspectRatio);
}
settings.ShouldCrop = e.Settings.ShouldCrop;
if (e.Settings.StrokeColor != null)
{
settings.StrokeColor = e.Settings.StrokeColor.ToPlatform();
}
settings.StrokeWidth = e.Settings.StrokeWidth;
settings.Padding = e.Settings.Padding;

e.ImageStreamTask = ctrl.GetImageStreamAsync(format, settings);
}
}
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using SkiaSharp;
using SkiaSharp.Views.Maui;
using SkiaSharp.Views.Maui.Controls;
Expand Down Expand Up @@ -40,8 +40,6 @@ protected override void OnPropertyChanged(string propertyName = null)
{
return;
}

InvalidateSurface();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ public ImageAlignment ImageAlignment
{
get;
}
}

}
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
using System;
using System.Globalization;

namespace Maui.FreakyControls.Shared.Converters
namespace Maui.FreakyControls.Shared.Converters;

public abstract class BaseOneWayValueConverter : IValueConverter
{
public abstract class BaseOneWayValueConverter : IValueConverter
{
public abstract object Convert(object value, Type targetType, object parameter, CultureInfo culture);
public abstract object Convert(object value, Type targetType, object parameter, CultureInfo culture);

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException($"{GetType().Name} is a one-way converter");
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException($"{GetType().Name} is a one-way converter");
}
}

}
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
using System.Globalization;

namespace Maui.FreakyControls.Shared.Converters
namespace Maui.FreakyControls.Shared.Converters;

public class InverseBoolConverter : BaseOneWayValueConverter
{
public class InverseBoolConverter : BaseOneWayValueConverter
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
if (!(value is bool boolValue))
{
if (!(value is bool boolValue))
{
throw new ArgumentException("Value must be a boolean", nameof(value));
}

return !boolValue;
throw new ArgumentException("Value must be a boolean", nameof(value));
}
}
}

return !boolValue;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using System.Globalization;

namespace Maui.FreakyControls.Shared.Converters
namespace Maui.FreakyControls.Shared.Converters;

public class IsNullConverter : BaseOneWayValueConverter
{
public class IsNullConverter : BaseOneWayValueConverter
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value == null;
}
return value == null;
}
}

}
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
using System.Globalization;

namespace Maui.FreakyControls.Shared.Converters
namespace Maui.FreakyControls.Shared.Converters;

/// <summary>
/// String format converter.
/// This converter is safer than using MAUI' built-in Binding.StringFormat
/// because it will not throw an exception if the format is not a valid input string.
/// Instead, this will return the formatted string (if it is valid), the format string (if it is not valid),
/// or the value (if the parameter is not a string).
/// </summary>
public class StringFormatConverter : BaseOneWayValueConverter
{
/// <summary>
/// String format converter.
/// This converter is safer than using Xamarin.Forms' built-in Binding.StringFormat
/// because it will not throw an exception if the format is not a valid input string.
/// Instead, this will return the formatted string (if it is valid), the format string (if it is not valid),
/// or the value (if the parameter is not a string).
/// </summary>
public class StringFormatConverter : BaseOneWayValueConverter
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
// default the return value to the input value
object result = value;
try
{
// default the return value to the input value
object result = value;
try
{
if (targetType != typeof(string))
throw new ArgumentException($"Converter can only convert to string, {targetType} is not a supported target type", nameof(targetType));

if (parameter == null)
throw new ArgumentNullException(nameof(parameter), "Converter parameter must not be null");
if (targetType != typeof(string))
throw new ArgumentException($"Converter can only convert to string, {targetType} is not a supported target type", nameof(targetType));

if (!(parameter is string format))
throw new ArgumentException($"Converter parameter must be a string, {parameter.GetType()} is not supported", nameof(parameter));
if (parameter == null)
throw new ArgumentNullException(nameof(parameter), "Converter parameter must not be null");

// if the parameter is a string, update the return value to the string
result = parameter;
if (!(parameter is string format))
throw new ArgumentException($"Converter parameter must be a string, {parameter.GetType()} is not supported", nameof(parameter));

// attempt to format the value using the input string and update the return value
result = string.Format(culture, format, value);
}
catch
{
// suppress any exceptions as this will be used in XAML definitions
}
// if the parameter is a string, update the return value to the string
result = parameter;

return result;
// attempt to format the value using the input string and update the return value
result = string.Format(culture, format, value);
}
catch
{
// suppress any exceptions as this will be used in XAML definitions
}
}
}

return result;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using System.Globalization;

namespace Maui.FreakyControls.Shared.Converters
namespace Maui.FreakyControls.Shared.Converters;

public class StringIsNullOrWhitespaceConverter : BaseOneWayValueConverter
{
public class StringIsNullOrWhitespaceConverter : BaseOneWayValueConverter
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return string.IsNullOrWhiteSpace(value?.ToString());
}
return string.IsNullOrWhiteSpace(value?.ToString());
}
}

}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System;
using System.Globalization;

namespace Maui.FreakyControls.Shared.Converters
namespace Maui.FreakyControls.Shared.Converters;

public class StrokeThicknessConverter : BaseOneWayValueConverter
{
public class StrokeThicknessConverter : BaseOneWayValueConverter
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (bool)(value) ? 0 : (int)parameter;
}
return (bool)(value) ? 0 : (int)parameter;
}
}

}
Loading

0 comments on commit 16d6ed4

Please sign in to comment.