-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding CustomEditor control, removing plainer package reference
- Loading branch information
1 parent
0a67446
commit 5348a24
Showing
12 changed files
with
98 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace LMKitMaestro.Controls; | ||
|
||
class CustomEditor : Editor | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using System; | ||
using Microsoft.Maui.Handlers; | ||
using Microsoft.Maui.Platform; | ||
|
||
#if ANDROID | ||
using Android.Graphics.Drawables; | ||
using AndroidX.AppCompat.Widget; | ||
using Microsoft.Maui.Controls.Platform; | ||
using Microsoft.Maui.Controls.Compatibility.Platform.Android; | ||
#endif | ||
|
||
#if WINDOWS | ||
using Microsoft.UI.Xaml.Controls; | ||
#endif | ||
|
||
namespace LMKitMaestro.Handlers; | ||
|
||
public partial class CustomEditorHandler : EditorHandler | ||
{ | ||
public CustomEditorHandler() | ||
{ | ||
} | ||
|
||
public CustomEditorHandler(IPropertyMapper mapper = null) : base(mapper) | ||
{ | ||
} | ||
} | ||
|
||
#if ANDROID | ||
public partial class EditorViewHandler : EditorHandler | ||
{ | ||
protected override AppCompatEditText CreatePlatformView() | ||
{ | ||
var nativeView = base.CreatePlatformView(); | ||
|
||
using (var gradientDrawable = new GradientDrawable()) | ||
{ | ||
gradientDrawable.SetColor(global::Android.Graphics.Color.Transparent); | ||
nativeView.SetBackground(gradientDrawable); | ||
nativeView.BackgroundTintList = Android.Content.Res.ColorStateList.ValueOf(Colors.Transparent.ToAndroid()); | ||
} | ||
|
||
return nativeView; | ||
} | ||
} | ||
#endif | ||
|
||
#if IOS || MACCATALYST | ||
public partial class EditorViewHandler : EditorHandler | ||
{ | ||
/* No any custom implementation required | ||
* Just keeping this handler to prevent build errors. | ||
*/ | ||
} | ||
#endif | ||
|
||
#if WINDOWS | ||
public partial class EditorViewHandler : EditorHandler | ||
{ | ||
protected override TextBox CreatePlatformView() | ||
{ | ||
var nativeView = base.CreatePlatformView(); | ||
|
||
nativeView.BorderThickness = new Microsoft.UI.Xaml.Thickness(0); | ||
nativeView.Style = null; | ||
return nativeView; | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters