diff --git a/BrickController2/BrickController2.Android/MainApplication.cs b/BrickController2/BrickController2.Android/MainApplication.cs index f14cd75ee..84f708c99 100644 --- a/BrickController2/BrickController2.Android/MainApplication.cs +++ b/BrickController2/BrickController2.Android/MainApplication.cs @@ -22,7 +22,6 @@ protected override MauiApp CreateMauiApp() => ApplicationBuilder.Create() { handlers .AddHandler() - .AddHandler() ; }) .ConfigureContainer((containerBuilder) => diff --git a/BrickController2/BrickController2.Android/UI/CustomHandlers/ColorImageRenderer.cs b/BrickController2/BrickController2.Android/UI/CustomHandlers/ColorImageRenderer.cs deleted file mode 100644 index f7439af87..000000000 --- a/BrickController2/BrickController2.Android/UI/CustomHandlers/ColorImageRenderer.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Android.Graphics; -using Android.Widget; -using BrickController2.UI.Controls; -using Microsoft.Maui.Controls.Internals; -using Microsoft.Maui.Platform; -using Microsoft.Maui.Handlers; - -namespace BrickController2.Droid.UI.CustomRenderers -{ - public class ColorImageHandler : ImageHandler - { - public static readonly PropertyMapper PropertyMapper = new(ImageHandler.Mapper) - { - [ColorImage.ColorProperty.PropertyName] = SetColor, - [ColorImage.SourceProperty.PropertyName] = MapSourceAndColor - }; - - public ColorImageHandler() : base(PropertyMapper) - { - } - - private static IResourceDictionary ResourceDictionary => Application.Current.Resources; - - protected override void ConnectHandler(ImageView platformView) - { - base.ConnectHandler(platformView); - SetColor(); - - // react on theme change - ResourceDictionary.ValuesChanged += (sender, args) => SetColor(); - } - - private void SetColor() => SetColor(this, VirtualView as ColorImage); - - private static void MapSourceAndColor(ColorImageHandler handler, ColorImage colorImage) - { - SetColor(handler, colorImage); - MapSource(handler, colorImage); - } - - private static void SetColor(ColorImageHandler handler, ColorImage colorImage) - { - if (colorImage is null) - { - return; - } - - if (colorImage.Color.Equals(Colors.Transparent)) - { - if (handler.PlatformView.ColorFilter != null) - { - handler.PlatformView.ClearColorFilter(); - } - } - else - { - var colorFilter = new PorterDuffColorFilter(colorImage.Color.ToPlatform(), PorterDuff.Mode.SrcIn); - handler.PlatformView.SetColorFilter(colorFilter); - } - } - } -} \ No newline at end of file diff --git a/BrickController2/BrickController2.WinUI/App.xaml.cs b/BrickController2/BrickController2.WinUI/App.xaml.cs index b7b8b2180..1cd9e2535 100644 --- a/BrickController2/BrickController2.WinUI/App.xaml.cs +++ b/BrickController2/BrickController2.WinUI/App.xaml.cs @@ -23,7 +23,6 @@ protected override MauiApp CreateMauiApp() => ApplicationBuilder.Create() { handlers .AddHandler() - .AddHandler() ; // handle swipe if there is no touch screen diff --git a/BrickController2/BrickController2.WinUI/UI/CustomHandlers/CustomPageHandler.cs b/BrickController2/BrickController2.WinUI/UI/CustomHandlers/CustomPageHandler.cs deleted file mode 100644 index a553bde34..000000000 --- a/BrickController2/BrickController2.WinUI/UI/CustomHandlers/CustomPageHandler.cs +++ /dev/null @@ -1,41 +0,0 @@ -using BrickController2.UI.Pages; -using Microsoft.Maui.Handlers; -using Microsoft.Maui.Platform; - -namespace BrickController2.Windows.UI.CustomHandlers; - -/// -/// Applies TitleView adjustments to resolve issue: TitleView content does not expand across the entire width -/// https://github.com/dotnet/maui/issues/10703 -/// -internal class CustomPageHandler : PageHandler -{ - protected override void ConnectHandler(ContentPanel platformView) - { - base.ConnectHandler(platformView); - - if (VirtualView is PageBase page) - { - var window = page.Window; - - window.SizeChanged += Window_SizeChanged; - page.Unloaded += (sender, args) => window.SizeChanged -= Window_SizeChanged; - - ApplyTitleViewWidth(page); - } - } - - private void Window_SizeChanged(object sender, EventArgs e) - { - ApplyTitleViewWidth(VirtualView as PageBase); - } - - private static void ApplyTitleViewWidth(PageBase page) - { - var view = NavigationPage.GetTitleView(page); - if (view != null) - { - view.WidthRequest = page.Window.Width; - } - } -} diff --git a/BrickController2/BrickController2.iOS/UI/CustomRenderers/ColorImageRenderer.cs b/BrickController2/BrickController2.iOS/UI/CustomRenderers/ColorImageRenderer.cs deleted file mode 100644 index 5f6e4cfa4..000000000 --- a/BrickController2/BrickController2.iOS/UI/CustomRenderers/ColorImageRenderer.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.ComponentModel; -using BrickController2.iOS.UI.CustomRenderers; -using BrickController2.UI.Controls; -using UIKit; -using Xamarin.Forms; -using Xamarin.Forms.Platform.iOS; - -[assembly:ExportRenderer(typeof(ColorImage), typeof(ColorImageRenderer))] -namespace BrickController2.iOS.UI.CustomRenderers -{ - public class ColorImageRenderer : ImageRenderer - { - protected override void OnElementChanged(ElementChangedEventArgs e) - { - base.OnElementChanged(e); - SetColor(); - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) - { - base.OnElementPropertyChanged(sender, e); - - if (e.PropertyName == ColorImage.ColorProperty.PropertyName || e.PropertyName == ColorImage.SourceProperty.PropertyName || e.PropertyName == ColorImage.IsLoadingProperty.PropertyName) - { - SetColor(); - } - } - - private void SetColor() - { - if (Control == null || Control.Image == null || !(Element is ColorImage colorImage)) - { - return; - } - - if (colorImage.Color.Equals(Xamarin.Forms.Color.Transparent)) - { - Control.Image = Control.Image.ImageWithRenderingMode(UIImageRenderingMode.Automatic); - Control.TintColor = null; - } - else - { - Control.Image = Control.Image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate); - Control.TintColor = colorImage.Color.ToUIColor(); - } - } - } -} \ No newline at end of file diff --git a/BrickController2/BrickController2/App.xaml b/BrickController2/BrickController2/App.xaml index 06db2b222..eba03f440 100644 --- a/BrickController2/BrickController2/App.xaml +++ b/BrickController2/BrickController2/App.xaml @@ -68,12 +68,6 @@ - - @@ -83,12 +77,6 @@ - - diff --git a/BrickController2/BrickController2/BrickController2.csproj b/BrickController2/BrickController2/BrickController2.csproj index 6c473a005..17faf2597 100644 --- a/BrickController2/BrickController2/BrickController2.csproj +++ b/BrickController2/BrickController2/BrickController2.csproj @@ -8,6 +8,11 @@ + + + + + diff --git a/BrickController2/BrickController2/DI/ApplicationBuilder.cs b/BrickController2/BrickController2/DI/ApplicationBuilder.cs index 3a558f007..f5c1429c5 100644 --- a/BrickController2/BrickController2/DI/ApplicationBuilder.cs +++ b/BrickController2/BrickController2/DI/ApplicationBuilder.cs @@ -17,6 +17,11 @@ public static MauiAppBuilder Create() return builder // configure BC2 app .UseMauiApp() + .ConfigureFonts(fonts => + { + // source: https://github.com/google/material-design-icons/blob/master/font/MaterialIconsOutlined-Regular.otf + fonts.AddFont("MaterialIconsOutlined-Regular", "Icons"); + }) // configure other common dependencies if needed ; } diff --git a/BrickController2/BrickController2/Resources/Fonts/MaterialIconsOutlined-Regular.otf b/BrickController2/BrickController2/Resources/Fonts/MaterialIconsOutlined-Regular.otf new file mode 100644 index 000000000..9dad12bcf Binary files /dev/null and b/BrickController2/BrickController2/Resources/Fonts/MaterialIconsOutlined-Regular.otf differ diff --git a/BrickController2/BrickController2/Resources/TranslationResources.resx b/BrickController2/BrickController2/Resources/TranslationResources.resx index e73160174..250b356cf 100644 --- a/BrickController2/BrickController2/Resources/TranslationResources.resx +++ b/BrickController2/BrickController2/Resources/TranslationResources.resx @@ -141,6 +141,9 @@ Advanced settings + + Apply changes + Are you sure to delete this controller action? @@ -315,6 +318,15 @@ Error during scanning + + Export the controller profile + + + Export the creation + + + Export the sequence + Export successful: @@ -348,6 +360,15 @@ Icon set + + Import a controller profile + + + Import a creation + + + Import a sequence + Information diff --git a/BrickController2/BrickController2/UI/Commands/CommandExtensions.cs b/BrickController2/BrickController2/UI/Commands/CommandExtensions.cs new file mode 100644 index 000000000..f81b09eb0 --- /dev/null +++ b/BrickController2/BrickController2/UI/Commands/CommandExtensions.cs @@ -0,0 +1,14 @@ +using System.Windows.Input; + +namespace BrickController2.UI.Commands; + +internal static class CommandExtensions +{ + internal static void RaiseCanExecuteChanged(this ICommand command) + { + if (command is IExtendableCommand cmd) + { + cmd.RaiseCanExecuteChanged(); + } + } +} diff --git a/BrickController2/BrickController2/UI/Commands/IExtendableCommand.cs b/BrickController2/BrickController2/UI/Commands/IExtendableCommand.cs new file mode 100644 index 000000000..617c8cd00 --- /dev/null +++ b/BrickController2/BrickController2/UI/Commands/IExtendableCommand.cs @@ -0,0 +1,8 @@ +using System.Windows.Input; + +namespace BrickController2.UI.Commands; + +internal interface IExtendableCommand +{ + void RaiseCanExecuteChanged(); +} diff --git a/BrickController2/BrickController2/UI/Commands/SafeCommand.cs b/BrickController2/BrickController2/UI/Commands/SafeCommand.cs index 63cf85209..3b2ef3868 100644 --- a/BrickController2/BrickController2/UI/Commands/SafeCommand.cs +++ b/BrickController2/BrickController2/UI/Commands/SafeCommand.cs @@ -1,10 +1,8 @@ -using System; -using System.Threading.Tasks; -using System.Windows.Input; +using System.Windows.Input; namespace BrickController2.UI.Commands { - public class SafeCommand : ICommand + public class SafeCommand : ICommand, IExtendableCommand { private readonly Func _execute; private readonly Predicate _canExecute; @@ -58,13 +56,13 @@ public async void Execute(object parameter) } } - private void RaiseCanExecuteChanged() + public void RaiseCanExecuteChanged() { CanExecuteChanged?.Invoke(this, EventArgs.Empty); } } - public class SafeCommand : ICommand + public class SafeCommand : ICommand, IExtendableCommand { private readonly Func _execute; private readonly Predicate _canExecute; @@ -106,7 +104,7 @@ public async void Execute(object parameter) } } - private void RaiseCanExecuteChanged() + public void RaiseCanExecuteChanged() { CanExecuteChanged?.Invoke(this, EventArgs.Empty); } diff --git a/BrickController2/BrickController2/UI/Controls/CheckBox.xaml b/BrickController2/BrickController2/UI/Controls/CheckBox.xaml index a43ba86a9..955a760cb 100644 --- a/BrickController2/BrickController2/UI/Controls/CheckBox.xaml +++ b/BrickController2/BrickController2/UI/Controls/CheckBox.xaml @@ -14,7 +14,11 @@ - + + + + + diff --git a/BrickController2/BrickController2/UI/Controls/ColorImage.cs b/BrickController2/BrickController2/UI/Controls/ColorImage.cs deleted file mode 100644 index cb480bb0c..000000000 --- a/BrickController2/BrickController2/UI/Controls/ColorImage.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace BrickController2.UI.Controls -{ - // Reference: https://github.com/shrutinambiar/xamarin-forms-tinted-image - public class ColorImage : Image - { - public static BindableProperty ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(ColorImage), default(Color)); - - public Color Color - { - get => (Color)GetValue(ColorProperty); - set => SetValue(ColorProperty, value); - } - } -} diff --git a/BrickController2/BrickController2/UI/Controls/ColorImage.xaml b/BrickController2/BrickController2/UI/Controls/ColorImage.xaml new file mode 100644 index 000000000..f0be27e08 --- /dev/null +++ b/BrickController2/BrickController2/UI/Controls/ColorImage.xaml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/BrickController2/BrickController2/UI/Controls/ColorImage.xaml.cs b/BrickController2/BrickController2/UI/Controls/ColorImage.xaml.cs new file mode 100644 index 000000000..0e7776d64 --- /dev/null +++ b/BrickController2/BrickController2/UI/Controls/ColorImage.xaml.cs @@ -0,0 +1,42 @@ +namespace BrickController2.UI.Controls +{ + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class ColorImage : Image + { + public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(string), typeof(ColorImage), null, BindingMode.OneWay, null, IconChanged); + public static readonly BindableProperty ColorProperty = BindableProperty.Create(nameof(Color), typeof(Color), typeof(ColorImage), default(Color), BindingMode.OneWay, null, ColorChanged); + + public ColorImage() + { + InitializeComponent(); + } + + public string Icon + { + get => (string)GetValue(IconProperty); + set => SetValue(IconProperty, value); + } + + public Color Color + { + get => (Color)GetValue(ColorProperty); + set => SetValue(ColorProperty, value); + } + + private static void IconChanged(BindableObject bindable, object oldValue, object newValue) + { + if (bindable is ColorImage image && newValue is string iconName) + { + image.ImageSource.Glyph = iconName; + } + } + + private static void ColorChanged(BindableObject bindable, object oldValue, object newValue) + { + if (bindable is ColorImage image && newValue is Color color) + { + image.ImageSource.Color = color; + } + } + } +} diff --git a/BrickController2/BrickController2/UI/Controls/FloatingActionButton.xaml b/BrickController2/BrickController2/UI/Controls/FloatingActionButton.xaml index ba56f21e4..13f088d31 100644 --- a/BrickController2/BrickController2/UI/Controls/FloatingActionButton.xaml +++ b/BrickController2/BrickController2/UI/Controls/FloatingActionButton.xaml @@ -1,16 +1,10 @@  - - - - - - - - - - - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/BrickController2/BrickController2/UI/Controls/FloatingActionButton.xaml.cs b/BrickController2/BrickController2/UI/Controls/FloatingActionButton.xaml.cs index f6264f99d..d6f4c6fcc 100644 --- a/BrickController2/BrickController2/UI/Controls/FloatingActionButton.xaml.cs +++ b/BrickController2/BrickController2/UI/Controls/FloatingActionButton.xaml.cs @@ -3,28 +3,20 @@ namespace BrickController2.UI.Controls { [XamlCompilation(XamlCompilationOptions.Compile)] - public partial class FloatingActionButton : ContentView + public partial class FloatingActionButton : ImageButton { public FloatingActionButton() { InitializeComponent(); } - public static readonly BindableProperty ButtonColorProperty = BindableProperty.Create(nameof(ButtonColor), typeof(Color), typeof(FloatingActionButton), default(Color), BindingMode.OneWay, null, ButtonColorChanged); - public static readonly BindableProperty ImageSourceProperty = BindableProperty.Create(nameof(ImageSource), typeof(ImageSource), typeof(FloatingActionButton), null, BindingMode.OneWay, null, ImageSourceChanged); + public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(string), typeof(FloatingActionButton), null, BindingMode.OneWay, null, IconChanged); public static readonly BindableProperty ImageColorProperty = BindableProperty.Create(nameof(ImageColor), typeof(Color), typeof(FloatingActionButton), null, BindingMode.OneWay, null, ImageColorChanged); - public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(FloatingActionButton), null, BindingMode.OneWay, null, CommandChanged); - public Color ButtonColor + public string Icon { - get => (Color)GetValue(ButtonColorProperty); - set => SetValue(ButtonColorProperty, value); - } - - public ImageSource ImageSource - { - get => (ImageSource)GetValue(ImageSourceProperty); - set => SetValue(ImageSourceProperty, value); + get => (string)GetValue(IconProperty); + set => SetValue(IconProperty, value); } public Color ImageColor @@ -33,25 +25,11 @@ public Color ImageColor set => SetValue(ImageColorProperty, value); } - public ICommand Command - { - get => (ICommand)GetValue(CommandProperty); - set => SetValue(CommandProperty, value); - } - - private static void ButtonColorChanged(BindableObject bindable, object oldValue, object newValue) - { - if (bindable is FloatingActionButton fab && newValue is Color backgroundColor) - { - fab.ImageFrame.BackgroundColor = backgroundColor; - } - } - - private static void ImageSourceChanged(BindableObject bindable, object oldValue, object newValue) + private static void IconChanged(BindableObject bindable, object oldValue, object newValue) { - if (bindable is FloatingActionButton fab && newValue is ImageSource imageSource) + if (bindable is FloatingActionButton fab && newValue is string iconName) { - fab.Image.Source = imageSource; + fab.ImageSource.Glyph = iconName; } } @@ -59,15 +37,7 @@ private static void ImageColorChanged(BindableObject bindable, object oldValue, { if (bindable is FloatingActionButton fab && newValue is Color imageColor) { - fab.Image.Color = imageColor; - } - } - - private static void CommandChanged(BindableObject bindable, object oldValue, object newValue) - { - if (bindable is FloatingActionButton fab && newValue is ICommand command) - { - fab.TapGuestureRecognizer.Command = command; + fab.ImageSource.Color = imageColor; } } } diff --git a/BrickController2/BrickController2/UI/Controls/ImageButton.xaml b/BrickController2/BrickController2/UI/Controls/ImageButton.xaml deleted file mode 100644 index 38bc6570e..000000000 --- a/BrickController2/BrickController2/UI/Controls/ImageButton.xaml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/BrickController2/BrickController2/UI/Controls/ImageButton.xaml.cs b/BrickController2/BrickController2/UI/Controls/ImageButton.xaml.cs deleted file mode 100644 index e13dd81df..000000000 --- a/BrickController2/BrickController2/UI/Controls/ImageButton.xaml.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.Windows.Input; - -namespace BrickController2.UI.Controls -{ - [XamlCompilation(XamlCompilationOptions.Compile)] - public partial class ImageButton : ContentView - { - public ImageButton() - { - InitializeComponent(); - } - - public static readonly BindableProperty ImageSourceProperty = BindableProperty.Create(nameof(ImageSource), typeof(ImageSource), typeof(ImageButton), null, BindingMode.OneWay, null, ImageSourceChanged); - public static readonly BindableProperty ImageColorProperty = BindableProperty.Create(nameof(ImageColor), typeof(Color), typeof(ImageButton), default(Color), BindingMode.OneWay, null, ImageColorChanged); - public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(ImageButton), null, BindingMode.OneWay, null, CommandChanged); - public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create(nameof(Command), typeof(object), typeof(ImageButton), null, BindingMode.OneWay, null, CommandParameterChanged); - - public ImageSource ImageSource - { - get => (ImageSource)GetValue(ImageSourceProperty); - set => SetValue(ImageSourceProperty, value); - } - - public Color ImageColor - { - get => (Color)GetValue(ImageColorProperty); - set => SetValue(ImageColorProperty, value); - } - - public ICommand Command - { - get => (ICommand)GetValue(CommandProperty); - set => SetValue(CommandProperty, value); - } - - public object CommandParameter - { - get => GetValue(CommandParameterProperty); - set => SetValue(CommandParameterProperty, value); - } - - private static void ImageSourceChanged(BindableObject bindable, object oldValue, object newValue) - { - if (bindable is ImageButton imageButton && newValue is ImageSource imageSource) - { - imageButton.Image.Source = imageSource; - } - } - - private static void ImageColorChanged(BindableObject bindable, object oldValue, object newValue) - { - if (bindable is ImageButton imageButton && newValue is Color color) - { - imageButton.Image.Color = color; - } - } - - private static void CommandChanged(BindableObject bindable, object oldValue, object newValue) - { - if (bindable is ImageButton imageButton && newValue is ICommand command) - { - imageButton.TapGuestureRecognizer.Command = command; - } - } - - private static void CommandParameterChanged(BindableObject bindable, object oldValue, object newValue) - { - if (bindable is ImageButton imageButton) - { - imageButton.TapGuestureRecognizer.CommandParameter = newValue; - } - } - } -} \ No newline at end of file diff --git a/BrickController2/BrickController2/UI/Controls/SwipeIcon.xaml b/BrickController2/BrickController2/UI/Controls/SwipeIcon.xaml new file mode 100644 index 000000000..26596157e --- /dev/null +++ b/BrickController2/BrickController2/UI/Controls/SwipeIcon.xaml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/BrickController2/BrickController2/UI/Controls/SwipeIcon.xaml.cs b/BrickController2/BrickController2/UI/Controls/SwipeIcon.xaml.cs new file mode 100644 index 000000000..938826805 --- /dev/null +++ b/BrickController2/BrickController2/UI/Controls/SwipeIcon.xaml.cs @@ -0,0 +1,26 @@ +namespace BrickController2.UI.Controls; + +[XamlCompilation(XamlCompilationOptions.Compile)] +public partial class SwipeIcon : SwipeItem +{ + public SwipeIcon() + { + InitializeComponent(); + } + + public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(string), typeof(SwipeIcon), null, BindingMode.OneWay, null, IconChanged); + + public string Icon + { + get => (string)GetValue(IconProperty); + set => SetValue(IconProperty, value); + } + + private static void IconChanged(BindableObject bindable, object oldValue, object newValue) + { + if (bindable is SwipeIcon icon && newValue is string iconName) + { + icon.ImageSource.Glyph = iconName; + } + } +} \ No newline at end of file diff --git a/BrickController2/BrickController2/UI/Controls/ToolbarIcon.xaml b/BrickController2/BrickController2/UI/Controls/ToolbarIcon.xaml new file mode 100644 index 000000000..ffac3f533 --- /dev/null +++ b/BrickController2/BrickController2/UI/Controls/ToolbarIcon.xaml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/BrickController2/BrickController2/UI/Controls/ToolbarIcon.xaml.cs b/BrickController2/BrickController2/UI/Controls/ToolbarIcon.xaml.cs new file mode 100644 index 000000000..61f807cd4 --- /dev/null +++ b/BrickController2/BrickController2/UI/Controls/ToolbarIcon.xaml.cs @@ -0,0 +1,26 @@ +namespace BrickController2.UI.Controls; + +[XamlCompilation(XamlCompilationOptions.Compile)] +public partial class ToolbarIcon : ToolbarItem +{ + public ToolbarIcon() + { + InitializeComponent(); + } + + public static readonly BindableProperty IconProperty = BindableProperty.Create(nameof(Icon), typeof(string), typeof(ToolbarIcon), null, BindingMode.OneWay, null, IconChanged); + + public string Icon + { + get => (string)GetValue(IconProperty); + set => SetValue(IconProperty, value); + } + + private static void IconChanged(BindableObject bindable, object oldValue, object newValue) + { + if (bindable is ToolbarIcon toolbarIcon && newValue is string iconName) + { + toolbarIcon.ImageSource.Glyph = iconName; + } + } +} \ No newline at end of file diff --git a/BrickController2/BrickController2/UI/Converters/GameControllerEventTypeToImageConverter.cs b/BrickController2/BrickController2/UI/Converters/GameControllerEventTypeToImageConverter.cs index 63a1df344..a5adb7e76 100644 --- a/BrickController2/BrickController2/UI/Converters/GameControllerEventTypeToImageConverter.cs +++ b/BrickController2/BrickController2/UI/Converters/GameControllerEventTypeToImageConverter.cs @@ -1,5 +1,4 @@ using BrickController2.PlatformServices.GameController; -using BrickController2.Helpers; using System.Globalization; namespace BrickController2.UI.Converters @@ -12,19 +11,14 @@ public object Convert(object value, Type targetType, object parameter, CultureIn return Convert(eventType); } - public ImageSource Convert(GameControllerEventType eventType) + public string Convert(GameControllerEventType eventType) { - switch (eventType) + return eventType switch { - case GameControllerEventType.Button: - return ResourceHelper.GetImageResource("ic_buttons.png"); - - case GameControllerEventType.Axis: - return ResourceHelper.GetImageResource("ic_joystick.png"); - - default: - return null; - } + GameControllerEventType.Button => "abc", + GameControllerEventType.Axis => "gamepad", + _ => null, + }; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/BrickController2/BrickController2/UI/Images/ic_add.png b/BrickController2/BrickController2/UI/Images/ic_add.png deleted file mode 100644 index d4adc7b88..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_add.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_back.png b/BrickController2/BrickController2/UI/Images/ic_back.png deleted file mode 100644 index 9eed3fb29..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_back.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_buttons.png b/BrickController2/BrickController2/UI/Images/ic_buttons.png deleted file mode 100644 index 1f6ec02ee..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_buttons.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_checkmark.png b/BrickController2/BrickController2/UI/Images/ic_checkmark.png deleted file mode 100644 index 5be2eced7..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_checkmark.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_checkmark_filled.png b/BrickController2/BrickController2/UI/Images/ic_checkmark_filled.png deleted file mode 100644 index 9a314dfaf..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_checkmark_filled.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_circle.png b/BrickController2/BrickController2/UI/Images/ic_circle.png deleted file mode 100644 index b88b5909c..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_circle.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_console.png b/BrickController2/BrickController2/UI/Images/ic_console.png deleted file mode 100644 index 9e4358900..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_console.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_delete.png b/BrickController2/BrickController2/UI/Images/ic_delete.png deleted file mode 100644 index d581fa527..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_delete.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_edit.png b/BrickController2/BrickController2/UI/Images/ic_edit.png deleted file mode 100644 index 61a9ccce7..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_edit.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_exclamation_mark.png b/BrickController2/BrickController2/UI/Images/ic_exclamation_mark.png deleted file mode 100644 index a5dfca11e..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_exclamation_mark.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_export.png b/BrickController2/BrickController2/UI/Images/ic_export.png deleted file mode 100644 index 2a53394ba..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_export.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_import.png b/BrickController2/BrickController2/UI/Images/ic_import.png deleted file mode 100644 index ff0bfc665..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_import.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_info.png b/BrickController2/BrickController2/UI/Images/ic_info.png deleted file mode 100644 index 2a3800268..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_info.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_joystick.png b/BrickController2/BrickController2/UI/Images/ic_joystick.png deleted file mode 100644 index ceda964a5..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_joystick.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_link.png b/BrickController2/BrickController2/UI/Images/ic_link.png deleted file mode 100644 index c6ea2e8b3..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_link.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_menu.png b/BrickController2/BrickController2/UI/Images/ic_menu.png deleted file mode 100644 index ed110746b..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_menu.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_play.png b/BrickController2/BrickController2/UI/Images/ic_play.png deleted file mode 100644 index d936ff6e7..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_play.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_search.png b/BrickController2/BrickController2/UI/Images/ic_search.png deleted file mode 100644 index 25cd5f11f..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_search.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_sequence.png b/BrickController2/BrickController2/UI/Images/ic_sequence.png deleted file mode 100644 index dfa9bba83..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_sequence.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Images/ic_settings.png b/BrickController2/BrickController2/UI/Images/ic_settings.png deleted file mode 100644 index 1b1408645..000000000 Binary files a/BrickController2/BrickController2/UI/Images/ic_settings.png and /dev/null differ diff --git a/BrickController2/BrickController2/UI/Pages/AboutPage.xaml b/BrickController2/BrickController2/UI/Pages/AboutPage.xaml index 2b0060167..8c31d3355 100644 --- a/BrickController2/BrickController2/UI/Pages/AboutPage.xaml +++ b/BrickController2/BrickController2/UI/Pages/AboutPage.xaml @@ -11,12 +11,6 @@ ios:Page.UseSafeArea="True" BackgroundColor="{DynamicResource PageBackgroundColor}"> - - - - - @@ -46,7 +40,7 @@