Skip to content

Commit

Permalink
feat: Add CastViewer
Browse files Browse the repository at this point in the history
  • Loading branch information
InuInu2022 committed Jun 3, 2024
1 parent c35eeee commit 74f9aac
Show file tree
Hide file tree
Showing 47 changed files with 1,520 additions and 0 deletions.
33 changes: 33 additions & 0 deletions cevio-casts.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateCheck", "tests\Update
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CevioCasts.UpdateChecker", "languages\csharp\CevioCasts.UpdateChecker\CevioCasts.UpdateChecker.csproj", "{4B44E997-89E9-4E0C-8FD3-A059926CE007}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "viewer", "viewer", "{63AE9FF6-FFC9-4D2A-9C36-D0BDB80BF3E9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CastViewer", "CastViewer", "{DABA4146-2600-4C2C-974F-934F9D89B643}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CastViewer.Core", "viewer\CastViewer\CastViewer.Core\CastViewer.Core.csproj", "{6401CAD1-98BB-44AD-9A25-ABB76D53BFB7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CastViewer", "viewer\CastViewer\CastViewer\CastViewer.csproj", "{4ACE5C06-354C-45F9-A57F-B74D6AC515D1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CastViewer.Browser", "viewer\CastViewer\CastViewer.Browser\CastViewer.Browser.csproj", "{DDD2BDDD-7DC8-48D8-9D53-13CD9DE5496B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CastViewer.Desktop", "viewer\CastViewer\CastViewer.Desktop\CastViewer.Desktop.csproj", "{BB3045B4-358F-4814-97D7-F431E26F196C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -42,11 +54,32 @@ Global
{4B44E997-89E9-4E0C-8FD3-A059926CE007}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B44E997-89E9-4E0C-8FD3-A059926CE007}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B44E997-89E9-4E0C-8FD3-A059926CE007}.Release|Any CPU.Build.0 = Release|Any CPU
{6401CAD1-98BB-44AD-9A25-ABB76D53BFB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6401CAD1-98BB-44AD-9A25-ABB76D53BFB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6401CAD1-98BB-44AD-9A25-ABB76D53BFB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6401CAD1-98BB-44AD-9A25-ABB76D53BFB7}.Release|Any CPU.Build.0 = Release|Any CPU
{4ACE5C06-354C-45F9-A57F-B74D6AC515D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4ACE5C06-354C-45F9-A57F-B74D6AC515D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4ACE5C06-354C-45F9-A57F-B74D6AC515D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4ACE5C06-354C-45F9-A57F-B74D6AC515D1}.Release|Any CPU.Build.0 = Release|Any CPU
{DDD2BDDD-7DC8-48D8-9D53-13CD9DE5496B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDD2BDDD-7DC8-48D8-9D53-13CD9DE5496B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDD2BDDD-7DC8-48D8-9D53-13CD9DE5496B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDD2BDDD-7DC8-48D8-9D53-13CD9DE5496B}.Release|Any CPU.Build.0 = Release|Any CPU
{BB3045B4-358F-4814-97D7-F431E26F196C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB3045B4-358F-4814-97D7-F431E26F196C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB3045B4-358F-4814-97D7-F431E26F196C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB3045B4-358F-4814-97D7-F431E26F196C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{0DADEAF5-284F-403D-9614-76B50AF98559} = {79FD13AA-8212-4495-A58D-CBF517EB00C7}
{52BF462D-66A4-4B5B-9945-B7EDC41524CD} = {0DADEAF5-284F-403D-9614-76B50AF98559}
{F7E7758D-E28B-459D-ACBE-DE78AF594AB2} = {FF0FEE4A-4334-4D98-8873-CC62A1A37C7D}
{4B44E997-89E9-4E0C-8FD3-A059926CE007} = {0DADEAF5-284F-403D-9614-76B50AF98559}
{DABA4146-2600-4C2C-974F-934F9D89B643} = {63AE9FF6-FFC9-4D2A-9C36-D0BDB80BF3E9}
{6401CAD1-98BB-44AD-9A25-ABB76D53BFB7} = {DABA4146-2600-4C2C-974F-934F9D89B643}
{4ACE5C06-354C-45F9-A57F-B74D6AC515D1} = {DABA4146-2600-4C2C-974F-934F9D89B643}
{DDD2BDDD-7DC8-48D8-9D53-13CD9DE5496B} = {DABA4146-2600-4C2C-974F-934F9D89B643}
{BB3045B4-358F-4814-97D7-F431E26F196C} = {DABA4146-2600-4C2C-974F-934F9D89B643}
EndGlobalSection
EndGlobal
28 changes: 28 additions & 0 deletions viewer/CastViewer/CastViewer.Android/CastViewer.Android.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<ApplicationId>com.CompanyName.CastViewer</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
</PropertyGroup>

<ItemGroup>
<AndroidResource Include="Icon.png">
<Link>Resources\drawable\Icon.png</Link>
</AndroidResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Android" Version="$(AvaloniaVersion)" />
<PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.0.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CastViewer\CastViewer.csproj" />
</ItemGroup>
</Project>
Binary file added viewer/CastViewer/CastViewer.Android/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions viewer/CastViewer/CastViewer.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Android.App;
using Android.Content.PM;
using Avalonia;
using Avalonia.Android;
using Avalonia.ReactiveUI;

namespace CastViewer.Android;

[Activity(
Label = "CastViewer.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();
}
}
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="CastViewer" android:icon="@drawable/Icon" />
</manifest>
44 changes: 44 additions & 0 deletions viewer/CastViewer/CastViewer.Android/Resources/AboutResources.txt
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
android:name="vector"
android:width="128dp"
android:height="128dp"
android:viewportWidth="128"
android:viewportHeight="128">
<group
android:name="wrapper"
android:translateX="21"
android:translateY="21">
<group android:name="group">
<path
android:name="path"
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"
android:strokeWidth="1"/>
<path
android:name="path_1"
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"
android:strokeWidth="1"
android:fillType="evenOdd"/>
<path
android:name="path_2"
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"
android:strokeWidth="1"/>
</group>
</group>
</vector>
</aapt:attr>
<target android:name="path">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillColor"
android:duration="1000"
android:valueFrom="#00ffffff"
android:valueTo="#161c2d"
android:valueType="colorType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="path_1">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillColor"
android:duration="1000"
android:valueFrom="#00ffffff"
android:valueTo="#f9f9fb"
android:valueType="colorType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="path_2">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillColor"
android:duration="1000"
android:valueFrom="#00ffffff"
android:valueTo="#f9f9fb"
android:valueType="colorType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
</animated-vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
android:name="vector"
android:width="128dp"
android:height="128dp"
android:viewportWidth="128"
android:viewportHeight="128">
<group
android:name="wrapper"
android:translateX="21"
android:translateY="21">
<group android:name="group">
<path
android:name="path"
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"
android:fillColor="#00ffffff"
android:strokeWidth="1"/>
<path
android:name="path_1"
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"
android:fillColor="#00ffffff"
android:strokeWidth="1"
android:fillType="evenOdd"/>
<path
android:name="path_2"
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"
android:fillColor="#00ffffff"
android:strokeWidth="1"/>
</group>
</group>
</vector>
</aapt:attr>
<target android:name="path_2">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillColor"
android:startOffset="100"
android:duration="900"
android:valueFrom="#00ffffff"
android:valueTo="#161c2d"
android:valueType="colorType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="path">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillColor"
android:duration="500"
android:valueFrom="#00ffffff"
android:valueTo="#f9f9fb"
android:valueType="colorType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
<target android:name="path_1">
<aapt:attr name="android:animation">
<objectAnimator
android:propertyName="fillColor"
android:startOffset="100"
android:duration="900"
android:valueFrom="#00ffffff"
android:valueTo="#161c2d"
android:valueType="colorType"
android:interpolator="@android:interpolator/fast_out_slow_in"/>
</aapt:attr>
</target>
</animated-vector>
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>
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>

<style name="MyTheme">
</style>

<style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
<item name="android:windowActionBar">false</item>
<item name="android:windowBackground">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowSplashScreenBackground">@color/splash_background</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/avalonia_anim</item>
<item name="android:windowSplashScreenAnimationDuration">1000</item>
<item name="postSplashScreenTheme">@style/MyTheme.Main</item>

</style>
<style name="MyTheme.Main"
parent ="MyTheme.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>
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>
12 changes: 12 additions & 0 deletions viewer/CastViewer/CastViewer.Android/Resources/values/styles.xml
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>
31 changes: 31 additions & 0 deletions viewer/CastViewer/CastViewer.Browser/CastViewer.Browser.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-browser</TargetFramework>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<WasmMainJSPath>wwwroot\main.js</WasmMainJSPath>
<WasmRuntimeAssetsLocation>./_framework</WasmRuntimeAssetsLocation>
<RunAOTCompilation>true</RunAOTCompilation>
<PublishTrimmed>true</PublishTrimmed>

<WasmEnableThreads>false</WasmEnableThreads>
<TrimMode>full</TrimMode>
</PropertyGroup>

<ItemGroup>
<WasmExtraFilesToDeploy Include="wwwroot\**" />
</ItemGroup>

<ItemGroup>
<TrimmerRootAssembly Include="Avalonia.Browser" />
<TrimmerRootAssembly Include="Avalonia.Base" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CastViewer\CastViewer.csproj" />
</ItemGroup>
</Project>
Loading

0 comments on commit 74f9aac

Please sign in to comment.