Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
516ddf0
Initialized uno project(s)
szv Jan 8, 2024
631c997
Renamed uno directory and moved solution
szv Jan 8, 2024
f46cb1d
Removed WeatherForecasts from WASM backend
szv Jan 8, 2024
6c492d2
Removed DataContracts-lib and weatherAPI-related code
szv Jan 8, 2024
bfa36e2
Renamed MainPage to ShellPage and moved it to Views/Pages
szv Jan 8, 2024
8b4e773
Renamed en strings to en-US
szv Jan 8, 2024
e423983
Added and ResourceExtension for localization
szv Jan 8, 2024
79bcaef
Added initial ShellPage
szv Jan 8, 2024
c83cd75
Installed vm nuget package
szv Jan 9, 2024
cadb04f
Added navigation related services
szv Jan 9, 2024
1ac4cef
Removed using
szv Jan 9, 2024
ac8485c
Added helper-CustomAttachedProperties
szv Jan 9, 2024
32e4994
Added empty GamePage
szv Jan 9, 2024
fe47e86
Added empty SettingsPage
szv Jan 9, 2024
a0f9517
Implemented ShellViewModel
szv Jan 9, 2024
b5dd315
Linked just implemented vm logic to ShellPage
szv Jan 9, 2024
d629863
Added InfoBar
szv Jan 9, 2024
81ae31b
Added demo button to try the infobar
szv Jan 9, 2024
b22c19c
Fixed initialization issue, where first page was initially not displa…
szv Jan 11, 2024
1b9718e
Replaced string resource files with the files from the WinUI project
szv Jan 12, 2024
805bdcb
Added customMarkupExtension for localized strings
szv Jan 12, 2024
dd1824c
Replaced hard-coded string with localized string
szv Jan 12, 2024
65d5a35
Added settings page incl vm and required service
szv Jan 12, 2024
ff55b7e
Updated nuget packages
szv Jan 12, 2024
961eb5d
Added dialogservice
szv Jan 13, 2024
ec56ed9
Registered gamesclient and gamepage-vm
szv Jan 13, 2024
79fe7a6
Added GamePage functionality
szv Jan 13, 2024
48edf5a
Explicitly installed newest version of SkiaSharp in order not to use …
szv Jan 15, 2024
618e7d6
Configured indent size for xaml and xml
szv Jan 15, 2024
aac1e81
Renamed namespace from _CodebreakerUno_ to _CodeBreaker.Uno_
szv Jan 17, 2024
4841c7b
Removed git folder from uno project
szv Jan 22, 2024
59980c1
Removed sample file
szv Jan 22, 2024
3d810e9
Removed .vscode, .editorconfig, .vsconfig
szv Jan 22, 2024
c034a9f
Removed .gitignore
szv Jan 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 271 additions & 0 deletions src/Codebreaker.Uno.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:supportsRtl="true"></application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
To add cross-platform image assets for your Uno Platform app, use the Assets folder
in the shared project instead. Assets in this folder are Android-only assets.

Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".

These files will be deployed with you package and will be accessible using Android's
AssetManager, like this:

public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

InputStream input = Assets.Open ("my_asset.txt");
}
}

Additionally, some Android functions will automatically load asset files:

Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
43 changes: 43 additions & 0 deletions src/Codebreaker.Uno/CodebreakerUno.Mobile/Android/Main.Android.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Com.Nostra13.Universalimageloader.Core;
using Microsoft.UI.Xaml.Media;

namespace CodeBreaker.Uno.Droid;

[global::Android.App.ApplicationAttribute(
Label = "@string/ApplicationName",
Icon = "@mipmap/icon",
LargeHeap = true,
HardwareAccelerated = true,
Theme = "@style/AppTheme"
)]
public class Application : Microsoft.UI.Xaml.NativeApplication
{
public Application(IntPtr javaReference, JniHandleOwnership transfer)
: base(() => new AppHead(), javaReference, transfer)
{
ConfigureUniversalImageLoader();
}

private static void ConfigureUniversalImageLoader()
{
// Create global configuration and initialize ImageLoader with this config
ImageLoaderConfiguration config = new ImageLoaderConfiguration
.Builder(Context)
.Build();

ImageLoader.Instance.Init(config);

ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
using Android.Widget;

namespace CodeBreaker.Uno.Droid;

[Activity(
MainLauncher = true,
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
)]
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
To add cross-platform image assets for your Uno Platform app, use the Assets folder
in the shared project instead. Resources in this folder are Android-only.

Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.

For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:

Resources/
drawable/
icon.png

layout/
main.axml

values/
strings.xml

In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:

public class R {
public class drawable {
public const int icon = 0x123;
}

public class layout {
public const int main = 0x456;
}

public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}

You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="Hello">Hello World, Click Me!</string>
<string name="ApplicationName">CodebreakerUno</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="AppTheme" parent="Theme.MaterialComponents.Light">

<!-- This removes the ActionBar -->
<item name="windowActionBar">false</item>
<item name="android:windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowNoTitle">true</item>

<!-- uno_splash_color and uno_splash_image are generated by Uno.Resizetizer -->
<!-- This property is used for the splash screen -->
<item name="android:windowSplashScreenBackground">@color/uno_splash_color</item>
<item name="android:windowBackground">@drawable/uno_splash_image</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/uno_splash_image</item>
</style>
<style name="Theme.AppCompat.Translucent">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>

</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(DotNetVersion)-android;$(DotNetVersion)-ios;$(DotNetVersion)-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="'$(OverrideTargetFramework)'!=''">$(OverrideTargetFramework)</TargetFrameworks>
<SingleProject>true</SingleProject>
<OutputType>Exe</OutputType>
<!-- Display name -->
<ApplicationTitle>CodebreakerUno</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.cninnovation.CodebreakerUno</ApplicationId>
<ApplicationIdGuid>8B465814-C9D8-4154-8207-D6CF4BA728F5</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<AndroidManifest>Android\AndroidManifest.xml</AndroidManifest>

<!-- Debugger workaround https://github.com/dotnet/maui-samples/blob/8aa6b8780b12e97b157514c3bdc54bb4a13001cd/HelloMacCatalyst/HelloMacCatalyst.csproj#L7 -->
<!-- <MtouchExtraArgs Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">$(MtouchExtraArgs) -setenv:MONO_THREADS_SUSPEND=preemptive</MtouchExtraArgs> -->
<!-- Required for C# Hot Reload -->
<UseInterpreter Condition="'$(Configuration)' == 'Debug' and $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'maccatalyst'">True</UseInterpreter>
<IsUnoHead>true</IsUnoHead>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Uno.WinUI" />
<PackageReference Include="CommunityToolkit.Mvvm" />
<PackageReference Include="Uno.Extensions.Configuration" />
<PackageReference Include="Uno.Extensions.Http" />
<PackageReference Include="Uno.Extensions.Http.Refit" />
<PackageReference Include="Uno.Extensions.Logging.WinUI" />
<PackageReference Include="Uno.Extensions.Serialization.Http" />
<PackageReference Include="Uno.Extensions.Serialization.Refit" />
<PackageReference Include="Uno.Toolkit.WinUI" />
<PackageReference Include="Uno.Extensions.Hosting.WinUI" />
<PackageReference Include="Uno.Extensions.Localization.WinUI" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
<PackageReference Include="Uno.Extensions.Logging.OSLog" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" />
<PackageReference Include="Uno.WinUI.DevServer" Condition="'$(Configuration)'=='Debug'" />
</ItemGroup>
<Choose>
<When Condition="$(IsAndroid)">
<ItemGroup>

<PackageReference Include="Xamarin.Google.Android.Material" />
<PackageReference Include="Uno.UniversalImageLoader" />
</ItemGroup>
<ItemGroup>
<AndroidEnvironment Include="Android/environment.conf" />
</ItemGroup>
</When>
<When Condition="$(IsIOS)">
<PropertyGroup>
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
<!-- See https://github.com/unoplatform/uno/issues/9430 for more details. -->
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)'==''">iossimulator-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<!-- https://github.com/xamarin/xamarin-macios/issues/14812 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>
</PropertyGroup>
</When>
<When Condition="$(IsMacCatalyst)">
<PropertyGroup>
<!-- Configure the GC -->
<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
<!-- Required for unknown crash as of .NET 6 Mobile Preview 13 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
<!-- Full globalization is required for Uno -->
<InvariantGlobalization>false</InvariantGlobalization>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)'==''">maccatalyst-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<!-- https://github.com/xamarin/xamarin-macios/issues/14812 -->
<MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>
</PropertyGroup>
</When>
</Choose>
<ItemGroup>
<ProjectReference Include="..\CodebreakerUno\CodebreakerUno.csproj" />
</ItemGroup>
<Import Project="..\CodebreakerUno.Shared\base.props" />

<Target Name="ValidateOverrides" BeforeTargets="Restore;_CheckForUnsupportedTargetFramework" Condition="'$(OverrideTargetFramework)' != ''">
<Error Text="OverrideTargetFramework set to '$(OverrideTargetFramework)' is missing valid target. Set OverrideTargetFramework to one of the TargetFrameworks for this project or skip building this project (eg unload the project in Visual Studio)" Condition="$(OverrideTargetFramework.Contains('windows10')) or !$(OverrideTargetFrameork.Contains('-'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>
26 changes: 26 additions & 0 deletions src/Codebreaker.Uno/CodebreakerUno.Mobile/MacCatalyst/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDeviceFamily</key>
<array>
<integer>2</integer>
</array>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/icon.appiconset</string>

<!--
Adjust this to your application's encryption usage.
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
-->
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using UIKit;

namespace CodeBreaker.Uno.MacCatalyst;

public class EntryPoint
{
// This is the main entry point of the application.
public static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppHead));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"images": [
{
"orientation": "portrait",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x",
"size": "640x960",
"idiom": "iphone"
},
{
"orientation": "portrait",
"extent": "full-screen",
"minimum-system-version": "7.0",
"subtype": "retina4",
"scale": "2x",
"size": "640x1136",
"idiom": "iphone"
},
{
"orientation": "portrait",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "1x",
"size": "768x1024",
"idiom": "ipad"
},
{
"orientation": "landscape",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "1x",
"size": "1024x768",
"idiom": "ipad"
},
{
"orientation": "portrait",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x",
"size": "1536x2048",
"idiom": "ipad"
},
{
"orientation": "landscape",
"extent": "full-screen",
"minimum-system-version": "7.0",
"scale": "2x",
"size": "2048x1536",
"idiom": "ipad"
}
],
"properties": {},
"info": {
"version": 1,
"author": ""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>
Loading