diff --git a/readme.md b/readme.md index 154cd716..54f11c29 100644 --- a/readme.md +++ b/readme.md @@ -58,7 +58,7 @@ Available parameters: *Description*: The target version of Avalonia NuGet packages. -*Options*: **0.10.21**, **11.0.0-rc1.1** +*Options*: **0.10.21**, **11.0.0-rc2.2** *By default*: 0.10.21 @@ -99,7 +99,7 @@ Available parameters: *Description*: The target version of Avalonia NuGet packages. -*Options*: **0.10.21**, **11.0.0-rc1.1** +*Options*: **0.10.21**, **11.0.0-rc2.2** *By default*: 0.10.21 diff --git a/templates/csharp/app-mvvm/.template.config/template.json b/templates/csharp/app-mvvm/.template.config/template.json index dbaf3268..7b9336f0 100644 --- a/templates/csharp/app-mvvm/.template.config/template.json +++ b/templates/csharp/app-mvvm/.template.config/template.json @@ -72,8 +72,8 @@ "description": "Target 0.10.21 (Latest stable)." }, { - "choice": "11.0.0-rc1.1", - "description": "Target 11.0.0-rc1.1" + "choice": "11.0.0-rc2.2", + "description": "Target 11.0.0-rc2.2" } ], "replaces": "AvaloniaVersionTemplateParameter", diff --git a/templates/csharp/app/.template.config/template.json b/templates/csharp/app/.template.config/template.json index ddb9f6e8..f62ca592 100644 --- a/templates/csharp/app/.template.config/template.json +++ b/templates/csharp/app/.template.config/template.json @@ -48,8 +48,8 @@ "description": "Target 0.10.21 (Latest stable)." }, { - "choice": "11.0.0-rc1.1", - "description": "Target 11.0.0-rc1.1" + "choice": "11.0.0-rc2.2", + "description": "Target 11.0.0-rc2.2" } ], "replaces": "AvaloniaVersionTemplateParameter", diff --git a/templates/csharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.csproj b/templates/csharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.csproj index f66c40d8..39a12248 100644 --- a/templates/csharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.csproj +++ b/templates/csharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.csproj @@ -19,6 +19,7 @@ + diff --git a/templates/csharp/xplat/AvaloniaTest.Android/MainActivity.cs b/templates/csharp/xplat/AvaloniaTest.Android/MainActivity.cs index 94ea910d..9ac57834 100644 --- a/templates/csharp/xplat/AvaloniaTest.Android/MainActivity.cs +++ b/templates/csharp/xplat/AvaloniaTest.Android/MainActivity.cs @@ -1,10 +1,23 @@ using Android.App; using Android.Content.PM; +using Avalonia; using Avalonia.Android; +using Avalonia.ReactiveUI; namespace AvaloniaTest.Android; -[Activity(Label = "AvaloniaTest.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] -public class MainActivity : AvaloniaMainActivity +[Activity( + Label = "AvaloniaTest.Android", + Theme = "@style/MyTheme.NoActionBar", + Icon = "@drawable/icon", + MainLauncher = true, + ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] +public class MainActivity : AvaloniaMainActivity { + protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) + { + return base.CustomizeAppBuilder(builder) + .WithInterFont() + .UseReactiveUI(); + } } diff --git a/templates/csharp/xplat/AvaloniaTest.Android/Resources/AboutResources.txt b/templates/csharp/xplat/AvaloniaTest.Android/Resources/AboutResources.txt new file mode 100644 index 00000000..c2bca974 --- /dev/null +++ b/templates/csharp/xplat/AvaloniaTest.Android/Resources/AboutResources.txt @@ -0,0 +1,44 @@ +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/templates/csharp/xplat/AvaloniaTest.Android/Resources/drawable-night-v31/avalonia_anim.xml b/templates/csharp/xplat/AvaloniaTest.Android/Resources/drawable-night-v31/avalonia_anim.xml new file mode 100644 index 00000000..dde4b5a7 --- /dev/null +++ b/templates/csharp/xplat/AvaloniaTest.Android/Resources/drawable-night-v31/avalonia_anim.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/csharp/xplat/AvaloniaTest.Android/Resources/drawable-v31/avalonia_anim.xml b/templates/csharp/xplat/AvaloniaTest.Android/Resources/drawable-v31/avalonia_anim.xml new file mode 100644 index 00000000..94f27d9e --- /dev/null +++ b/templates/csharp/xplat/AvaloniaTest.Android/Resources/drawable-v31/avalonia_anim.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/csharp/xplat/AvaloniaTest.Android/Resources/values-v31/styles.xml b/templates/csharp/xplat/AvaloniaTest.Android/Resources/values-v31/styles.xml new file mode 100644 index 00000000..d5ecec43 --- /dev/null +++ b/templates/csharp/xplat/AvaloniaTest.Android/Resources/values-v31/styles.xml @@ -0,0 +1,21 @@ + + + + + + + + diff --git a/templates/csharp/xplat/AvaloniaTest.Android/Resources/values/styles.xml b/templates/csharp/xplat/AvaloniaTest.Android/Resources/values/styles.xml index 2759d290..6e534de2 100644 --- a/templates/csharp/xplat/AvaloniaTest.Android/Resources/values/styles.xml +++ b/templates/csharp/xplat/AvaloniaTest.Android/Resources/values/styles.xml @@ -4,14 +4,9 @@ - - - - diff --git a/templates/csharp/xplat/AvaloniaTest.Android/SplashActivity.cs b/templates/csharp/xplat/AvaloniaTest.Android/SplashActivity.cs deleted file mode 100644 index 020aee30..00000000 --- a/templates/csharp/xplat/AvaloniaTest.Android/SplashActivity.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Android.App; -using Android.Content; -using Android.OS; -using Application = Android.App.Application; -using Avalonia; -using Avalonia.Android; -using Avalonia.ReactiveUI; - -namespace AvaloniaTest.Android; - -[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] -public class SplashActivity : AvaloniaSplashActivity -{ - protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) - { - return base.CustomizeAppBuilder(builder) - .WithInterFont() - .UseReactiveUI(); - } - - protected override void OnCreate(Bundle? savedInstanceState) - { - base.OnCreate(savedInstanceState); - } - - protected override void OnResume() - { - base.OnResume(); - - StartActivity(new Intent(Application.Context, typeof(MainActivity))); - } -} diff --git a/templates/csharp/xplat/Directory.Build.props b/templates/csharp/xplat/Directory.Build.props index 5a014d1f..d55cf210 100644 --- a/templates/csharp/xplat/Directory.Build.props +++ b/templates/csharp/xplat/Directory.Build.props @@ -1,6 +1,6 @@ enable - 11.0.0-rc1.1 + 11.0.0-rc2.2 diff --git a/templates/fsharp/app-mvvm/.template.config/template.json b/templates/fsharp/app-mvvm/.template.config/template.json index fb9f5d23..09ad24c7 100644 --- a/templates/fsharp/app-mvvm/.template.config/template.json +++ b/templates/fsharp/app-mvvm/.template.config/template.json @@ -72,8 +72,8 @@ "description": "Target 0.10.21 (Latest stable)." }, { - "choice": "11.0.0-rc1.1", - "description": "Target 11.0.0-rc1.1" + "choice": "11.0.0-rc2.2", + "description": "Target 11.0.0-rc2.2" } ], "replaces": "AvaloniaVersionTemplateParameter", diff --git a/templates/fsharp/app/.template.config/template.json b/templates/fsharp/app/.template.config/template.json index d39530ee..6d122ea1 100644 --- a/templates/fsharp/app/.template.config/template.json +++ b/templates/fsharp/app/.template.config/template.json @@ -48,8 +48,8 @@ "description": "Target 0.10.21 (Latest stable)." }, { - "choice": "11.0.0-rc1.1", - "description": "Target 11.0.0-rc1.1" + "choice": "11.0.0-rc2.2", + "description": "Target 11.0.0-rc2.2" } ], "replaces": "AvaloniaVersionTemplateParameter", diff --git a/templates/fsharp/xplat/AvaloniaTest.Android/Activities.fs b/templates/fsharp/xplat/AvaloniaTest.Android/Activities.fs index 0d8fb441..b194fca1 100644 --- a/templates/fsharp/xplat/AvaloniaTest.Android/Activities.fs +++ b/templates/fsharp/xplat/AvaloniaTest.Android/Activities.fs @@ -1,12 +1,9 @@ namespace AvaloniaTest.Android + open Android.App -open Android.Content open Android.Content.PM open Avalonia open Avalonia.ReactiveUI -open Android.OS -type Application = Android.App.Application - open Avalonia.Android open AvaloniaTest @@ -14,21 +11,12 @@ open AvaloniaTest Label = "AvaloniaTest.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", - LaunchMode = LaunchMode.SingleTop, - ConfigurationChanges = (ConfigChanges.Orientation ||| ConfigChanges.ScreenSize))>] + MainLauncher = true, + ConfigurationChanges = (ConfigChanges.Orientation ||| ConfigChanges.ScreenSize ||| ConfigChanges.UiMode))>] type MainActivity() = - inherit AvaloniaMainActivity() - - -[] -type SplashActivity() = - inherit AvaloniaSplashActivity() + inherit AvaloniaMainActivity() override _.CustomizeAppBuilder(builder) = base.CustomizeAppBuilder(builder) .WithInterFont() .UseReactiveUI() - - override x.OnResume() = - base.OnResume() - x.StartActivity(new Intent(Application.Context, typeof)) diff --git a/templates/fsharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.fsproj b/templates/fsharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.fsproj index cd7edd2f..a7ba2d2f 100644 --- a/templates/fsharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.fsproj +++ b/templates/fsharp/xplat/AvaloniaTest.Android/AvaloniaTest.Android.fsproj @@ -22,6 +22,7 @@ + diff --git a/templates/fsharp/xplat/AvaloniaTest.Android/Resources/AboutResources.txt b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/AboutResources.txt new file mode 100644 index 00000000..c2bca974 --- /dev/null +++ b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/AboutResources.txt @@ -0,0 +1,44 @@ +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/templates/fsharp/xplat/AvaloniaTest.Android/Resources/drawable-night-v31/avalonia_anim.xml b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/drawable-night-v31/avalonia_anim.xml new file mode 100644 index 00000000..dde4b5a7 --- /dev/null +++ b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/drawable-night-v31/avalonia_anim.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/fsharp/xplat/AvaloniaTest.Android/Resources/drawable-v31/avalonia_anim.xml b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/drawable-v31/avalonia_anim.xml new file mode 100644 index 00000000..94f27d9e --- /dev/null +++ b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/drawable-v31/avalonia_anim.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values-night/colors.xml b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values-night/colors.xml new file mode 100644 index 00000000..3d47b6fc --- /dev/null +++ b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values-night/colors.xml @@ -0,0 +1,4 @@ + + + #212121 + diff --git a/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values-v31/styles.xml b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values-v31/styles.xml new file mode 100644 index 00000000..d5ecec43 --- /dev/null +++ b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values-v31/styles.xml @@ -0,0 +1,21 @@ + + + + + + + + diff --git a/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values/styles.xml b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values/styles.xml index 2759d290..6e534de2 100644 --- a/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values/styles.xml +++ b/templates/fsharp/xplat/AvaloniaTest.Android/Resources/values/styles.xml @@ -4,14 +4,9 @@ - - - - diff --git a/templates/fsharp/xplat/Directory.Build.props b/templates/fsharp/xplat/Directory.Build.props index a836828d..e601141c 100644 --- a/templates/fsharp/xplat/Directory.Build.props +++ b/templates/fsharp/xplat/Directory.Build.props @@ -1,5 +1,5 @@ - 11.0.0-rc1.1 + 11.0.0-rc2.2 diff --git a/tests/build-test.ps1 b/tests/build-test.ps1 index f6ed70a3..623afe01 100644 --- a/tests/build-test.ps1 +++ b/tests/build-test.ps1 @@ -97,7 +97,7 @@ $binlog = [IO.Path]::GetFullPath([IO.Path]::Combine($pwd, "..", "binlog", "test. Create-And-Build "avalonia.app" "AvaloniaApp" "C#" "f" "net6.0" $binlog Create-And-Build "avalonia.app" "AvaloniaApp" "C#" "f" "net7.0" $binlog Create-And-Build "avalonia.app" "AvaloniaApp" "C#" "av" "0.10.21" $binlog -Create-And-Build "avalonia.app" "AvaloniaApp" "C#" "av" "11.0.0-rc1.1" $binlog +Create-And-Build "avalonia.app" "AvaloniaApp" "C#" "av" "11.0.0-rc2.2" $binlog Create-And-Build "avalonia.app" "AvaloniaApp" "C#" "cb" "true" $binlog Create-And-Build "avalonia.app" "AvaloniaApp" "C#" "cb" "false" $binlog @@ -105,7 +105,7 @@ Create-And-Build "avalonia.app" "AvaloniaApp" "C#" "cb" "false" $binlog Test-Template "avalonia.mvvm" "AvaloniaMvvm" "C#" "f" "net6.0" $binlog Test-Template "avalonia.mvvm" "AvaloniaMvvm" "C#" "f" "net7.0" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "C#" "av" "0.10.21" $binlog -Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "C#" "av" "11.0.0-rc1.1" $binlog +Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "C#" "av" "11.0.0-rc2.2" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "C#" "m" "ReactiveUI" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "C#" "m" "CommunityToolkit" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "C#" "cb" "true" $binlog @@ -122,14 +122,14 @@ Create-And-Build "avalonia.xplat" "AvaloniaXplat" "C#" "rvl" "false" $binlog Create-And-Build "avalonia.app" "AvaloniaApp" "F#" "f" "net6.0" $binlog Create-And-Build "avalonia.app" "AvaloniaApp" "F#" "f" "net7.0" $binlog Create-And-Build "avalonia.app" "AvaloniaApp" "F#" "av" "0.10.21" $binlog -Create-And-Build "avalonia.app" "AvaloniaApp" "F#" "av" "11.0.0-rc1.1" $binlog +Create-And-Build "avalonia.app" "AvaloniaApp" "F#" "av" "11.0.0-rc2.2" $binlog Create-And-Build "avalonia.app" "AvaloniaApp" "F#" "cb" "true" $binlog Create-And-Build "avalonia.app" "AvaloniaApp" "F#" "cb" "false" $binlog Test-Template "avalonia.mvvm" "AvaloniaMvvm" "F#" "f" "net6.0" $binlog Test-Template "avalonia.mvvm" "AvaloniaMvvm" "F#" "f" "net7.0" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "F#" "av" "0.10.21" $binlog -Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "F#" "av" "11.0.0-rc1.1" $binlog +Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "F#" "av" "11.0.0-rc2.2" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "F#" "m" "ReactiveUI" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "F#" "m" "CommunityToolkit" $binlog Create-And-Build "avalonia.mvvm" "AvaloniaMvvm" "F#" "cb" "true" $binlog