Skip to content

Commit

Permalink
WSC Config via SSM, tested on v2.x A11
Browse files Browse the repository at this point in the history
  • Loading branch information
NDZL committed Feb 23, 2024
1 parent 2321e15 commit 9809ae9
Show file tree
Hide file tree
Showing 41 changed files with 273 additions and 163 deletions.
32 changes: 0 additions & 32 deletions OEMInfo-MAUI-Sample/MainPage.xaml.cs

This file was deleted.

11 changes: 0 additions & 11 deletions OEMInfo-MAUI-Sample/Platforms/Android/AndroidManifest.xml

This file was deleted.

78 changes: 0 additions & 78 deletions OEMInfo-MAUI-Sample/Platforms/Android/MainActivity.cs

This file was deleted.

25 changes: 0 additions & 25 deletions README.md

This file was deleted.

14 changes: 7 additions & 7 deletions OEMInfo-MAUI-Sample.sln → WSC-MAUI-Sample.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34525.116
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OEMInfo-MAUI-Sample", "OEMInfo-MAUI-Sample\OEMInfo-MAUI-Sample.csproj", "{766C9153-0A0A-4942-8B9D-04F4251097B2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WSC-MAUI-Sample", "WSC-MAUI-Sample\WSC-MAUI-Sample.csproj", "{197E5EA9-4041-44C6-A1BB-3B4F520CCDDF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{766C9153-0A0A-4942-8B9D-04F4251097B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{766C9153-0A0A-4942-8B9D-04F4251097B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{766C9153-0A0A-4942-8B9D-04F4251097B2}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{766C9153-0A0A-4942-8B9D-04F4251097B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{766C9153-0A0A-4942-8B9D-04F4251097B2}.Release|Any CPU.Build.0 = Release|Any CPU
{766C9153-0A0A-4942-8B9D-04F4251097B2}.Release|Any CPU.Deploy.0 = Release|Any CPU
{197E5EA9-4041-44C6-A1BB-3B4F520CCDDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{197E5EA9-4041-44C6-A1BB-3B4F520CCDDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{197E5EA9-4041-44C6-A1BB-3B4F520CCDDF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{197E5EA9-4041-44C6-A1BB-3B4F520CCDDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{197E5EA9-4041-44C6-A1BB-3B4F520CCDDF}.Release|Any CPU.Build.0 = Release|Any CPU
{197E5EA9-4041-44C6-A1BB-3B4F520CCDDF}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
HeightRequest="185"
Aspect="AspectFit"
SemanticProperties.Description="dot net bot in a race car number eight" />
<Entry Placeholder="Entry: Type here to test captured keys" x:Name="entryKB" />

<Label
Text="Hello, World!"
Style="{StaticResource Headline}"
SemanticProperties.HeadingLevel="Level1" />

<Label
Text="Welcome to &#10;.NET Multi-platform App UI"
Text="WORKSTATION CONNECT MAUI SAMPLE APP"
Style="{StaticResource SubHeadline}"
SemanticProperties.HeadingLevel="Level2"
SemanticProperties.Description="Welcome to dot net Multi platform App U I"
Expand All @@ -28,7 +25,7 @@

<Button
x:Name="CounterBtn"
Text="Click me"
Text="Apply Sample WSC Configuraton"
SemanticProperties.Hint="Counts the number of times you click"
Clicked="OnCounterClicked"
HorizontalOptions="Fill" />
Expand Down
69 changes: 69 additions & 0 deletions WSC-MAUI-Sample/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using CommunityToolkit.Mvvm.Messaging;

namespace OEMInfo_MAUI_Sample
{
public partial class MainPage : ContentPage
{
int count = 0;

public MainPage()
{
InitializeComponent();

WeakReferenceMessenger.Default.Register<string>(this, (r, m) =>
{
MainThread.BeginInvokeOnMainThread(() => {
if(m.StartsWith("|"))
entryKB.Text += m.Substring(1);
else
lbDisplayDeviceId.Text = m+"\n"+lbDisplayDeviceId.Text;
});
});
}

public static void ModifyEntry()
{
Microsoft.Maui.Handlers.EntryHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
{
#if ANDROID
handler.PlatformView.KeyPress += (sender, e) =>
{
try
{
if (e.KeyCode == Android.Views.Keycode.Tab || e.KeyCode == Android.Views.Keycode.Enter)
{
e.Handled = true;

if ((e.KeyCode == Android.Views.Keycode.Enter) && (e.Event.Action == Android.Views.KeyEventActions.Up))
{
WeakReferenceMessenger.Default.Send("|<ENTER>");
((Entry)handler.VirtualView).SendCompleted();
}
}
else
e.Handled = false;
}
catch (Exception ex)
{
}
};
#endif
});
}

private void OnCounterClicked(object sender, EventArgs e)
{

WeakReferenceMessenger.Default.Send("#WSC");
count++;

if (count == 1)
CounterBtn.Text = $"Clicked {count} time";
else
CounterBtn.Text = $"Clicked {count} times";

SemanticScreenReader.Announce(CounterBtn.Text);
}
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging;
using Microsoft.Maui.Handlers;

namespace OEMInfo_MAUI_Sample
{
Expand All @@ -15,11 +16,17 @@ public static MauiApp CreateMauiApp()
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

MainPage.ModifyEntry();

#if DEBUG
builder.Logging.AddDebug();
builder.Logging.AddDebug();
#endif

return builder.Build();
}




}
}
19 changes: 19 additions & 0 deletions WSC-MAUI-Sample/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.zebra.provider.READ"/>
<uses-permission android:name="com.zebra.securestoragemanager.securecontentprovider.PERMISSION.WRITE"/>
<uses-permission android:name="com.zebra.securestoragemanager.securecontentprovider.PERMISSION.READ"/>


<queries>
<package android:name="com.zebra.zebracontentprovider" />
<package android:name="com.zebra.workstationconnect.release" />

<provider android:authorities="com.zebra.securestoragemanager.securecontentprovider"/>
<package android:name="com.zebra.securestoragemanager" />
</queries>

</manifest>
Loading

0 comments on commit 9809ae9

Please sign in to comment.