From 326ea0344b6fe7a213ead6d937c2b9fdf4f04c33 Mon Sep 17 00:00:00 2001 From: ziomek64 Date: Mon, 20 Nov 2023 16:09:06 +0100 Subject: [PATCH] =?UTF-8?q?Dodaj=20pliki=20projekt=C3=B3w.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 167 ++++++++ .gitignore | 403 ++++++++++++++++++ .vsconfig | 25 ++ Directory.Build.props | 88 ++++ Directory.Build.targets | 6 + Directory.Packages.props | 27 ++ UnoApp6.Base/AppHead.xaml | 17 + UnoApp6.Base/AppHead.xaml.cs | 27 ++ UnoApp6.Base/Icons/icon.svg | 42 ++ UnoApp6.Base/Icons/icon_foreground.svg | 137 ++++++ UnoApp6.Base/Splash/splash_screen.svg | 137 ++++++ UnoApp6.Base/UnoApp6.Base.csproj | 12 + UnoApp6.Base/base.props | 30 ++ UnoApp6.Mobile/Android/AndroidManifest.xml | 4 + UnoApp6.Mobile/Android/Assets/AboutAssets.txt | 22 + UnoApp6.Mobile/Android/Main.Android.cs | 42 ++ .../Android/MainActivity.Android.cs | 15 + .../Android/Resources/AboutResources.txt | 47 ++ .../Android/Resources/values/Strings.xml | 5 + .../Android/Resources/values/Styles.xml | 22 + ...WebAuthenticationBrokerActivity.Android.cs | 15 + UnoApp6.Mobile/Android/environment.conf | 2 + UnoApp6.Mobile/UnoApp6.Mobile.csproj | 58 +++ UnoApp6.sln | 58 +++ UnoApp6/App.cs | 110 +++++ UnoApp6/AppResources.xaml | 14 + UnoApp6/Assets/Icons/back.svg | 3 + UnoApp6/Assets/SharedAssets.md | 32 ++ UnoApp6/Business/Models/AppConfig.cs | 6 + UnoApp6/Business/Models/Entity.cs | 3 + UnoApp6/Business/Models/Web.cs | 7 + UnoApp6/GlobalUsings.cs | 19 + UnoApp6/Presentation/LoginPage.xaml | 31 ++ UnoApp6/Presentation/LoginPage.xaml.cs | 9 + UnoApp6/Presentation/LoginViewModel.cs | 32 ++ UnoApp6/Presentation/MainPage.xaml | 31 ++ UnoApp6/Presentation/MainPage.xaml.cs | 9 + UnoApp6/Presentation/MainViewModel.cs | 39 ++ UnoApp6/Presentation/SecondPage.xaml | 36 ++ UnoApp6/Presentation/SecondPage.xaml.cs | 10 + UnoApp6/Presentation/SecondViewModel.cs | 5 + UnoApp6/Presentation/Shell.xaml | 36 ++ UnoApp6/Presentation/Shell.xaml.cs | 10 + UnoApp6/Presentation/ShellViewModel.cs | 23 + UnoApp6/Strings/en/Resources.resw | 123 ++++++ UnoApp6/Styles/ColorPaletteOverride.xaml | 65 +++ UnoApp6/Styles/MaterialFontsOverride.xaml | 8 + UnoApp6/UnoApp6.csproj | 45 ++ UnoApp6/appsettings.development.json | 9 + UnoApp6/appsettings.json | 9 + solution-config.props.sample | 22 + 51 files changed, 2154 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 .vsconfig create mode 100644 Directory.Build.props create mode 100644 Directory.Build.targets create mode 100644 Directory.Packages.props create mode 100644 UnoApp6.Base/AppHead.xaml create mode 100644 UnoApp6.Base/AppHead.xaml.cs create mode 100644 UnoApp6.Base/Icons/icon.svg create mode 100644 UnoApp6.Base/Icons/icon_foreground.svg create mode 100644 UnoApp6.Base/Splash/splash_screen.svg create mode 100644 UnoApp6.Base/UnoApp6.Base.csproj create mode 100644 UnoApp6.Base/base.props create mode 100644 UnoApp6.Mobile/Android/AndroidManifest.xml create mode 100644 UnoApp6.Mobile/Android/Assets/AboutAssets.txt create mode 100644 UnoApp6.Mobile/Android/Main.Android.cs create mode 100644 UnoApp6.Mobile/Android/MainActivity.Android.cs create mode 100644 UnoApp6.Mobile/Android/Resources/AboutResources.txt create mode 100644 UnoApp6.Mobile/Android/Resources/values/Strings.xml create mode 100644 UnoApp6.Mobile/Android/Resources/values/Styles.xml create mode 100644 UnoApp6.Mobile/Android/WebAuthenticationBrokerActivity.Android.cs create mode 100644 UnoApp6.Mobile/Android/environment.conf create mode 100644 UnoApp6.Mobile/UnoApp6.Mobile.csproj create mode 100644 UnoApp6.sln create mode 100644 UnoApp6/App.cs create mode 100644 UnoApp6/AppResources.xaml create mode 100644 UnoApp6/Assets/Icons/back.svg create mode 100644 UnoApp6/Assets/SharedAssets.md create mode 100644 UnoApp6/Business/Models/AppConfig.cs create mode 100644 UnoApp6/Business/Models/Entity.cs create mode 100644 UnoApp6/Business/Models/Web.cs create mode 100644 UnoApp6/GlobalUsings.cs create mode 100644 UnoApp6/Presentation/LoginPage.xaml create mode 100644 UnoApp6/Presentation/LoginPage.xaml.cs create mode 100644 UnoApp6/Presentation/LoginViewModel.cs create mode 100644 UnoApp6/Presentation/MainPage.xaml create mode 100644 UnoApp6/Presentation/MainPage.xaml.cs create mode 100644 UnoApp6/Presentation/MainViewModel.cs create mode 100644 UnoApp6/Presentation/SecondPage.xaml create mode 100644 UnoApp6/Presentation/SecondPage.xaml.cs create mode 100644 UnoApp6/Presentation/SecondViewModel.cs create mode 100644 UnoApp6/Presentation/Shell.xaml create mode 100644 UnoApp6/Presentation/Shell.xaml.cs create mode 100644 UnoApp6/Presentation/ShellViewModel.cs create mode 100644 UnoApp6/Strings/en/Resources.resw create mode 100644 UnoApp6/Styles/ColorPaletteOverride.xaml create mode 100644 UnoApp6/Styles/MaterialFontsOverride.xaml create mode 100644 UnoApp6/UnoApp6.csproj create mode 100644 UnoApp6/appsettings.development.json create mode 100644 UnoApp6/appsettings.json create mode 100644 solution-config.props.sample diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b947be6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,167 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +# This file is the top-most EditorConfig file +root = true + +########################################## +# Common Settings +########################################## + +[*] +indent_style = space +end_of_line = crlf +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 + +########################################## +# File Extension Settings +########################################## + +[*.{yml,yaml}] +indent_size = 2 + +[.vsconfig] +indent_size = 2 +end_of_line = lf + +[*.sln] +indent_style = tab +indent_size = 2 + +[*.{csproj,proj,projitems,shproj}] +indent_size = 2 + +[*.{json,slnf}] +indent_size = 2 +end_of_line = lf + +[*.{props,targets}] +indent_size = 2 + +[*.xaml] +indent_size = 2 +charset = utf-8-bom + +[*.xml] +indent_size = 2 +end_of_line = lf + +[*.plist] +indent_size = 2 +indent_style = tab +end_of_line = lf + +[*.manifest] +indent_size = 2 + +[*.appxmanifest] +indent_size = 2 + +[*.{json,css,webmanifest}] +indent_size = 2 +end_of_line = lf + +[web.config] +indent_size = 2 +end_of_line = lf + +[*.sh] +indent_size = 2 +end_of_line = lf + +[*.cs] +# EOL should be normalized by Git. See https://github.com/dotnet/format/issues/1099 +end_of_line = unset + +# See https://github.com/dotnet/roslyn/issues/20356#issuecomment-310143926 +trim_trailing_whitespace = false + +tab_width = 4 +indent_size = 4 + +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = true + +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion + +csharp_indent_labels = one_less_than_current +csharp_using_directive_placement = outside_namespace:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent +csharp_style_namespace_declarations = file_scoped:warning +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bc55501 --- /dev/null +++ b/.gitignore @@ -0,0 +1,403 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +# Single Target Config +solution-config.props +# Windows Publish Profiles +!**/*.Windows/Properties/PublishProfiles/*.pubxml \ No newline at end of file diff --git a/.vsconfig b/.vsconfig new file mode 100644 index 0000000..7131fa7 --- /dev/null +++ b/.vsconfig @@ -0,0 +1,25 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Component.CoreEditor", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.NetCore.Component.SDK", + "Microsoft.NetCore.Component.DevelopmentTools", + "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", + "Microsoft.VisualStudio.Component.TextTemplating", + "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", + "Microsoft.VisualStudio.Component.Debugger.JustInTime", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.Component.NetFX.Native", + "Microsoft.VisualStudio.Component.Graphics", + "Microsoft.VisualStudio.Component.Merq", + "Microsoft.VisualStudio.Component.MonoDebugger", + "Component.Xamarin", + "Microsoft.VisualStudio.ComponentGroup.Maui.All", + "Component.Android.SDK34", + "Component.Android.SDK33", + "Component.OpenJDK", + "Microsoft.VisualStudio.Workload.NetCrossPlat", + "Microsoft.VisualStudio.Workload.NetCoreTools" + ] +} diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..a43971d --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,88 @@ + + + + + + + + enable + enable + + portable + True + + true + + + $(NoWarn);NU1507;NETSDK1201;PRI257 + + en + + false + false + false + false + false + + + false + + + + + + true + 21.0 + + + + + true + 14.2 + + + + + + + + + + + + true + 10.14 + + + + + true + 14.0 + + + + + true + 10.0.18362.0 + 10.0.18362.0 + win-x86;win-x64;win-arm64 + false + + + + + diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 0000000..f624a92 --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,6 @@ + + + + + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..a3b0370 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UnoApp6.Base/AppHead.xaml b/UnoApp6.Base/AppHead.xaml new file mode 100644 index 0000000..7db59ed --- /dev/null +++ b/UnoApp6.Base/AppHead.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/UnoApp6.Base/AppHead.xaml.cs b/UnoApp6.Base/AppHead.xaml.cs new file mode 100644 index 0000000..82420c6 --- /dev/null +++ b/UnoApp6.Base/AppHead.xaml.cs @@ -0,0 +1,27 @@ +using Microsoft.UI.Xaml; +using Uno.Resizetizer; + +namespace UnoApp6; +public sealed partial class AppHead : App +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public AppHead() + { + this.InitializeComponent(); + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + base.OnLaunched(args); + + MainWindow.SetWindowIcon(); + } +} diff --git a/UnoApp6.Base/Icons/icon.svg b/UnoApp6.Base/Icons/icon.svg new file mode 100644 index 0000000..a15af53 --- /dev/null +++ b/UnoApp6.Base/Icons/icon.svg @@ -0,0 +1,42 @@ + + + + + + diff --git a/UnoApp6.Base/Icons/icon_foreground.svg b/UnoApp6.Base/Icons/icon_foreground.svg new file mode 100644 index 0000000..8ffc41a --- /dev/null +++ b/UnoApp6.Base/Icons/icon_foreground.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UnoApp6.Base/Splash/splash_screen.svg b/UnoApp6.Base/Splash/splash_screen.svg new file mode 100644 index 0000000..8ffc41a --- /dev/null +++ b/UnoApp6.Base/Splash/splash_screen.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UnoApp6.Base/UnoApp6.Base.csproj b/UnoApp6.Base/UnoApp6.Base.csproj new file mode 100644 index 0000000..e762347 --- /dev/null +++ b/UnoApp6.Base/UnoApp6.Base.csproj @@ -0,0 +1,12 @@ + + + + net8.0 + false + + + + + + + diff --git a/UnoApp6.Base/base.props b/UnoApp6.Base/base.props new file mode 100644 index 0000000..1846763 --- /dev/null +++ b/UnoApp6.Base/base.props @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + diff --git a/UnoApp6.Mobile/Android/AndroidManifest.xml b/UnoApp6.Mobile/Android/AndroidManifest.xml new file mode 100644 index 0000000..95ae075 --- /dev/null +++ b/UnoApp6.Mobile/Android/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/UnoApp6.Mobile/Android/Assets/AboutAssets.txt b/UnoApp6.Mobile/Android/Assets/AboutAssets.txt new file mode 100644 index 0000000..210a93b --- /dev/null +++ b/UnoApp6.Mobile/Android/Assets/AboutAssets.txt @@ -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"); diff --git a/UnoApp6.Mobile/Android/Main.Android.cs b/UnoApp6.Mobile/Android/Main.Android.cs new file mode 100644 index 0000000..42cb2cb --- /dev/null +++ b/UnoApp6.Mobile/Android/Main.Android.cs @@ -0,0 +1,42 @@ +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 UnoApp6.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; + } +} + diff --git a/UnoApp6.Mobile/Android/MainActivity.Android.cs b/UnoApp6.Mobile/Android/MainActivity.Android.cs new file mode 100644 index 0000000..ad083f7 --- /dev/null +++ b/UnoApp6.Mobile/Android/MainActivity.Android.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; +using Android.Views; +using Android.Widget; + +namespace UnoApp6.Droid; +[Activity( + MainLauncher = true, + ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges, + WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden +)] +public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity +{ +} diff --git a/UnoApp6.Mobile/Android/Resources/AboutResources.txt b/UnoApp6.Mobile/Android/Resources/AboutResources.txt new file mode 100644 index 0000000..17e3b13 --- /dev/null +++ b/UnoApp6.Mobile/Android/Resources/AboutResources.txt @@ -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. diff --git a/UnoApp6.Mobile/Android/Resources/values/Strings.xml b/UnoApp6.Mobile/Android/Resources/values/Strings.xml new file mode 100644 index 0000000..c209ff0 --- /dev/null +++ b/UnoApp6.Mobile/Android/Resources/values/Strings.xml @@ -0,0 +1,5 @@ + + + Hello World, Click Me! + UnoApp6 + diff --git a/UnoApp6.Mobile/Android/Resources/values/Styles.xml b/UnoApp6.Mobile/Android/Resources/values/Styles.xml new file mode 100644 index 0000000..c02bd06 --- /dev/null +++ b/UnoApp6.Mobile/Android/Resources/values/Styles.xml @@ -0,0 +1,22 @@ + + + + + + diff --git a/UnoApp6.Mobile/Android/WebAuthenticationBrokerActivity.Android.cs b/UnoApp6.Mobile/Android/WebAuthenticationBrokerActivity.Android.cs new file mode 100644 index 0000000..220ccd1 --- /dev/null +++ b/UnoApp6.Mobile/Android/WebAuthenticationBrokerActivity.Android.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; +using Android.Views; +using Android.Widget; + +namespace UnoApp6.Droid; +[Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop, Exported = true)] +[IntentFilter( + new[] { Android.Content.Intent.ActionView }, + Categories = new[] { Android.Content.Intent.CategoryDefault, Android.Content.Intent.CategoryBrowsable }, + DataScheme = "myprotocol")] +public class WebAuthenticationBrokerActivity : Uno.AuthenticationBroker.WebAuthenticationBrokerActivityBase +{ +} diff --git a/UnoApp6.Mobile/Android/environment.conf b/UnoApp6.Mobile/Android/environment.conf new file mode 100644 index 0000000..fa6c2e3 --- /dev/null +++ b/UnoApp6.Mobile/Android/environment.conf @@ -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 \ No newline at end of file diff --git a/UnoApp6.Mobile/UnoApp6.Mobile.csproj b/UnoApp6.Mobile/UnoApp6.Mobile.csproj new file mode 100644 index 0000000..4a92eb5 --- /dev/null +++ b/UnoApp6.Mobile/UnoApp6.Mobile.csproj @@ -0,0 +1,58 @@ + + + net8.0-android + $(OverrideTargetFrameworks) + true + Exe + + UnoApp6 + + com.companyname.UnoApp6 + FA5EB134-8D44-484D-BC05-11C2F25368A8 + + 1.0 + 1 + + Android\AndroidManifest.xml + + + + + True + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UnoApp6.sln b/UnoApp6.sln new file mode 100644 index 0000000..6418779 --- /dev/null +++ b/UnoApp6.sln @@ -0,0 +1,58 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34309.116 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{96721A18-E41B-4FD8-BB08-28FE244B0782}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platforms", "Platforms", "{4C4BA15D-CFF9-49AA-830C-932BDD50CE4C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoApp6", "UnoApp6\UnoApp6.csproj", "{1BC53220-3492-4A69-AB4D-AA5A7A911B5E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoApp6.Base", "UnoApp6.Base\UnoApp6.Base.csproj", "{F64583BA-F853-414D-BFCB-701FEA537DFB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnoApp6.Mobile", "UnoApp6.Mobile\UnoApp6.Mobile.csproj", "{A9C25EB0-D4E7-4CB9-B2DE-4B27A14414BE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3BBB0FBD-69EC-4DA7-95A3-F49DECFA8CFF}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props + solution-config.props.sample = solution-config.props.sample + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1BC53220-3492-4A69-AB4D-AA5A7A911B5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1BC53220-3492-4A69-AB4D-AA5A7A911B5E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1BC53220-3492-4A69-AB4D-AA5A7A911B5E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1BC53220-3492-4A69-AB4D-AA5A7A911B5E}.Release|Any CPU.Build.0 = Release|Any CPU + {F64583BA-F853-414D-BFCB-701FEA537DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F64583BA-F853-414D-BFCB-701FEA537DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F64583BA-F853-414D-BFCB-701FEA537DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F64583BA-F853-414D-BFCB-701FEA537DFB}.Release|Any CPU.Build.0 = Release|Any CPU + {A9C25EB0-D4E7-4CB9-B2DE-4B27A14414BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9C25EB0-D4E7-4CB9-B2DE-4B27A14414BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9C25EB0-D4E7-4CB9-B2DE-4B27A14414BE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {A9C25EB0-D4E7-4CB9-B2DE-4B27A14414BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9C25EB0-D4E7-4CB9-B2DE-4B27A14414BE}.Release|Any CPU.Build.0 = Release|Any CPU + {A9C25EB0-D4E7-4CB9-B2DE-4B27A14414BE}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {4C4BA15D-CFF9-49AA-830C-932BDD50CE4C} = {96721A18-E41B-4FD8-BB08-28FE244B0782} + {1BC53220-3492-4A69-AB4D-AA5A7A911B5E} = {96721A18-E41B-4FD8-BB08-28FE244B0782} + {F64583BA-F853-414D-BFCB-701FEA537DFB} = {4C4BA15D-CFF9-49AA-830C-932BDD50CE4C} + {A9C25EB0-D4E7-4CB9-B2DE-4B27A14414BE} = {4C4BA15D-CFF9-49AA-830C-932BDD50CE4C} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5416D28C-1668-4D0E-A707-56DC95E0ABE0} + EndGlobalSection +EndGlobal diff --git a/UnoApp6/App.cs b/UnoApp6/App.cs new file mode 100644 index 0000000..7e0e1a1 --- /dev/null +++ b/UnoApp6/App.cs @@ -0,0 +1,110 @@ +namespace UnoApp6; + +public class App : Application +{ + protected Window? MainWindow { get; private set; } + protected IHost? Host { get; private set; } + + protected async override void OnLaunched(LaunchActivatedEventArgs args) + { + var builder = this.CreateBuilder(args) + // Add navigation support for toolkit controls such as TabBar and NavigationView + .UseToolkitNavigation() + .Configure(host => host +#if DEBUG + // Switch to Development environment when running in DEBUG + .UseEnvironment(Environments.Development) +#endif + + .UseSerialization() + .UseLogging(configure: (context, logBuilder) => + { + // Configure log levels for different categories of logging + logBuilder + .SetMinimumLevel( + context.HostingEnvironment.IsDevelopment() ? + LogLevel.Information : + LogLevel.Warning) + + // Default filters for core Uno Platform namespaces + .CoreLogLevel(LogLevel.Warning); + + // Uno Platform namespace filter groups + // Uncomment individual methods to see more detailed logging + //// Generic Xaml events + //logBuilder.XamlLogLevel(LogLevel.Debug); + //// Layout specific messages + //logBuilder.XamlLayoutLogLevel(LogLevel.Debug); + //// Storage messages + //logBuilder.StorageLogLevel(LogLevel.Debug); + //// Binding related messages + //logBuilder.XamlBindingLogLevel(LogLevel.Debug); + //// Binder memory references tracking + //logBuilder.BinderMemoryReferenceLogLevel(LogLevel.Debug); + //// DevServer and HotReload related + //logBuilder.HotReloadCoreLogLevel(LogLevel.Information); + //// Debug JS interop + //logBuilder.WebAssemblyLogLevel(LogLevel.Debug); + + }, enableUnoLogging: true) + .UseConfiguration(configure: configBuilder => + configBuilder + .EmbeddedSource() + .Section() + ) + + .UseAuthentication(auth => + auth.AddWeb() + ) + + + .ConfigureServices((context, services) => + { + // TODO: Register your services + //services.AddSingleton(); + }) + .UseNavigation(RegisterRoutes) + ); + MainWindow = builder.Window; + +#if DEBUG + MainWindow.EnableHotReload(); +#endif + + Host = await builder.NavigateAsync(initialNavigate: + async (services, navigator) => + { + var auth = services.GetRequiredService(); + var authenticated = await auth.RefreshAsync(); + if (authenticated) + { + await navigator.NavigateViewModelAsync(this, qualifier: Qualifiers.Nested); + } + else + { + await navigator.NavigateViewModelAsync(this, qualifier: Qualifiers.Nested); + } + }); + } + + private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes) + { + views.Register( + new ViewMap(ViewModel: typeof(ShellViewModel)), + new ViewMap(), + new ViewMap(), + new DataViewMap() + ); + + routes.Register( + new RouteMap("", View: views.FindByViewModel(), + Nested: new RouteMap[] + { + new RouteMap("Login", View: views.FindByViewModel()), + new RouteMap("Main", View: views.FindByViewModel()), + new RouteMap("Second", View: views.FindByViewModel()), + } + ) + ); + } +} diff --git a/UnoApp6/AppResources.xaml b/UnoApp6/AppResources.xaml new file mode 100644 index 0000000..3854d87 --- /dev/null +++ b/UnoApp6/AppResources.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/UnoApp6/Assets/Icons/back.svg b/UnoApp6/Assets/Icons/back.svg new file mode 100644 index 0000000..bcd7851 --- /dev/null +++ b/UnoApp6/Assets/Icons/back.svg @@ -0,0 +1,3 @@ + + + diff --git a/UnoApp6/Assets/SharedAssets.md b/UnoApp6/Assets/SharedAssets.md new file mode 100644 index 0000000..1b84a74 --- /dev/null +++ b/UnoApp6/Assets/SharedAssets.md @@ -0,0 +1,32 @@ +# Shared Assets + +See documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md + +## Here is a cheat sheet + +1. Add the image file to the `Assets` directory of a shared project. +2. Set the build action to `Content`. +3. (Recommended) Provide an asset for various scales/dpi + +### Examples + +```text +\Assets\Images\logo.scale-100.png +\Assets\Images\logo.scale-200.png +\Assets\Images\logo.scale-400.png + +\Assets\Images\scale-100\logo.png +\Assets\Images\scale-200\logo.png +\Assets\Images\scale-400\logo.png +``` + +### Table of scales + +| Scale | WinUI | iOS/MacCatalyst | Android | +|-------|:-----------:|:---------------:|:-------:| +| `100` | scale-100 | @1x | mdpi | +| `125` | scale-125 | N/A | N/A | +| `150` | scale-150 | N/A | hdpi | +| `200` | scale-200 | @2x | xhdpi | +| `300` | scale-300 | @3x | xxhdpi | +| `400` | scale-400 | N/A | xxxhdpi | diff --git a/UnoApp6/Business/Models/AppConfig.cs b/UnoApp6/Business/Models/AppConfig.cs new file mode 100644 index 0000000..8d82d82 --- /dev/null +++ b/UnoApp6/Business/Models/AppConfig.cs @@ -0,0 +1,6 @@ +namespace UnoApp6.Business.Models; + +public record AppConfig +{ + public string? Environment { get; init; } +} diff --git a/UnoApp6/Business/Models/Entity.cs b/UnoApp6/Business/Models/Entity.cs new file mode 100644 index 0000000..0e745ab --- /dev/null +++ b/UnoApp6/Business/Models/Entity.cs @@ -0,0 +1,3 @@ +namespace UnoApp6.Business.Models; + +public record Entity(string Name); diff --git a/UnoApp6/Business/Models/Web.cs b/UnoApp6/Business/Models/Web.cs new file mode 100644 index 0000000..892fe35 --- /dev/null +++ b/UnoApp6/Business/Models/Web.cs @@ -0,0 +1,7 @@ + +namespace UnoApp6.Business.Models; +public record Web +{ + public string? LoginStartUri { get; init; } + public string? LogoutStartUri { get; init; } +} diff --git a/UnoApp6/GlobalUsings.cs b/UnoApp6/GlobalUsings.cs new file mode 100644 index 0000000..7c306e8 --- /dev/null +++ b/UnoApp6/GlobalUsings.cs @@ -0,0 +1,19 @@ +global using System.Collections.Immutable; +global using System.Windows.Input; +global using CommunityToolkit.Mvvm.ComponentModel; +global using CommunityToolkit.Mvvm.Input; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Hosting; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using Microsoft.UI.Xaml; +global using Microsoft.UI.Xaml.Controls; +global using Microsoft.UI.Xaml.Media; +global using Microsoft.UI.Xaml.Navigation; +global using Uno.UI; +global using UnoApp6.Business.Models; +global using UnoApp6.Presentation; +global using Windows.ApplicationModel; +global using Windows.Networking.Connectivity; +global using Windows.Storage; +global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState; diff --git a/UnoApp6/Presentation/LoginPage.xaml b/UnoApp6/Presentation/LoginPage.xaml new file mode 100644 index 0000000..84e6a1c --- /dev/null +++ b/UnoApp6/Presentation/LoginPage.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + +