Skip to content

Commit

Permalink
fix: checkbox are now officially freaky :D (#37)
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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* Update Maui.FreakyControls.csproj

Co-authored-by: Gulam Ali Hakim <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* Update Maui.FreakyControls.csproj

Co-authored-by: Gulam Ali Hakim <[email protected]>

Co-authored-by: Gulam Ali Hakim <[email protected]>

* chore: feature request template

Co-authored-by: Gulam Ali Hakim <[email protected]>

* 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

Co-authored-by: Gulam Ali Hakim <[email protected]>
  • Loading branch information
FreakyAli and Gulam Ali Hakim authored Nov 25, 2022
1 parent 992175c commit 51df774
Show file tree
Hide file tree
Showing 70 changed files with 811 additions and 1,027 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>

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

<!--Version of C# to use -->
Expand All @@ -29,7 +29,7 @@
<PackageProjectUrl>https://github.com/FreakyAli/MAUI.FreakyControls</PackageProjectUrl>
<RepositoryType>
</RepositoryType>
<PackageTags>Maui dotnet.Maui FreakyControls uikit Signature SignatureView Svg SvgImageView CircularImage TextInputLayout</PackageTags>
<PackageTags>Maui dotnet.Maui .net Maui FreakyControls Checkbox uikit Signature SignatureView Svg SvgImageView CircularImage TextInputLayout</PackageTags>
<PackageReleaseNotes>Basic implementation for all Freaky Controls</PackageReleaseNotes>
<Copyright>Copyright 2022</Copyright>
<PackOnBuild>true</PackOnBuild>
Expand All @@ -48,6 +48,9 @@
<EnableCodeSigning>false</EnableCodeSigning>
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<ItemGroup>
<None Remove="Platforms\iOS\" />
<None Remove="Platforms\Android\" />
Expand Down Expand Up @@ -144,4 +147,4 @@
<ItemGroup>
<EmbeddedResource Include="clear_icon.svg" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
using Maui.FreakyControls.Shared.Enums;
using static Microsoft.Maui.ApplicationModel.Platform;

namespace Maui.FreakyControls.Platforms.Android
{
public static class ControlExtensions
{
namespace Maui.FreakyControls.Platforms.Android;

}
}
public static class ControlExtensions
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ namespace Maui.FreakyControls;
public sealed partial class FreakyButtonHandler
{

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@
using AndroidX.AppCompat.Widget;
using Maui.FreakyControls.Platforms.Android.NativeControls;

namespace Maui.FreakyControls
namespace Maui.FreakyControls;

public partial class FreakyCircularImageHandler
{
public partial class FreakyCircularImageHandler
protected override ImageView CreatePlatformView()
{
protected override ImageView CreatePlatformView()
{
var imageView = new CircularImageView(Context);
var imageView = new CircularImageView(Context);

// Enable view bounds adjustment on measure.
// This allows the ImageView's OnMeasure method to account for the image's intrinsic
// aspect ratio during measurement, which gives us more useful values during constrained
// measurement passes.
imageView.SetAdjustViewBounds(true);
// Enable view bounds adjustment on measure.
// This allows the ImageView's OnMeasure method to account for the image's intrinsic
// aspect ratio during measurement, which gives us more useful values during constrained
// measurement passes.
imageView.SetAdjustViewBounds(true);

return imageView;
}
return imageView;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,51 @@
using static Microsoft.Maui.ApplicationModel.Platform;


namespace Maui.FreakyControls
namespace Maui.FreakyControls;

public partial class FreakyEntryHandler
{
public partial class FreakyEntryHandler
protected override AppCompatEditText CreatePlatformView()
{
var _nativeView = new FreakyEditText(Context);
var colorStateList = ColorStateList.ValueOf(Android.Graphics.Color.Transparent);
ViewCompat.SetBackgroundTintList(_nativeView, colorStateList);
return _nativeView;
}

internal void HandleAllowCopyPaste(FreakyEntry entry)
{
protected override AppCompatEditText CreatePlatformView()
if (entry.AllowCopyPaste)
{
var _nativeView = new FreakyEditText(Context);
var colorStateList = ColorStateList.ValueOf(Android.Graphics.Color.Transparent);
ViewCompat.SetBackgroundTintList(_nativeView, colorStateList);
return _nativeView;
PlatformView.CustomInsertionActionModeCallback = null;
PlatformView.CustomSelectionActionModeCallback = null;
}

internal void HandleAllowCopyPaste(FreakyEntry entry)
else
{
if (entry.AllowCopyPaste)
{
PlatformView.CustomInsertionActionModeCallback = null;
PlatformView.CustomSelectionActionModeCallback = null;
}
else
{
PlatformView.CustomInsertionActionModeCallback = new CustomInsertionActionModeCallback();
PlatformView.CustomSelectionActionModeCallback = new CustomSelectionActionModeCallback();
}
PlatformView.CustomInsertionActionModeCallback = new CustomInsertionActionModeCallback();
PlatformView.CustomSelectionActionModeCallback = new CustomSelectionActionModeCallback();
}
}

internal async Task HandleAndAlignImageSourceAsync(FreakyEntry entry)
internal async Task HandleAndAlignImageSourceAsync(FreakyEntry entry)
{
var imageBitmap = await entry.ImageSource?.ToNativeImageSourceAsync();
if (imageBitmap != null)
{
var imageBitmap = await entry.ImageSource?.ToNativeImageSourceAsync();
if (imageBitmap != null)
var bitmapDrawable = new BitmapDrawable(CurrentActivity.Resources,
Bitmap.CreateScaledBitmap(imageBitmap, entry.ImageWidth * 2, entry.ImageHeight * 2, true));
var freakyEditText = (PlatformView as FreakyEditText);
freakyEditText.SetDrawableClickListener(new DrawableHandlerCallback(entry));
switch (entry.ImageAlignment)
{
var bitmapDrawable = new BitmapDrawable(CurrentActivity.Resources,
Bitmap.CreateScaledBitmap(imageBitmap, entry.ImageWidth * 2, entry.ImageHeight * 2, true));
var freakyEditText = (PlatformView as FreakyEditText);
freakyEditText.SetDrawableClickListener(new DrawableHandlerCallback(entry));
switch (entry.ImageAlignment)
{
case ImageAlignment.Left:
freakyEditText.SetCompoundDrawablesWithIntrinsicBounds(bitmapDrawable, null, null, null);
break;
case ImageAlignment.Right:
freakyEditText.SetCompoundDrawablesWithIntrinsicBounds(null, null, bitmapDrawable, null);
break;
}
case ImageAlignment.Left:
freakyEditText.SetCompoundDrawablesWithIntrinsicBounds(bitmapDrawable, null, null, null);
break;
case ImageAlignment.Right:
freakyEditText.SetCompoundDrawablesWithIntrinsicBounds(null, null, bitmapDrawable, null);
break;
}
PlatformView.CompoundDrawablePadding = entry.ImagePadding;
}
PlatformView.CompoundDrawablePadding = entry.ImagePadding;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,37 @@
using Android.Widget;
using View = Android.Views.View;

namespace Maui.FreakyControls.Platforms.Android
namespace Maui.FreakyControls.Platforms.Android;

public abstract class FreakyMauiAppCompatActivity : MauiAppCompatActivity
{
public abstract class FreakyMauiAppCompatActivity : MauiAppCompatActivity
/// <summary>
/// A touch event handler that can be used to generally handle outside an entry field click event
/// so that it hides the keyboard when you do so.
/// </summary>
/// <param name="ev"></param>
/// <returns></returns>
public override bool DispatchTouchEvent(MotionEvent ev)
{
/// <summary>
/// A touch event handler that can be used to generally handle outside an entry field click event
/// so that it hides the keyboard when you do so.
/// </summary>
/// <param name="ev"></param>
/// <returns></returns>
public override bool DispatchTouchEvent(MotionEvent ev)
try
{
try
{
View view = CurrentFocus;
if (view != null && (ev.Action == MotionEventActions.Up || ev.Action == MotionEventActions.Move) &&
view is EditText &&
!view.Class.Name.StartsWith("android.webkit."))
{
int[] Touch = new int[2];
view.GetLocationOnScreen(Touch);
float x = ev.RawX + view.Left - Touch[0];
float y = ev.RawY + view.Top - Touch[1];
if (x < view.Left || x > view.Right || y < view.Top || y > view.Bottom)
((InputMethodManager)GetSystemService(InputMethodService)).
HideSoftInputFromWindow((Window.DecorView.ApplicationWindowToken), 0);
}
}
catch
View view = CurrentFocus;
if (view != null && (ev.Action == MotionEventActions.Up || ev.Action == MotionEventActions.Move) &&
view is EditText &&
!view.Class.Name.StartsWith("android.webkit."))
{

int[] Touch = new int[2];
view.GetLocationOnScreen(Touch);
float x = ev.RawX + view.Left - Touch[0];
float y = ev.RawY + view.Top - Touch[1];
if (x < view.Left || x > view.Right || y < view.Top || y > view.Bottom)
((InputMethodManager)GetSystemService(InputMethodService)).
HideSoftInputFromWindow((Window.DecorView.ApplicationWindowToken), 0);
}
return base.DispatchTouchEvent(ev);
}
catch
{
}
return base.DispatchTouchEvent(ev);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ internal async Task HandleAndAlignImageSourceAsync(FreakyPicker entry)
}
PlatformView.CompoundDrawablePadding = entry.ImagePadding;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ internal async Task HandleAndAlignImageSourceAsync(FreakyTimePicker entry)
PlatformView.CompoundDrawablePadding = entry.ImagePadding;
}


void ShowPickerDialog()
{
if (VirtualView == null)
Expand Down Expand Up @@ -92,6 +91,5 @@ void HidePickerDialog()
}

bool Use24HourView => VirtualView != null && (DateFormat.Is24HourFormat(PlatformView?.Context)
&& VirtualView.Format == "t" || VirtualView.Format == "HH:mm");
}

&& (VirtualView.Format == "t") || (VirtualView.Format == "HH:mm"));
}
Loading

0 comments on commit 51df774

Please sign in to comment.