Skip to content

Commit

Permalink
Merge pull request #241 from enisn/maui/plainer-implementation
Browse files Browse the repository at this point in the history
Plainer implementation for AdvancedEntry
  • Loading branch information
enisn authored Mar 12, 2022
2 parents 7ab661a + 8f8049b commit 1fafa8f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 21 deletions.
8 changes: 7 additions & 1 deletion sandbox/SandboxMAUI/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace SandboxMAUI;
using InputKit.Handlers;

namespace SandboxMAUI;

public static class MauiProgram
{
Expand All @@ -12,6 +14,10 @@ public static MauiApp CreateMauiApp()
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});

builder.ConfigureMauiHandlers(handlers =>
{
handlers.AddInputKitHandlers();
});

return builder.Build();
}
Expand Down
8 changes: 2 additions & 6 deletions src/InputKit/Handlers/InputKitHandlersCollectionExtension.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
using InputKit.Shared.Layouts;
using Microsoft.Maui.Hosting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Plainer.Maui;

namespace InputKit.Handlers
{
Expand All @@ -13,6 +8,7 @@ public static class InputKitHandlersCollectionExtension
public static IMauiHandlersCollection AddInputKitHandlers(this IMauiHandlersCollection collection)
{
return collection
.AddPlainer()
.AddHandler(typeof(Shared.Controls.IconView), typeof(InputKit.Handlers.IconView.IconViewHandler))
.AddHandler(typeof(StatefulStackLayout), typeof(InputKit.Handlers.StatefulStackLayoutHandler));
}
Expand Down
4 changes: 4 additions & 0 deletions src/InputKit/InputKit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@
<ItemGroup>
<None Include="icon512.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Plainer.Maui" Version="1.2.0" />
</ItemGroup>
</Project>
9 changes: 3 additions & 6 deletions src/InputKit/Shared/Controls/AdvancedEntry.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using InputKit.Shared.Abstraction;
using InputKit.Shared.Configuration;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
using System;
using Plainer.Maui.Controls;
using System.Text.RegularExpressions;
using System.Windows.Input;

Expand Down Expand Up @@ -604,11 +601,11 @@ private void ApplyValidationPosition(LabelPosition position)

private protected virtual Entry GetInputEntry()
{
return new EmptyEntry
return new EntryView
{
TextColor = GlobalSetting.TextColor,
PlaceholderColor = Colors.LightGray,
HorizontalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.Fill,
VerticalOptions = LayoutOptions.Center,
FontFamily = GlobalSetting.FontFamily,
BackgroundColor = Colors.Transparent,
Expand Down
3 changes: 2 additions & 1 deletion src/InputKit/Shared/Controls/Dropdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
using Plainer.Maui.Controls;
using System;
using System.Collections;
using System.Collections.Specialized;
Expand Down Expand Up @@ -36,7 +37,7 @@ public partial class Dropdown : StatefulStackLayout, IValidatable
protected Label lblTitle = new Label { Margin = new Thickness(6, 0, 0, 0), IsVisible = false, TextColor = GlobalSetting.TextColor, LineBreakMode = LineBreakMode.TailTruncation, FontFamily = GlobalSetting.FontFamily };
protected Label lblAnnotation = new Label { Margin = new Thickness(6, 0, 0, 0), IsVisible = false, FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)), Opacity = 0.8, TextColor = GlobalSetting.TextColor, FontFamily = GlobalSetting.FontFamily };
protected Frame frmBackground = new Frame { Padding = 0, BackgroundColor = GlobalSetting.BackgroundColor, HasShadow = false, CornerRadius = (int)GlobalSetting.CornerRadius, BorderColor = GlobalSetting.BorderColor };
protected Entry txtInput = new EmptyEntry { TextColor = Colors.Blue, PlaceholderColor = Colors.Blue, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Center, FontFamily = GlobalSetting.FontFamily, IsEnabled = false };
protected Entry txtInput = new EntryView { TextColor = Colors.Blue, PlaceholderColor = Colors.Blue, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Center, FontFamily = GlobalSetting.FontFamily, IsEnabled = false };

private protected PopupMenu pMenu = new PopupMenu();
private string _placeholder;
Expand Down
7 changes: 0 additions & 7 deletions src/InputKit/Shared/Controls/EmptyEntry.cs

This file was deleted.

0 comments on commit 1fafa8f

Please sign in to comment.