-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c8d1293
Showing
21 changed files
with
710 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0-android</TargetFramework> | ||
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> | ||
<Nullable>enable</Nullable> | ||
<ApplicationId>com.CompanyName.AvaloniaTest</ApplicationId> | ||
<ApplicationVersion>1</ApplicationVersion> | ||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> | ||
<AndroidPackageFormat>apk</AndroidPackageFormat> | ||
<AndroidEnableProfiledAot>true</AndroidEnableProfiledAot> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AndroidResource Include="Icon.png"> | ||
<Link>Resources\drawable\Icon.png</Link> | ||
</AndroidResource> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)" /> | ||
<PackageReference Include="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="9.0.0" /> | ||
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.0.1.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AvaCs3\AvaCs3.csproj" /> | ||
</ItemGroup> | ||
</Project> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Android.App; | ||
using Android.Content.PM; | ||
|
||
using Avalonia; | ||
using Avalonia.Android; | ||
using Avalonia.ReactiveUI; | ||
|
||
namespace AvaCs3.Android; | ||
|
||
[Activity( | ||
Label = "AvaCs3.Android", | ||
Theme = "@style/MyTheme.NoActionBar", | ||
Icon = "@drawable/icon", | ||
MainLauncher = true, | ||
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] | ||
public class MainActivity : AvaloniaMainActivity<App> | ||
{ | ||
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) | ||
{ | ||
return base.CustomizeAppBuilder(builder) | ||
.WithInterFont() | ||
.UseReactiveUI(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto"> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<application android:label="AvaloniaTest" android:icon="@drawable/Icon" /> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<item> | ||
<color android:color="@color/splash_background"/> | ||
</item> | ||
|
||
<item android:drawable="@drawable/icon" | ||
android:width="120dp" | ||
android:height="120dp" | ||
android:gravity="center" /> | ||
|
||
</layer-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="splash_background">#212121</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="splash_background">#FFFFFF</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<resources> | ||
|
||
<style name="MyTheme"> | ||
</style> | ||
|
||
<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.DayNight.NoActionBar"> | ||
<item name="android:windowActionBar">false</item> | ||
<item name="android:windowBackground">@drawable/splash_screen</item> | ||
<item name="android:windowNoTitle">true</item> | ||
</style> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35527.113 d17.12 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvaCs3", "AvaCs3\AvaCs3.csproj", "{B8E23406-51C5-4181-B8B3-85A216EA893A}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvaCs3.Android", "AvaCs3.Android\AvaCs3.Android.csproj", "{B206A310-BC2E-408E-9445-1BD6ED9F078D}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B8E23406-51C5-4181-B8B3-85A216EA893A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B8E23406-51C5-4181-B8B3-85A216EA893A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B8E23406-51C5-4181-B8B3-85A216EA893A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B8E23406-51C5-4181-B8B3-85A216EA893A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{B206A310-BC2E-408E-9445-1BD6ED9F078D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B206A310-BC2E-408E-9445-1BD6ED9F078D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B206A310-BC2E-408E-9445-1BD6ED9F078D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU | ||
{B206A310-BC2E-408E-9445-1BD6ED9F078D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B206A310-BC2E-408E-9445-1BD6ED9F078D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{B206A310-BC2E-408E-9445-1BD6ED9F078D}.Release|Any CPU.Deploy.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Application xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="AvaCs3.App" | ||
RequestedThemeVariant="Default"> | ||
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> | ||
|
||
<Application.Styles> | ||
<FluentTheme /> | ||
</Application.Styles> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using AvaCs3.ViewModels; | ||
using AvaCs3.Views; | ||
|
||
using Avalonia; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace AvaCs3; | ||
|
||
public partial class App : Application | ||
{ | ||
public override void Initialize() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
|
||
public override void OnFrameworkInitializationCompleted() | ||
{ | ||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) | ||
{ | ||
desktop.MainWindow = new MainWindow | ||
{ | ||
DataContext = new MainViewModel() | ||
}; | ||
} | ||
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) | ||
{ | ||
singleViewPlatform.MainView = new MainView | ||
{ | ||
DataContext = new MainViewModel() | ||
}; | ||
} | ||
|
||
base.OnFrameworkInitializationCompleted(); | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AvaloniaResource Include="Assets\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" /> | ||
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" /> | ||
<PackageReference Include="Avalonia.Fonts.Inter" Version="$(AvaloniaVersion)" /> | ||
<PackageReference Include="Avalonia.ReactiveUI" Version="$(AvaloniaVersion)" /> | ||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> | ||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace AvaCs3.ViewModels; | ||
|
||
public class MainViewModel : ViewModelBase | ||
{ | ||
public string Greeting => "Welcome to Avalonia!"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using ReactiveUI; | ||
|
||
namespace AvaCs3.ViewModels; | ||
|
||
public class ViewModelBase : ReactiveObject | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:vm="clr-namespace:AvaCs3.ViewModels" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="AvaCs3.Views.MainView" | ||
x:DataType="vm:MainViewModel"> | ||
<Design.DataContext> | ||
<!-- This only sets the DataContext for the previewer in an IDE, | ||
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) --> | ||
<vm:MainViewModel /> | ||
</Design.DataContext> | ||
|
||
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace AvaCs3.Views; | ||
|
||
public partial class MainView : UserControl | ||
{ | ||
public MainView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Window xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:vm="using:AvaCs3.ViewModels" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:views="clr-namespace:AvaCs3.Views" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="AvaCs3.Views.MainWindow" | ||
Icon="/Assets/avalonia-logo.ico" | ||
Title="AvaCs3"> | ||
<views:MainView /> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace AvaCs3.Views; | ||
|
||
public partial class MainWindow : Window | ||
{ | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Nullable>enable</Nullable> | ||
<AvaloniaVersion>11.1.0</AvaloniaVersion> | ||
</PropertyGroup> | ||
</Project> |