Progress with icons (not working)

This commit is contained in:
watsonb8 2019-12-03 11:31:02 -08:00
parent 6bb4b5fdd5
commit c24ff95bfc
16 changed files with 72 additions and 12 deletions

View File

@ -155,6 +155,9 @@
<Reference Include="System.Linq.Async">
<HintPath>..\packages\System.Linq.Async.4.0.0\lib\net461\System.Linq.Async.dll</HintPath>
</Reference>
<Reference Include="OpenTK.GLControl">
<HintPath>..\packages\OpenTK.GLControl.3.0.1\lib\net20\OpenTK.GLControl.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
@ -166,6 +169,10 @@
<EmbeddedResource Include="LibVLCSharp.dll.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Resources\backward.png" />
<EmbeddedResource Include="Resources\forwards.png" />
<EmbeddedResource Include="Resources\like.png" />
<EmbeddedResource Include="Resources\play.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="gtk-gui\generated.cs" />

View File

@ -12,14 +12,12 @@ namespace Aurora.gtk
{
Gtk.Application.Init();
LibVLCSharpFormsRenderer.Init();
// For some reason, Xamarin does not pick the LibVLCSharp.Form.Platforms.Gtk assembly as a renderer assembly.
// Add it manually.
//Also css doesn't work without adding the Xaml assembly
global::Xamarin.Forms.Forms.Init(new[] { typeof(LibVLCSharp.Forms.Platforms.GTK.VideoViewRenderer).Assembly, typeof(Xamarin.Forms.Xaml.ArrayExtension).Assembly });
if (PlatformHelper.GetGTKPlatform() == GTKPlatform.Windows)
{
GtkThemes.LoadCustomTheme("Themes/gtkrc-dark");

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -5,8 +5,8 @@
</configuration>
<import>
<widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<widget-library name="../../packages/Xamarin.Forms.Platform.GTK.3.6.0.344457/lib/net45/webkit-sharp.dll" />
<widget-library name="../../packages/LibVLCSharp.GTK.3.0.0/lib/net47/LibVLCSharp.GTK.dll" />
<widget-library name="../../packages/Xamarin.Forms.Platform.GTK.4.3.0.991211/lib/net45/webkit-sharp.dll" />
<widget-library name="../../packages/LibVLCSharp.GTK.3.3.1/lib/net47/LibVLCSharp.GTK.dll" />
<widget-library name="../bin/Debug/Aurora.gtk.exe" internal="true" />
</import>
<widget class="Gtk.Window" id="MainWindow" design-size="400 300">

View File

@ -14,6 +14,7 @@
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net47" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net47" />
<package id="OpenTK" version="3.1.0" targetFramework="net47" />
<package id="OpenTK.GLControl" version="3.0.1" targetFramework="net47" />
<package id="Sharpnado.Forms.HorizontalListView" version="1.3.0" targetFramework="net47" />
<package id="System.Buffers" version="4.4.0" targetFramework="net47" />
<package id="System.Interactive.Async" version="4.0.0" targetFramework="net47" />

View File

@ -42,6 +42,8 @@
<Folder Include="Design\Components\Library\" />
<Folder Include="Design\Views\Profile\" />
<Folder Include="Design\Components\DataGrid\" />
<Folder Include="Resources\" />
<Folder Include="Design\Extensions\" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Design\Behaviors\DeselectItemBehaviorBase.cs" />
@ -59,7 +61,10 @@
<Protobuf Include="Proto\sync.proto" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Design\Resources\unselected.png" />
<EmbeddedResource Include="Resources\backward.png" />
<EmbeddedResource Include="Resources\forwards.png" />
<EmbeddedResource Include="Resources\like.png" />
<EmbeddedResource Include="Resources\play.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Design\Components\NavigationMenu\NavigationMenu.css">
@ -68,5 +73,10 @@
</ItemGroup>
<ItemGroup>
<None Remove="Design\Resources\unselected.png" />
<None Remove="Design\Components\MediaPlayer\play.png" />
<None Remove="Resources\backward.png" />
<None Remove="Resources\forwards.png" />
<None Remove="Resources\like.png" />
<None Remove="Resources\play.png" />
</ItemGroup>
</Project>

View File

@ -2,6 +2,7 @@
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Aurora.Design.Extensions"
x:Class="Aurora.Design.Components.MediaPlayer.Player">
<ContentView.Resources>
<StyleSheet
@ -33,19 +34,20 @@
Grid.Column="1"
HorizontalOptions="Center"
Orientation="Horizontal">
<Button
Text="Previous"
<Image Source="{local:ImageResource Aurora.gtk.Resources.forward.png}" />
<ImageButton
x:Name="PreviousButton"
Source="{local:ImageResource Aurora.gtk.Resources.backward.png}"
WidthRequest="100"
HeightRequest="50"/>
<Button
HeightRequest="50"></ImageButton>
<ImageButton
x:Name="PlayButton"
Text="Play/Pause"
Source="{local:ImageResource Aurora.gtk.Resources.play.png}"
WidthRequest="100"
HeightRequest="50"/>
<Button
Text="Next"
<ImageButton
x:Name="NextButton"
Source="{local:ImageResource Aurora.gtk.Resources.forward.png}"
WidthRequest="100"
HeightRequest="50"/>
</StackLayout>

View File

@ -0,0 +1,42 @@
using System;
using System.Linq;
using System.Reflection;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Aurora.Design.Extensions
{
[ContentProperty(nameof(Source))]
public class ImageResourceExtension : IMarkupExtension
{
public string Source { get; set; }
public object ProvideValue(IServiceProvider serviceProvider)
{
if (Source == null)
{
return null;
}
Assembly[] referencedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
var gtkAsm = referencedAssemblies.FirstOrDefault((e) =>
{
return e.FullName.Contains("Aurora.gtk");
});
foreach (var res in gtkAsm.GetManifestResourceNames())
{
System.Diagnostics.Debug.WriteLine("found resource: " + res);
}
if (gtkAsm == null && gtkAsm is Assembly)
{
return null;
}
// Do your translation lookup here, using whatever method you require
var imageSource = ImageSource.FromResource(Source, gtkAsm);
return imageSource;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
Aurora/Resources/like.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
Aurora/Resources/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB