Skip to content

Commit

Permalink
Replace Xamarin Apps with .NET Versions (#1773)
Browse files Browse the repository at this point in the history
  • Loading branch information
drasticactions authored Jul 16, 2024
1 parent f60d862 commit 41c7c43
Show file tree
Hide file tree
Showing 64 changed files with 350 additions and 466 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ bin
*.tree
*.zip
.idea
.DS_Store
20 changes: 8 additions & 12 deletions samples/ImapClientDemo.Android/ImapClientDemo.Android.sln
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29926.136
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImapClientDemo.Android", "ImapClientDemo.Android\ImapClientDemo.Android.csproj", "{E24B6562-C9B2-4190-A43C-116FA52AACE5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImapClientDemo.Android", "ImapClientDemo.Android\ImapClientDemo.Android.csproj", "{9E3D80A0-B988-4BA8-9327-3CD7BE5852DF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E24B6562-C9B2-4190-A43C-116FA52AACE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E24B6562-C9B2-4190-A43C-116FA52AACE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E24B6562-C9B2-4190-A43C-116FA52AACE5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{E24B6562-C9B2-4190-A43C-116FA52AACE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E24B6562-C9B2-4190-A43C-116FA52AACE5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AD43C050-ACBB-4A31-A155-C71AFC1D5AE2}
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9E3D80A0-B988-4BA8-9327-3CD7BE5852DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E3D80A0-B988-4BA8-9327-3CD7BE5852DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E3D80A0-B988-4BA8-9327-3CD7BE5852DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E3D80A0-B988-4BA8-9327-3CD7BE5852DF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?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:label="@string/app_name" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true">
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ protected async override void OnCreate (Bundle bundle)

Console.WriteLine ("FoldersCreated!");

SetContentView (Resource.Layout.FoldersLayout);
SetContentView (ImapClientDemo.Android.Resource.Layout.FoldersLayout);

listView = FindViewById<ListView> (Resource.Id.listView);
listView = FindViewById<ListView> (ImapClientDemo.Android.Resource.Id.listView);

adapter = new FoldersAdapter (this);

Expand Down Expand Up @@ -120,11 +120,11 @@ public override IMailFolder this [int index] {

public override View GetView (int position, View convertView, ViewGroup parent)
{
var view = convertView ?? LayoutInflater.FromContext (Parent).Inflate (Android.Resource.Layout.SimpleListItem1, parent, false);
var view = convertView ?? LayoutInflater.FromContext (Parent).Inflate (global::Android.Resource.Layout.SimpleListItem1, parent, false);

var folder = Folders[position];

view.FindViewById<TextView> (Android.Resource.Id.Text1).Text = folder.FullName;
view.FindViewById<TextView> (global::Android.Resource.Id.Text1).Text = folder.FullName;

return view;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,85 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{E24B6562-C9B2-4190-A43C-116FA52AACE5}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>ImapClientDemo</RootNamespace>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidApplication>True</AndroidApplication>
<AssemblyName>ImapClientDemo.Android</AssemblyName>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<TargetFrameworkVersion>v12.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<ConsolePause>false</ConsolePause>
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
<DebugSymbols>true</DebugSymbols>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<ConsolePause>false</ConsolePause>
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64</AndroidSupportedAbis>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="4.7.1.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="LoginActivity.cs" />
<Compile Include="Mail.cs" />
<Compile Include="FoldersActivity.cs" />
<Compile Include="MessageListActivity.cs" />
<Compile Include="MessageViewActivity.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\Main.axml" />
<AndroidResource Include="Resources\values\Strings.xml" />
<AndroidResource Include="Resources\drawable-hdpi\Icon.png" />
<AndroidResource Include="Resources\drawable-mdpi\Icon.png" />
<AndroidResource Include="Resources\drawable-xhdpi\Icon.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\Icon.png" />
<AndroidResource Include="Resources\drawable-xxxhdpi\Icon.png" />
<AndroidResource Include="Resources\layout\FoldersLayout.axml" />
<AndroidResource Include="Resources\layout\LoginLayout.axml" />
<AndroidResource Include="Resources\layout\MessagesLayout.axml" />
<AndroidResource Include="Resources\layout\ViewMessageLayout.axml" />
<AndroidResource Include="Resources\layout\MessageListItemLayout.axml" />
<AndroidResource Include="Resources\values\themes.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationId>com.companyname.ImapClientDemo.Android</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="4.7.1.1"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

SetContentView (Resource.Layout.LoginLayout);
SetContentView (ImapClientDemo.Android.Resource.Layout.LoginLayout);

textServer = FindViewById<TextView> (Resource.Id.textServer);
textPort = FindViewById<TextView> (Resource.Id.textPort);
textLogin = FindViewById<TextView> (Resource.Id.textLogin);
textPassword = FindViewById<TextView> (Resource.Id.textPassword);
checkSsl = FindViewById<CheckBox> (Resource.Id.checkSsl);
buttonLogin = FindViewById<Button> (Resource.Id.buttonLogin);
textServer = FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textServer);
textPort = FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textPort);
textLogin = FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textLogin);
textPassword = FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textPassword);
checkSsl = FindViewById<CheckBox> (ImapClientDemo.Android.Resource.Id.checkSsl);
buttonLogin = FindViewById<Button> (ImapClientDemo.Android.Resource.Id.buttonLogin);

buttonLogin.Click += buttonLogin_Click;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace ImapClientDemo
{
[Activity (Label = "ImapClientDemo.Android", MainLauncher = true, Icon = "@drawable/icon")]
[Activity (Label = "ImapClientDemo.Android", MainLauncher = true)]
public class MainActivity : Activity
{
protected override void OnCreate (Bundle bundle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
using Android.OS;
using Android.Views;
using Android.Widget;

using MailKit;

namespace ImapClientDemo
Expand All @@ -51,9 +50,9 @@ protected async override void OnCreate (Bundle bundle)

Title = Mail.CurrentFolder.FullName;

SetContentView (Resource.Layout.MessagesLayout);
SetContentView (ImapClientDemo.Android.Resource.Layout.MessagesLayout);

listView = FindViewById<ListView> (Resource.Id.listView);
listView = FindViewById<ListView> (ImapClientDemo.Android.Resource.Id.listView);

adapter = new MessageListAdapter (this);
listView.Adapter = adapter;
Expand Down Expand Up @@ -110,12 +109,12 @@ public override IMessageSummary this [int index] {

public override View GetView (int position, View convertView, ViewGroup parent)
{
var view = convertView ?? LayoutInflater.FromContext (Parent).Inflate (Resource.Layout.MessageListItemLayout, parent, false);
var view = convertView ?? LayoutInflater.FromContext (Parent).Inflate (ImapClientDemo.Android.Resource.Layout.MessageListItemLayout, parent, false);
var msg = Messages [position];

view.FindViewById<TextView> (Resource.Id.textSubject).Text = msg.Envelope.Subject;
view.FindViewById<TextView> (Resource.Id.textFrom).Text = msg.Envelope.From.ToString ();
view.FindViewById<TextView> (Resource.Id.textDate).Text = msg.Envelope.Date.Value.LocalDateTime.ToString ();
view.FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textSubject).Text = msg.Envelope.Subject;
view.FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textFrom).Text = msg.Envelope.From.ToString ();
view.FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textDate).Text = msg.Envelope.Date.Value.LocalDateTime.ToString ();

return view;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

SetContentView (Resource.Layout.ViewMessageLayout);
SetContentView (ImapClientDemo.Android.Resource.Layout.ViewMessageLayout);

textSubject = FindViewById<TextView> (Resource.Id.textSubject);
textFrom = FindViewById<TextView> (Resource.Id.textFrom);
textDate = FindViewById<TextView> (Resource.Id.textDate);
textBody = FindViewById<TextView> (Resource.Id.textBody);
textSubject = FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textSubject);
textFrom = FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textFrom);
textDate = FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textDate);
textBody = FindViewById<TextView> (ImapClientDemo.Android.Resource.Id.textBody);

var msg = Mail.CurrentMessage;

Expand Down

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/appicon_background" />
<foreground android:drawable="@mipmap/appicon_foreground" />
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/appicon_background" />
<foreground android:drawable="@mipmap/appicon_foreground" />
</adaptive-icon>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

29 changes: 10 additions & 19 deletions samples/ImapClientDemo.iOS/ImapClientDemo.iOS.sln
Original file line number Diff line number Diff line change
@@ -1,31 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29926.136
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImapClientDemo.iOS", "ImapClientDemo.iOS\ImapClientDemo.iOS.csproj", "{8C3CBC94-4386-4B01-A626-2014CFB8FFB8}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImapClientDemo.iOS", "ImapClientDemo.iOS\ImapClientDemo.iOS.csproj", "{764BD6BF-F53D-43E6-9D25-AD0B506BAFC7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhone = Debug|iPhone
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8C3CBC94-4386-4B01-A626-2014CFB8FFB8}.Debug|iPhone.ActiveCfg = Debug|iPhone
{8C3CBC94-4386-4B01-A626-2014CFB8FFB8}.Debug|iPhone.Build.0 = Debug|iPhone
{8C3CBC94-4386-4B01-A626-2014CFB8FFB8}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{8C3CBC94-4386-4B01-A626-2014CFB8FFB8}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{8C3CBC94-4386-4B01-A626-2014CFB8FFB8}.Release|iPhone.ActiveCfg = Release|iPhone
{8C3CBC94-4386-4B01-A626-2014CFB8FFB8}.Release|iPhone.Build.0 = Release|iPhone
{8C3CBC94-4386-4B01-A626-2014CFB8FFB8}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{8C3CBC94-4386-4B01-A626-2014CFB8FFB8}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {74F4CE45-3292-4B06-817F-9DEC2ADDE4E2}
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{764BD6BF-F53D-43E6-9D25-AD0B506BAFC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{764BD6BF-F53D-43E6-9D25-AD0B506BAFC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{764BD6BF-F53D-43E6-9D25-AD0B506BAFC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{764BD6BF-F53D-43E6-9D25-AD0B506BAFC7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Loading

0 comments on commit 41c7c43

Please sign in to comment.