diff --git a/Avalonia.sln b/Avalonia.sln index 36f48053909..5dbd99adafe 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -128,6 +128,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Targets", "Targets", "{4D6F build\BuildTargets.targets = build\BuildTargets.targets build\LegacyProject.targets = build\LegacyProject.targets build\UnitTests.NetCore.targets = build\UnitTests.NetCore.targets + build\DevSingleProject.targets = build\DevSingleProject.targets EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Linux", "Linux", "{86C53C40-57AA-45B8-AD42-FAE0EFDF0F2B}" @@ -214,12 +215,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevGenerators", "src\tools\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox", "samples\MobileSandbox\MobileSandbox.csproj", "{3B8519C1-2F51-4F12-A348-120AB91D4532}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox.Android", "samples\MobileSandbox.Android\MobileSandbox.Android.csproj", "{C90FE60B-B01E-4F35-91D6-379D6966030F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox.iOS", "samples\MobileSandbox.iOS\MobileSandbox.iOS.csproj", "{FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox.Desktop", "samples\MobileSandbox.Desktop\MobileSandbox.Desktop.csproj", "{62D392C9-81CF-487F-92E8-598B2AF3FDCE}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Browser", "src\Browser\Avalonia.Browser\Avalonia.Browser.csproj", "{4A39637C-9338-4925-A4DB-D072E292EC78}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Browser.Blazor", "src\Browser\Avalonia.Browser.Blazor\Avalonia.Browser.Blazor.csproj", "{47F8530C-F19B-4B1A-B4D6-EB231522AE5D}" @@ -280,8 +275,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Headless.NUnit.Uni EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Headless.XUnit.UnitTests", "tests\Avalonia.Headless.XUnit.UnitTests\Avalonia.Headless.XUnit.UnitTests.csproj", "{F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MobileSandbox.Browser", "samples\MobileSandbox.Browser\MobileSandbox.Browser.csproj", "{43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tizen", "Tizen", "{D1300000-7217-4693-8B0F-57CBD5814302}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Tizen", "src\Tizen\Avalonia.Tizen\Avalonia.Tizen.csproj", "{DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8}" @@ -576,19 +569,6 @@ Global {3B8519C1-2F51-4F12-A348-120AB91D4532}.Debug|Any CPU.Build.0 = Debug|Any CPU {3B8519C1-2F51-4F12-A348-120AB91D4532}.Release|Any CPU.ActiveCfg = Release|Any CPU {3B8519C1-2F51-4F12-A348-120AB91D4532}.Release|Any CPU.Build.0 = Release|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C90FE60B-B01E-4F35-91D6-379D6966030F}.Release|Any CPU.Build.0 = Release|Any CPU - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB}.Release|Any CPU.Build.0 = Release|Any CPU - {62D392C9-81CF-487F-92E8-598B2AF3FDCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62D392C9-81CF-487F-92E8-598B2AF3FDCE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62D392C9-81CF-487F-92E8-598B2AF3FDCE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62D392C9-81CF-487F-92E8-598B2AF3FDCE}.Release|Any CPU.Build.0 = Release|Any CPU {4A39637C-9338-4925-A4DB-D072E292EC78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4A39637C-9338-4925-A4DB-D072E292EC78}.Debug|Any CPU.Build.0 = Debug|Any CPU {4A39637C-9338-4925-A4DB-D072E292EC78}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -673,10 +653,6 @@ Global {F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3}.Debug|Any CPU.Build.0 = Debug|Any CPU {F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3}.Release|Any CPU.ActiveCfg = Release|Any CPU {F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3}.Release|Any CPU.Build.0 = Release|Any CPU - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8}.Release|Any CPU.Build.0 = Release|Any CPU {DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8}.Debug|Any CPU.Build.0 = Debug|Any CPU {DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -757,9 +733,6 @@ Global {EABE2161-989B-42BF-BD8D-1E34B20C21F1} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637} {3B8519C1-2F51-4F12-A348-120AB91D4532} = {9B9E3891-2366-4253-A952-D08BCEB71098} - {C90FE60B-B01E-4F35-91D6-379D6966030F} = {9B9E3891-2366-4253-A952-D08BCEB71098} - {FED9A71D-00D7-4F40-A9E4-1229EEA28EEB} = {9B9E3891-2366-4253-A952-D08BCEB71098} - {62D392C9-81CF-487F-92E8-598B2AF3FDCE} = {9B9E3891-2366-4253-A952-D08BCEB71098} {4A39637C-9338-4925-A4DB-D072E292EC78} = {86A3F706-DC3C-43C6-BE1B-B98F5BAAA268} {47F8530C-F19B-4B1A-B4D6-EB231522AE5D} = {86A3F706-DC3C-43C6-BE1B-B98F5BAAA268} {15B93A4C-1B46-43F6-B534-7B25B6E99932} = {9B9E3891-2366-4253-A952-D08BCEB71098} @@ -779,7 +752,6 @@ Global {4B8EBBEB-A1AD-49EC-8B69-B93ED15BFA64} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {2999D79E-3C20-4A90-B651-CA7E0AC92D35} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} {F83FC908-A4E3-40DE-B4CF-A4BA1E92CDB3} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} - {43FCC14E-EEBE-44B3-BCBC-F1C537EECBF8} = {9B9E3891-2366-4253-A952-D08BCEB71098} {DFFBDBF5-5DBE-47ED-9EAE-D40B75AC99E8} = {D1300000-7217-4693-8B0F-57CBD5814302} {A0B29221-2B6F-4B29-A4D5-2227811B5915} = {9B9E3891-2366-4253-A952-D08BCEB71098} {B0FD6A48-FBAB-4676-B36A-DE76B0922B12} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b49266417ff..f6e116a8fa7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,7 +41,7 @@ jobs: displayName: 'Install Workloads' inputs: script: | - dotnet workload install wasm-tools wasm-experimental + dotnet workload install android macos wasm-tools - task: CmdLine@2 displayName: 'Install Tizen Workload' @@ -87,7 +87,7 @@ jobs: displayName: 'Install Workloads' inputs: script: | - dotnet workload install wasm-tools wasm-experimental + dotnet workload install android ios macos wasm-tools - task: CmdLine@2 displayName: 'Install Tizen Workload' @@ -167,7 +167,7 @@ jobs: displayName: 'Install Workloads' inputs: script: | - dotnet workload install android ios tvos wasm-tools wasm-experimental + dotnet workload install android ios tvos wasm-tools - task: PowerShell@2 displayName: 'Install Tizen Workload' diff --git a/build/BuildTargets.targets b/build/BuildTargets.targets index 9b6947d18f4..546f122c15e 100644 --- a/build/BuildTargets.targets +++ b/build/BuildTargets.targets @@ -11,6 +11,7 @@ + diff --git a/build/DevSingleProject.targets b/build/DevSingleProject.targets new file mode 100644 index 00000000000..f6b9b54d025 --- /dev/null +++ b/build/DevSingleProject.targets @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dirs.proj b/dirs.proj index bdcaa046043..0f6594f37fc 100644 --- a/dirs.proj +++ b/dirs.proj @@ -7,24 +7,22 @@ - + + - - - - - + + diff --git a/global.json b/global.json index e5cbcdd045e..8e84e96f229 100644 --- a/global.json +++ b/global.json @@ -4,6 +4,6 @@ "rollForward": "latestFeature" }, "msbuild-sdks": { - "Microsoft.Build.Traversal": "3.2.0" + "Microsoft.Build.Traversal": "4.1.0" } } diff --git a/packages/Avalonia/Avalonia.targets b/packages/Avalonia/Avalonia.targets index eacd287b59a..a0c1c080d8c 100644 --- a/packages/Avalonia/Avalonia.targets +++ b/packages/Avalonia/Avalonia.targets @@ -1,4 +1,5 @@ + diff --git a/packages/Avalonia/AvaloniaSingleProject.targets b/packages/Avalonia/AvaloniaSingleProject.targets new file mode 100644 index 00000000000..0b8774832fc --- /dev/null +++ b/packages/Avalonia/AvaloniaSingleProject.targets @@ -0,0 +1,277 @@ + + + + + false + + true + + + + + <_AvaloniaWindowsTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">true + <_AvaloniaMacOSTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">true + <_AvaloniaAndroidTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">true + <_AvaloniaIOSTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">true + <_AvaloniaTvOSTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tvos'">true + <_AvaloniaBrowserTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'browser'">true + <_AvaloniaTizenTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">true + + <_AvaloniaLinuxTarget Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'linux'" >true + + + + + <_AvaloniaDesktopTarget>true + <_AvaloniaWindowsTarget>true + <_AvaloniaMacOSTarget>true + <_AvaloniaLinuxTarget>true + + + + WinExe + true + true + + + + browser-wasm + + + + Platforms\ + $([MSBuild]::EnsureTrailingSlash('$(PlatformsProjectFolder)')) + + <_KeepLaunchProfiles>true + + false + $(PlatformsProjectFolder)Android\ + $([MSBuild]::EnsureTrailingSlash('$(AndroidProjectFolder)')) + + false + false + $(PlatformsProjectFolder)iOS\ + $(PlatformsProjectFolder)tvOS\ + $([MSBuild]::EnsureTrailingSlash('$(iOSProjectFolder)')) + + false + $(PlatformsProjectFolder)MacCatalyst\ + $([MSBuild]::EnsureTrailingSlash('$(MacCatalystProjectFolder)')) + + false + $(PlatformsProjectFolder)macOS\ + $([MSBuild]::EnsureTrailingSlash('$(macOSProjectFolder)')) + + false + $(PlatformsProjectFolder)Windows\ + $([MSBuild]::EnsureTrailingSlash('$(WindowsProjectFolder)')) + + $(PlatformsProjectFolder)Linux\ + $([MSBuild]::EnsureTrailingSlash('$(LinuxProjectFolder)')) + + $(PlatformsProjectFolder)Browser\ + $([MSBuild]::EnsureTrailingSlash('$(BrowserProjectFolder)')) + + false + $(PlatformsProjectFolder)Tizen\ + $([MSBuild]::EnsureTrailingSlash('$(TizenProjectFolder)')) + + $(PlatformsProjectFolder)Desktop\ + $([MSBuild]::EnsureTrailingSlash('$(DesktopProjectFolder)')) + + + + + + + + + + + + + + + + + $(AndroidProjectFolder)AndroidManifest.xml + $(AndroidProjectFolder)Resources + $(AndroidProjectFolder)Assets + + + + $(iOSProjectFolder)Resources + $(iOSProjectFolder)Entitlements.plist + <_SingleProjectiOSExcludes>$(iOSProjectFolder)/**/.*/** + + + + $(DesktopProjectFolder)app.manifest + $(DesktopProjectFolder)Package.appxmanifest + $(DesktopProjectFolder)Entitlements.plist + + + + $(macOSProjectFolder)Entitlements.plist + + + + $(WindowsProjectFolder)app.manifest + $(WindowsProjectFolder)Package.appxmanifest + + + + $(TizenProjectFolder)tizen-manifest.xml + $(TizenProjectFolder)res + $(TizenProjectFolder)shared + + + + $(BrowserProjectFolder)/wwwroot/main.js + $(BrowserProjectFolder)wwwroot/index.html + + + + + + true + + + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_AndroidManifestAbsTemp Condition=" '$(AndroidManifest)' != '' ">$(ProjectDir)$(AndroidManifest) + + + + + + diff --git a/samples/MobileSandbox.Android/MainActivity.cs b/samples/MobileSandbox.Android/MainActivity.cs deleted file mode 100644 index 702e9be9e6f..00000000000 --- a/samples/MobileSandbox.Android/MainActivity.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using Android.App; -using Android.Content.PM; -using Android.OS; -using Avalonia; -using Avalonia.Android; - -namespace MobileSandbox.Android -{ - [Activity(Label = "MobileSandbox.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)] - public class MainActivity : AvaloniaMainActivity - { - } -} diff --git a/samples/MobileSandbox.Android/MobileSandbox.Android.csproj b/samples/MobileSandbox.Android/MobileSandbox.Android.csproj deleted file mode 100644 index 75e1b90f61f..00000000000 --- a/samples/MobileSandbox.Android/MobileSandbox.Android.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - $(AvsCurrentAndroidTargetFramework) - 21 - Exe - enable - com.Avalonia.MobileSandbox - 1 - 1.0 - apk - - - - Resources\drawable\Icon.png - - - - - True - True - - - - - - - - - - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/AboutResources.txt b/samples/MobileSandbox.Android/Resources/AboutResources.txt deleted file mode 100644 index c2bca974c48..00000000000 --- a/samples/MobileSandbox.Android/Resources/AboutResources.txt +++ /dev/null @@ -1,44 +0,0 @@ -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. \ No newline at end of file diff --git a/samples/MobileSandbox.Android/Resources/drawable-night-v31/avalonia_anim.xml b/samples/MobileSandbox.Android/Resources/drawable-night-v31/avalonia_anim.xml deleted file mode 100644 index dde4b5a7dde..00000000000 --- a/samples/MobileSandbox.Android/Resources/drawable-night-v31/avalonia_anim.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/drawable-v31/avalonia_anim.xml b/samples/MobileSandbox.Android/Resources/drawable-v31/avalonia_anim.xml deleted file mode 100644 index 94f27d9e635..00000000000 --- a/samples/MobileSandbox.Android/Resources/drawable-v31/avalonia_anim.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/drawable/splash_screen.xml b/samples/MobileSandbox.Android/Resources/drawable/splash_screen.xml deleted file mode 100644 index 2e920b4b3be..00000000000 --- a/samples/MobileSandbox.Android/Resources/drawable/splash_screen.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/values-night/colors.xml b/samples/MobileSandbox.Android/Resources/values-night/colors.xml deleted file mode 100644 index 3d47b6fc581..00000000000 --- a/samples/MobileSandbox.Android/Resources/values-night/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #212121 - diff --git a/samples/MobileSandbox.Android/Resources/values-v31/styles.xml b/samples/MobileSandbox.Android/Resources/values-v31/styles.xml deleted file mode 100644 index 7518f078e56..00000000000 --- a/samples/MobileSandbox.Android/Resources/values-v31/styles.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - diff --git a/samples/MobileSandbox.Android/Resources/values/colors.xml b/samples/MobileSandbox.Android/Resources/values/colors.xml deleted file mode 100644 index 59279d5d32e..00000000000 --- a/samples/MobileSandbox.Android/Resources/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - diff --git a/samples/MobileSandbox.Android/Resources/values/styles.xml b/samples/MobileSandbox.Android/Resources/values/styles.xml deleted file mode 100644 index 22085806da3..00000000000 --- a/samples/MobileSandbox.Android/Resources/values/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/samples/MobileSandbox.Android/environment.device.txt b/samples/MobileSandbox.Android/environment.device.txt deleted file mode 100644 index 107d68ca1b9..00000000000 --- a/samples/MobileSandbox.Android/environment.device.txt +++ /dev/null @@ -1 +0,0 @@ -DOTNET_DiagnosticPorts=127.0.0.1:9000,suspend diff --git a/samples/MobileSandbox.Android/environment.emulator.txt b/samples/MobileSandbox.Android/environment.emulator.txt deleted file mode 100644 index 299a0ec30bb..00000000000 --- a/samples/MobileSandbox.Android/environment.emulator.txt +++ /dev/null @@ -1 +0,0 @@ -DOTNET_DiagnosticPorts=10.0.2.2:9001,suspend diff --git a/samples/MobileSandbox.Browser/MobileSandbox.Browser.csproj b/samples/MobileSandbox.Browser/MobileSandbox.Browser.csproj deleted file mode 100644 index f1410c6752b..00000000000 --- a/samples/MobileSandbox.Browser/MobileSandbox.Browser.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - $(AvsCurrentBrowserTargetFramework) - browser-wasm - main.js - Exe - true - true - ./ - - - - - - - - - - - - - - - - - - diff --git a/samples/MobileSandbox.Browser/Properties/launchSettings.json b/samples/MobileSandbox.Browser/Properties/launchSettings.json deleted file mode 100644 index 66234a3211f..00000000000 --- a/samples/MobileSandbox.Browser/Properties/launchSettings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "profiles": { - "MobileSandbox.Browser": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:65312;http://localhost:65313;" - } - } -} diff --git a/samples/MobileSandbox.Browser/index.html b/samples/MobileSandbox.Browser/index.html deleted file mode 100644 index 32ab8628fb4..00000000000 --- a/samples/MobileSandbox.Browser/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - Mobile Sandbox - - - - - - - - - -
-
-
-

Powered by

- - Avalonia Logo - Avalonia - -
-
-
- - - - diff --git a/samples/MobileSandbox.Desktop/MobileSandbox.Desktop.csproj b/samples/MobileSandbox.Desktop/MobileSandbox.Desktop.csproj deleted file mode 100644 index d523fd03b21..00000000000 --- a/samples/MobileSandbox.Desktop/MobileSandbox.Desktop.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - WinExe - $(AvsCurrentTargetFramework) - true - - - - - - - - - - - - - en - app.manifest - - - - - diff --git a/samples/MobileSandbox.iOS/MobileSandbox.iOS.csproj b/samples/MobileSandbox.iOS/MobileSandbox.iOS.csproj deleted file mode 100644 index 719032c048a..00000000000 --- a/samples/MobileSandbox.iOS/MobileSandbox.iOS.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - Exe - manual - $(AvsCurrentIOSTargetFramework) - 13.0 - - - - - - diff --git a/samples/MobileSandbox/App.xaml b/samples/MobileSandbox/App.axaml similarity index 73% rename from samples/MobileSandbox/App.xaml rename to samples/MobileSandbox/App.axaml index 6fb6ae297ea..25fefee516e 100644 --- a/samples/MobileSandbox/App.xaml +++ b/samples/MobileSandbox/App.axaml @@ -1,8 +1,7 @@ + x:Class="MobileSandbox.App"> diff --git a/samples/MobileSandbox/App.axaml.cs b/samples/MobileSandbox/App.axaml.cs new file mode 100644 index 00000000000..88da7b80c11 --- /dev/null +++ b/samples/MobileSandbox/App.axaml.cs @@ -0,0 +1,27 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +namespace MobileSandbox; + +public class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime) + { + desktopLifetime.MainWindow = new MainWindow(); + } + else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewLifetime) + { + singleViewLifetime.MainView = new MainView(); + } + + base.OnFrameworkInitializationCompleted(); + } +} diff --git a/samples/MobileSandbox/App.xaml.cs b/samples/MobileSandbox/App.xaml.cs deleted file mode 100644 index d32d9bb5a7f..00000000000 --- a/samples/MobileSandbox/App.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; - -namespace MobileSandbox -{ - public class App : Application - { - public override void Initialize() - { - AvaloniaXamlLoader.Load(this); - } - - public override void OnFrameworkInitializationCompleted() - { - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime) - { - desktopLifetime.MainWindow = new MainWindow(); - } - else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewLifetime) - { - singleViewLifetime.MainView = new MainView(); - } - - base.OnFrameworkInitializationCompleted(); - } - } -} diff --git a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Bold.ttf b/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Bold.ttf deleted file mode 100644 index f6986468bd9..00000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Bold.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-BoldItalic.ttf b/samples/MobileSandbox/Assets/Fonts/SourceSansPro-BoldItalic.ttf deleted file mode 100644 index 5c00b64faf1..00000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-BoldItalic.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Italic.ttf b/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Italic.ttf deleted file mode 100644 index 82e8762011e..00000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Italic.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Regular.ttf b/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Regular.ttf deleted file mode 100644 index 278ad8aa0a0..00000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/SourceSansPro-Regular.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/Fonts/WenQuanYiMicroHei-01.ttf b/samples/MobileSandbox/Assets/Fonts/WenQuanYiMicroHei-01.ttf deleted file mode 100644 index 61e2583a6c2..00000000000 Binary files a/samples/MobileSandbox/Assets/Fonts/WenQuanYiMicroHei-01.ttf and /dev/null differ diff --git a/samples/MobileSandbox/Assets/avalonia-32.png b/samples/MobileSandbox/Assets/avalonia-32.png deleted file mode 100644 index 7b443e7a250..00000000000 Binary files a/samples/MobileSandbox/Assets/avalonia-32.png and /dev/null differ diff --git a/samples/MobileSandbox/Assets/test_icon.ico b/samples/MobileSandbox/Assets/test_icon.ico deleted file mode 100644 index da8d49ff9b9..00000000000 Binary files a/samples/MobileSandbox/Assets/test_icon.ico and /dev/null differ diff --git a/samples/MobileSandbox/MainView.xaml b/samples/MobileSandbox/MainView.axaml similarity index 100% rename from samples/MobileSandbox/MainView.xaml rename to samples/MobileSandbox/MainView.axaml diff --git a/samples/MobileSandbox/MainView.axaml.cs b/samples/MobileSandbox/MainView.axaml.cs new file mode 100644 index 00000000000..2ea1e8f1a9c --- /dev/null +++ b/samples/MobileSandbox/MainView.axaml.cs @@ -0,0 +1,19 @@ +using System; +using System.Windows.Input; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace MobileSandbox; + +public partial class MainView : UserControl +{ + public MainView() + { + InitializeComponent(); + } + + public void ButtonCommand() + { + Console.WriteLine("Button pressed"); + } +} diff --git a/samples/MobileSandbox/MainView.xaml.cs b/samples/MobileSandbox/MainView.xaml.cs deleted file mode 100644 index 4b2b546b1c5..00000000000 --- a/samples/MobileSandbox/MainView.xaml.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Windows.Input; -using Avalonia.Controls; -using Avalonia.Markup.Xaml; - -namespace MobileSandbox -{ - public class MainView : UserControl - { - public MainView() - { - AvaloniaXamlLoader.Load(this); - - DataContext = this; - } - - public void ButtonCommand() - { - Console.WriteLine("Button pressed"); - } - } -} diff --git a/samples/MobileSandbox/MainWindow.xaml b/samples/MobileSandbox/MainWindow.axaml similarity index 93% rename from samples/MobileSandbox/MainWindow.xaml rename to samples/MobileSandbox/MainWindow.axaml index 97ef98f0288..4e349bea2d8 100644 --- a/samples/MobileSandbox/MainWindow.xaml +++ b/samples/MobileSandbox/MainWindow.axaml @@ -1,7 +1,6 @@  - netstandard2.0;$(AvsCurrentTargetFramework) + net8.0;net8.0-android;net8.0-browser;net8.0-tizen + $(TargetFrameworks);net8.0-ios + Exe true - enable + enable + true + + + + true + Mobile Sandbox + Avalonia.MobileSandbox - - - %(Filename) - - - Designer - - - - - - - - - - @@ -32,4 +25,5 @@ + diff --git a/samples/MobileSandbox.Android/Properties/AndroidManifest.xml b/samples/MobileSandbox/Platforms/Android/AndroidManifest.xml similarity index 70% rename from samples/MobileSandbox.Android/Properties/AndroidManifest.xml rename to samples/MobileSandbox/Platforms/Android/AndroidManifest.xml index 346db0ef588..1c02fda6c6d 100644 --- a/samples/MobileSandbox.Android/Properties/AndroidManifest.xml +++ b/samples/MobileSandbox/Platforms/Android/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/samples/MobileSandbox/Platforms/Android/MainActivity.cs b/samples/MobileSandbox/Platforms/Android/MainActivity.cs new file mode 100644 index 00000000000..8aa6193ab0a --- /dev/null +++ b/samples/MobileSandbox/Platforms/Android/MainActivity.cs @@ -0,0 +1,13 @@ +using System; +using Android.App; +using Android.Content.PM; +using Android.OS; +using Avalonia; +using Avalonia.Android; + +namespace MobileSandbox; + +[Activity(Label = "MobileSandbox.Android", Theme = "@style/Theme.AppCompat.NoActionBar", MainLauncher = true, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)] +public class MainActivity : AvaloniaMainActivity +{ +} diff --git a/samples/MobileSandbox.Browser/Program.cs b/samples/MobileSandbox/Platforms/Browser/Program.cs similarity index 100% rename from samples/MobileSandbox.Browser/Program.cs rename to samples/MobileSandbox/Platforms/Browser/Program.cs diff --git a/samples/MobileSandbox.Browser/Logo.svg b/samples/MobileSandbox/Platforms/Browser/wwwroot/Logo.svg similarity index 100% rename from samples/MobileSandbox.Browser/Logo.svg rename to samples/MobileSandbox/Platforms/Browser/wwwroot/Logo.svg diff --git a/samples/MobileSandbox.Browser/app.css b/samples/MobileSandbox/Platforms/Browser/wwwroot/app.css similarity index 50% rename from samples/MobileSandbox.Browser/app.css rename to samples/MobileSandbox/Platforms/Browser/wwwroot/app.css index 0e6ab12461c..a424538ba26 100644 --- a/samples/MobileSandbox.Browser/app.css +++ b/samples/MobileSandbox/Platforms/Browser/wwwroot/app.css @@ -5,9 +5,43 @@ --sal: env(safe-area-inset-left); } -#out { +/* HTML styles for the splash screen */ + +.highlight { + color: white; + font-size: 2.5rem; + display: block; +} + +.purple { + color: #8b44ac; +} + +.icon { + opacity: 0.05; + height: 35%; + width: 35%; + position: absolute; + background-repeat: no-repeat; + right: 0px; + bottom: 0px; + margin-right: 3%; + margin-bottom: 5%; + z-index: 5000; + background-position: right bottom; + pointer-events: none; +} + +#avalonia-splash a { + color: whitesmoke; + text-decoration: none; +} + +.center { + display: flex; + justify-content: center; + align-items: center; height: 100vh; - width: 100vw } #avalonia-splash { @@ -15,42 +49,26 @@ height: 100%; width: 100%; color: whitesmoke; - background: #171C2C; + background: #1b2a4e; font-family: 'Nunito', sans-serif; background-position: center; background-size: cover; background-repeat: no-repeat; -} - -#avalonia-splash a{ - color: whitesmoke; - text-decoration: none; -} - -.center { - display: flex; justify-content: center; - height: 250px; + align-items: center; } .splash-close { - animation: slide 0.5s linear 1s forwards; + animation: fadeout 0.25s linear forwards; } -@keyframes slide { +@keyframes fadeout { 0% { - top: 0%; - } - - 50% { - opacity: 80%; + opacity: 100%; } 100% { - top: 100%; - overflow: hidden; opacity: 0; - display: none; visibility: collapse; } } diff --git a/samples/MobileSandbox.Browser/favicon.ico b/samples/MobileSandbox/Platforms/Browser/wwwroot/favicon.ico similarity index 100% rename from samples/MobileSandbox.Browser/favicon.ico rename to samples/MobileSandbox/Platforms/Browser/wwwroot/favicon.ico diff --git a/samples/MobileSandbox/Platforms/Browser/wwwroot/index.html b/samples/MobileSandbox/Platforms/Browser/wwwroot/index.html new file mode 100644 index 00000000000..c92fe6354dd --- /dev/null +++ b/samples/MobileSandbox/Platforms/Browser/wwwroot/index.html @@ -0,0 +1,30 @@ + + + + + MobileSandbox.Browser + + + + + + + + + + +
+
+
+

+ Powered by + Avalonia UI +

+
+ Avalonia Logo +
+
+ + + + diff --git a/samples/MobileSandbox.Browser/main.js b/samples/MobileSandbox/Platforms/Browser/wwwroot/main.js similarity index 52% rename from samples/MobileSandbox.Browser/main.js rename to samples/MobileSandbox/Platforms/Browser/wwwroot/main.js index 9d90db8bd22..a9de29f060a 100644 --- a/samples/MobileSandbox.Browser/main.js +++ b/samples/MobileSandbox/Platforms/Browser/wwwroot/main.js @@ -1,7 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import { dotnet } from './dotnet.js' +import { dotnet } from './_framework/dotnet.js' const is_browser = typeof window != "undefined"; if (!is_browser) throw new Error(`Expected to be running in a browser`); @@ -13,4 +10,4 @@ const dotnetRuntime = await dotnet const config = dotnetRuntime.getConfig(); -await dotnetRuntime.runMainAndExit(config.mainAssemblyName, ["dotnet", "is", "great!"]); +await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]); diff --git a/samples/MobileSandbox.Desktop/Program.cs b/samples/MobileSandbox/Platforms/Desktop/Program.cs similarity index 100% rename from samples/MobileSandbox.Desktop/Program.cs rename to samples/MobileSandbox/Platforms/Desktop/Program.cs diff --git a/samples/MobileSandbox.Desktop/app.manifest b/samples/MobileSandbox/Platforms/Desktop/app.manifest similarity index 100% rename from samples/MobileSandbox.Desktop/app.manifest rename to samples/MobileSandbox/Platforms/Desktop/app.manifest diff --git a/samples/MobileSandbox/Platforms/Tizen/Main.cs b/samples/MobileSandbox/Platforms/Tizen/Main.cs new file mode 100644 index 00000000000..75c7c8941d2 --- /dev/null +++ b/samples/MobileSandbox/Platforms/Tizen/Main.cs @@ -0,0 +1,20 @@ +using System; +using Avalonia; +using Avalonia.Tizen; +using ElmSharp; +using SkiaSharp; +using Tizen.Applications; + +namespace MobileSandbox; + +class Program : NuiTizenApplication +{ + protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) => + base.CustomizeAppBuilder(builder); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } +} diff --git a/samples/MobileSandbox/Platforms/Tizen/shared/res/Avalonia.png b/samples/MobileSandbox/Platforms/Tizen/shared/res/Avalonia.png new file mode 100644 index 00000000000..ea0bb4986fc Binary files /dev/null and b/samples/MobileSandbox/Platforms/Tizen/shared/res/Avalonia.png differ diff --git a/samples/MobileSandbox/Platforms/Tizen/tizen-manifest.xml b/samples/MobileSandbox/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 00000000000..14aefec5e33 --- /dev/null +++ b/samples/MobileSandbox/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,23 @@ + + + + + + Avalonia.png + + + + + + http://tizen.org/privilege/appdir.shareddata + http://tizen.org/privilege/appmanager.launch + http://tizen.org/privilege/externalstorage + http://tizen.org/privilege/externalstorage.appdata + http://tizen.org/privilege/internet + http://tizen.org/privilege/network.get + + + + http://tizen.org/feature/opengles.surfaceless_context + http://tizen.org/feature/opengles.version.2_0 + diff --git a/samples/MobileSandbox.iOS/AppDelegate.cs b/samples/MobileSandbox/Platforms/iOS/AppDelegate.cs similarity index 68% rename from samples/MobileSandbox.iOS/AppDelegate.cs rename to samples/MobileSandbox/Platforms/iOS/AppDelegate.cs index 60214cc5417..739d25e5f1c 100644 --- a/samples/MobileSandbox.iOS/AppDelegate.cs +++ b/samples/MobileSandbox/Platforms/iOS/AppDelegate.cs @@ -3,8 +3,6 @@ using Avalonia; using Avalonia.Controls; using Avalonia.iOS; -using Avalonia.Logging; -using Avalonia.Media; namespace MobileSandbox { @@ -14,9 +12,5 @@ namespace MobileSandbox [Register("AppDelegate")] public partial class AppDelegate : AvaloniaAppDelegate { - protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) - { - return builder.LogToTrace(LogEventLevel.Debug, "IOSIME"); - } } } diff --git a/samples/MobileSandbox.iOS/Entitlements.plist b/samples/MobileSandbox/Platforms/iOS/Entitlements.plist similarity index 100% rename from samples/MobileSandbox.iOS/Entitlements.plist rename to samples/MobileSandbox/Platforms/iOS/Entitlements.plist diff --git a/samples/MobileSandbox.iOS/Info.plist b/samples/MobileSandbox/Platforms/iOS/Info.plist similarity index 100% rename from samples/MobileSandbox.iOS/Info.plist rename to samples/MobileSandbox/Platforms/iOS/Info.plist diff --git a/samples/MobileSandbox.iOS/Main.cs b/samples/MobileSandbox/Platforms/iOS/Main.cs similarity index 100% rename from samples/MobileSandbox.iOS/Main.cs rename to samples/MobileSandbox/Platforms/iOS/Main.cs diff --git a/samples/MobileSandbox.iOS/Resources/LaunchScreen.xib b/samples/MobileSandbox/Platforms/iOS/Resources/LaunchScreen.xib similarity index 100% rename from samples/MobileSandbox.iOS/Resources/LaunchScreen.xib rename to samples/MobileSandbox/Platforms/iOS/Resources/LaunchScreen.xib diff --git a/samples/MobileSandbox/Views/CustomNotificationView.xaml b/samples/MobileSandbox/Views/CustomNotificationView.xaml deleted file mode 100644 index f07116583c8..00000000000 --- a/samples/MobileSandbox/Views/CustomNotificationView.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - -