Browse Source
Merge pull request #8272 from AvaloniaUI/fix-android-initialization-order
Fix android initialization order
upgrade-angle
Dan Walmsley
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
9 additions and
7 deletions
-
samples/ControlCatalog.Android/ControlCatalog.Android.csproj
-
src/Android/Avalonia.Android/AndroidPlatform.cs
-
src/Android/Avalonia.Android/AvaloniaActivity.cs
|
|
|
@ -20,10 +20,13 @@ |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(TF_BUILD)' == ''"> |
|
|
|
<DebugSymbols>True</DebugSymbols> |
|
|
|
<DebugSymbols>False</DebugSymbols> |
|
|
|
<UseInterpreter>False</UseInterpreter> |
|
|
|
<RunAOTCompilation>True</RunAOTCompilation> |
|
|
|
<EnableLLVM>True</EnableLLVM> |
|
|
|
<AndroidEnableProfiledAot>True</AndroidEnableProfiledAot> |
|
|
|
<AndroidAotAdditionalArguments>no-write-symbols,nodebug</AndroidAotAdditionalArguments> |
|
|
|
<AndroidAotMode>Hybrid</AndroidAotMode> |
|
|
|
<AndroidGenerateJniMarshalMethods>True</AndroidGenerateJniMarshalMethods> |
|
|
|
</PropertyGroup> |
|
|
|
|
|
|
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
|
|
|
|
|
|
|
@ -61,8 +61,6 @@ namespace Avalonia.Android |
|
|
|
.Bind<IRenderLoop>().ToConstant(new RenderLoop()) |
|
|
|
.Bind<PlatformHotkeyConfiguration>().ToSingleton<PlatformHotkeyConfiguration>(); |
|
|
|
|
|
|
|
SkiaPlatform.Initialize(); |
|
|
|
|
|
|
|
if (options.UseGpu) |
|
|
|
{ |
|
|
|
EglPlatformOpenGlInterface.TryInitialize(); |
|
|
|
|
|
|
|
@ -31,21 +31,22 @@ namespace Avalonia.Android |
|
|
|
|
|
|
|
CustomizeAppBuilder(builder); |
|
|
|
|
|
|
|
View = new AvaloniaView(this); |
|
|
|
SetContentView(View); |
|
|
|
|
|
|
|
var lifetime = new SingleViewLifetime(); |
|
|
|
lifetime.View = View; |
|
|
|
|
|
|
|
builder.AfterSetup(x => |
|
|
|
{ |
|
|
|
_viewModel = new ViewModelProvider(this).Get(Java.Lang.Class.FromType(typeof(AvaloniaViewModel))) as AvaloniaViewModel; |
|
|
|
|
|
|
|
View = new AvaloniaView(this); |
|
|
|
if (_viewModel.Content != null) |
|
|
|
{ |
|
|
|
View.Content = _viewModel.Content; |
|
|
|
} |
|
|
|
|
|
|
|
SetContentView(View); |
|
|
|
lifetime.View = View; |
|
|
|
|
|
|
|
View.Prepare(); |
|
|
|
}); |
|
|
|
|
|
|
|
|