Skip to content

Commit fbe0997

Browse files
Merge pull request #118 from CodebreakerApp/117-avalonia
117 avalonia
2 parents 005e596 + 0f4aa08 commit fbe0997

55 files changed

Lines changed: 1335 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/CodeBreaker.Avalonia.sln

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34414.90
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeBreaker.Avalonia", "CodeBreaker.Avalonia\CodeBreaker.Avalonia\CodeBreaker.Avalonia.csproj", "{D2366847-54B9-4534-9ED5-A526DF026BE8}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeBreaker.Avalonia.Android", "CodeBreaker.Avalonia\CodeBreaker.Avalonia.Android\CodeBreaker.Avalonia.Android.csproj", "{40D581DB-5D70-49AE-B23A-B8314554CF0D}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeBreaker.Avalonia.Desktop", "CodeBreaker.Avalonia\CodeBreaker.Avalonia.Desktop\CodeBreaker.Avalonia.Desktop.csproj", "{EC4DCF15-8A18-4E61-99AB-703E60262311}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeBreaker.Avalonia.iOS", "CodeBreaker.Avalonia\CodeBreaker.Avalonia.iOS\CodeBreaker.Avalonia.iOS.csproj", "{1FF504B5-77F9-4E13-A09D-2C026A19E434}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeBreaker.Avalonia.Browser", "CodeBreaker.Avalonia\CodeBreaker.Avalonia.Browser\CodeBreaker.Avalonia.Browser.csproj", "{2A873F4C-E29C-4AC0-A9D0-E1E24BFBD543}"
15+
EndProject
16+
Global
17+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
18+
Debug|Any CPU = Debug|Any CPU
19+
Release|Any CPU = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
22+
{D2366847-54B9-4534-9ED5-A526DF026BE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{D2366847-54B9-4534-9ED5-A526DF026BE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{D2366847-54B9-4534-9ED5-A526DF026BE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{D2366847-54B9-4534-9ED5-A526DF026BE8}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{40D581DB-5D70-49AE-B23A-B8314554CF0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{40D581DB-5D70-49AE-B23A-B8314554CF0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{40D581DB-5D70-49AE-B23A-B8314554CF0D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
29+
{40D581DB-5D70-49AE-B23A-B8314554CF0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
30+
{40D581DB-5D70-49AE-B23A-B8314554CF0D}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{40D581DB-5D70-49AE-B23A-B8314554CF0D}.Release|Any CPU.Deploy.0 = Release|Any CPU
32+
{EC4DCF15-8A18-4E61-99AB-703E60262311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{EC4DCF15-8A18-4E61-99AB-703E60262311}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{EC4DCF15-8A18-4E61-99AB-703E60262311}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{EC4DCF15-8A18-4E61-99AB-703E60262311}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{1FF504B5-77F9-4E13-A09D-2C026A19E434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{1FF504B5-77F9-4E13-A09D-2C026A19E434}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{1FF504B5-77F9-4E13-A09D-2C026A19E434}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
39+
{1FF504B5-77F9-4E13-A09D-2C026A19E434}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{1FF504B5-77F9-4E13-A09D-2C026A19E434}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{1FF504B5-77F9-4E13-A09D-2C026A19E434}.Release|Any CPU.Deploy.0 = Release|Any CPU
42+
{2A873F4C-E29C-4AC0-A9D0-E1E24BFBD543}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43+
{2A873F4C-E29C-4AC0-A9D0-E1E24BFBD543}.Debug|Any CPU.Build.0 = Debug|Any CPU
44+
{2A873F4C-E29C-4AC0-A9D0-E1E24BFBD543}.Release|Any CPU.ActiveCfg = Release|Any CPU
45+
{2A873F4C-E29C-4AC0-A9D0-E1E24BFBD543}.Release|Any CPU.Build.0 = Release|Any CPU
46+
EndGlobalSection
47+
GlobalSection(SolutionProperties) = preSolution
48+
HideSolutionNode = FALSE
49+
EndGlobalSection
50+
GlobalSection(ExtensibilityGlobals) = postSolution
51+
SolutionGuid = {109BCF32-29B4-4DB9-9A9B-ED9A290C3E30}
52+
EndGlobalSection
53+
EndGlobal
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>net8.0-android</TargetFramework>
5+
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
6+
<Nullable>enable</Nullable>
7+
<ApplicationId>com.CompanyName.CodeBreaker.Avalonia</ApplicationId>
8+
<ApplicationVersion>1</ApplicationVersion>
9+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
10+
<AndroidPackageFormat>apk</AndroidPackageFormat>
11+
<AndroidEnableProfiledAot>False</AndroidEnableProfiledAot>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<AndroidResource Include="Icon.png">
16+
<Link>Resources\drawable\Icon.png</Link>
17+
</AndroidResource>
18+
</ItemGroup>
19+
20+
<ItemGroup>
21+
<PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
22+
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.0.1.1" />
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<ProjectReference Include="..\CodeBreaker.Avalonia\CodeBreaker.Avalonia.csproj" />
27+
</ItemGroup>
28+
</Project>
14 KB
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Android.App;
2+
using Android.Content.PM;
3+
using Avalonia;
4+
using Avalonia.Android;
5+
6+
namespace CodeBreaker.Avalonia.Android;
7+
[Activity(
8+
Label = "CodeBreaker.Avalonia.Android",
9+
Theme = "@style/MyTheme.NoActionBar",
10+
Icon = "@drawable/icon",
11+
MainLauncher = true,
12+
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
13+
public class MainActivity : AvaloniaMainActivity<App>
14+
{
15+
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
16+
{
17+
return base.CustomizeAppBuilder(builder)
18+
.WithInterFont();
19+
}
20+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
3+
<uses-permission android:name="android.permission.INTERNET" />
4+
<application android:label="CodeBreaker.Avalonia" android:icon="@drawable/Icon" />
5+
</manifest>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Images, layout descriptions, binary blobs and string dictionaries can be included
2+
in your application as resource files. Various Android APIs are designed to
3+
operate on the resource IDs instead of dealing with images, strings or binary blobs
4+
directly.
5+
6+
For example, a sample Android app that contains a user interface layout (main.axml),
7+
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8+
would keep its resources in the "Resources" directory of the application:
9+
10+
Resources/
11+
drawable/
12+
icon.png
13+
14+
layout/
15+
main.axml
16+
17+
values/
18+
strings.xml
19+
20+
In order to get the build system to recognize Android resources, set the build action to
21+
"AndroidResource". The native Android APIs do not operate directly with filenames, but
22+
instead operate on resource IDs. When you compile an Android application that uses resources,
23+
the build system will package the resources for distribution and generate a class called "R"
24+
(this is an Android convention) that contains the tokens for each one of the resources
25+
included. For example, for the above Resources layout, this is what the R class would expose:
26+
27+
public class R {
28+
public class drawable {
29+
public const int icon = 0x123;
30+
}
31+
32+
public class layout {
33+
public const int main = 0x456;
34+
}
35+
36+
public class strings {
37+
public const int first_string = 0xabc;
38+
public const int second_string = 0xbcd;
39+
}
40+
}
41+
42+
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43+
to reference the layout/main.axml file, or R.strings.first_string to reference the first
44+
string in the dictionary file values/strings.xml.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<animated-vector
2+
xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:aapt="http://schemas.android.com/aapt">
4+
<aapt:attr name="android:drawable">
5+
<vector
6+
android:name="vector"
7+
android:width="128dp"
8+
android:height="128dp"
9+
android:viewportWidth="128"
10+
android:viewportHeight="128">
11+
<group
12+
android:name="wrapper"
13+
android:translateX="21"
14+
android:translateY="21">
15+
<group android:name="group">
16+
<path
17+
android:name="path"
18+
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z"
19+
android:strokeWidth="1"/>
20+
<path
21+
android:name="path_1"
22+
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z"
23+
android:strokeWidth="1"
24+
android:fillType="evenOdd"/>
25+
<path
26+
android:name="path_2"
27+
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z"
28+
android:strokeWidth="1"/>
29+
</group>
30+
</group>
31+
</vector>
32+
</aapt:attr>
33+
<target android:name="path">
34+
<aapt:attr name="android:animation">
35+
<objectAnimator
36+
android:propertyName="fillColor"
37+
android:duration="1000"
38+
android:valueFrom="#00ffffff"
39+
android:valueTo="#161c2d"
40+
android:valueType="colorType"
41+
android:interpolator="@android:interpolator/fast_out_slow_in"/>
42+
</aapt:attr>
43+
</target>
44+
<target android:name="path_1">
45+
<aapt:attr name="android:animation">
46+
<objectAnimator
47+
android:propertyName="fillColor"
48+
android:duration="1000"
49+
android:valueFrom="#00ffffff"
50+
android:valueTo="#f9f9fb"
51+
android:valueType="colorType"
52+
android:interpolator="@android:interpolator/fast_out_slow_in"/>
53+
</aapt:attr>
54+
</target>
55+
<target android:name="path_2">
56+
<aapt:attr name="android:animation">
57+
<objectAnimator
58+
android:propertyName="fillColor"
59+
android:duration="1000"
60+
android:valueFrom="#00ffffff"
61+
android:valueTo="#f9f9fb"
62+
android:valueType="colorType"
63+
android:interpolator="@android:interpolator/fast_out_slow_in"/>
64+
</aapt:attr>
65+
</target>
66+
</animated-vector>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<animated-vector
2+
xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:aapt="http://schemas.android.com/aapt">
4+
<aapt:attr name="android:drawable">
5+
<vector
6+
android:name="vector"
7+
android:width="128dp"
8+
android:height="128dp"
9+
android:viewportWidth="128"
10+
android:viewportHeight="128">
11+
<group
12+
android:name="wrapper"
13+
android:translateX="21"
14+
android:translateY="21">
15+
<group android:name="group">
16+
<path
17+
android:name="path"
18+
android:pathData="M 74.853 85.823 L 75.368 85.823 C 80.735 85.823 85.144 81.803 85.761 76.602 L 85.836 41.76 C 85.225 18.593 66.254 0 42.939 0 C 19.24 0 0.028 19.212 0.028 42.912 C 0.028 66.357 18.831 85.418 42.18 85.823 L 74.853 85.823 Z"
19+
android:fillColor="#00ffffff"
20+
android:strokeWidth="1"/>
21+
<path
22+
android:name="path_1"
23+
android:pathData="M 43.059 14.614 C 29.551 14.614 18.256 24.082 15.445 36.743 C 18.136 37.498 20.109 39.968 20.109 42.899 C 20.109 45.831 18.136 48.301 15.445 49.055 C 18.256 61.716 29.551 71.184 43.059 71.184 C 47.975 71.184 52.599 69.93 56.628 67.723 L 56.628 70.993 L 71.344 70.993 L 71.344 44.072 C 71.357 43.714 71.344 43.26 71.344 42.899 C 71.344 27.278 58.68 14.614 43.059 14.614 Z M 29.51 42.899 C 29.51 35.416 35.576 29.35 43.059 29.35 C 50.541 29.35 56.607 35.416 56.607 42.899 C 56.607 50.382 50.541 56.448 43.059 56.448 C 35.576 56.448 29.51 50.382 29.51 42.899 Z"
24+
android:fillColor="#00ffffff"
25+
android:strokeWidth="1"
26+
android:fillType="evenOdd"/>
27+
<path
28+
android:name="path_2"
29+
android:pathData="M 18.105 42.88 C 18.105 45.38 16.078 47.407 13.579 47.407 C 11.079 47.407 9.052 45.38 9.052 42.88 C 9.052 40.381 11.079 38.354 13.579 38.354 C 16.078 38.354 18.105 40.381 18.105 42.88 Z"
30+
android:fillColor="#00ffffff"
31+
android:strokeWidth="1"/>
32+
</group>
33+
</group>
34+
</vector>
35+
</aapt:attr>
36+
<target android:name="path_2">
37+
<aapt:attr name="android:animation">
38+
<objectAnimator
39+
android:propertyName="fillColor"
40+
android:startOffset="100"
41+
android:duration="900"
42+
android:valueFrom="#00ffffff"
43+
android:valueTo="#161c2d"
44+
android:valueType="colorType"
45+
android:interpolator="@android:interpolator/fast_out_slow_in"/>
46+
</aapt:attr>
47+
</target>
48+
<target android:name="path">
49+
<aapt:attr name="android:animation">
50+
<objectAnimator
51+
android:propertyName="fillColor"
52+
android:duration="500"
53+
android:valueFrom="#00ffffff"
54+
android:valueTo="#f9f9fb"
55+
android:valueType="colorType"
56+
android:interpolator="@android:interpolator/fast_out_slow_in"/>
57+
</aapt:attr>
58+
</target>
59+
<target android:name="path_1">
60+
<aapt:attr name="android:animation">
61+
<objectAnimator
62+
android:propertyName="fillColor"
63+
android:startOffset="100"
64+
android:duration="900"
65+
android:valueFrom="#00ffffff"
66+
android:valueTo="#161c2d"
67+
android:valueType="colorType"
68+
android:interpolator="@android:interpolator/fast_out_slow_in"/>
69+
</aapt:attr>
70+
</target>
71+
</animated-vector>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<item>
5+
<color android:color="@color/splash_background"/>
6+
</item>
7+
8+
<item android:drawable="@drawable/icon"
9+
android:width="120dp"
10+
android:height="120dp"
11+
android:gravity="center" />
12+
13+
</layer-list>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="splash_background">#212121</color>
4+
</resources>

0 commit comments

Comments
 (0)