From d14c47abf82d8c3fac384e24fabec2199be5ebdf Mon Sep 17 00:00:00 2001 From: Paul-Winpenny <92634321+Paul-Winpenny@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:12:42 +0000 Subject: [PATCH] Android build + info button works --- .../Android/Resources/values/colors.xml | 4 ++-- .../ViewModels/ConnectionPageViewModel.cs | 4 +++- .../ViewModels/MainPageViewModel.cs | 19 ++++++++++++++++--- App/RobobinApp/Views/ConnectionPage.xaml | 1 - App/RobobinApp/Views/MainPage.xaml | 2 +- App/RobobinApp/Views/MainPage_Android.xaml | 2 +- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/App/RobobinApp/Platforms/Android/Resources/values/colors.xml b/App/RobobinApp/Platforms/Android/Resources/values/colors.xml index 5cd16049..2f85cd76 100644 --- a/App/RobobinApp/Platforms/Android/Resources/values/colors.xml +++ b/App/RobobinApp/Platforms/Android/Resources/values/colors.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">#512BD4</color> - <color name="colorPrimaryDark">#2B0B98</color> - <color name="colorAccent">#2B0B98</color> + <color name="colorPrimaryDark">#FFFFFF</color> + <color name="colorAccent">#FFFFFF</color> </resources> \ No newline at end of file diff --git a/App/RobobinApp/ViewModels/ConnectionPageViewModel.cs b/App/RobobinApp/ViewModels/ConnectionPageViewModel.cs index 97e98a2b..6717948f 100644 --- a/App/RobobinApp/ViewModels/ConnectionPageViewModel.cs +++ b/App/RobobinApp/ViewModels/ConnectionPageViewModel.cs @@ -32,6 +32,7 @@ namespace RobobinApp.ViewModels private BluetoothDevice _selectedDevice; private IDevice _connectedDevice; public ICommand GoHomeCommand { get; } + public ICommand GoToHelpPage { get; } public ObservableCollection<BluetoothDevice> BluetoothDevices { get; } public ObservableCollection<WifiNetwork> WifiNetworks { get; } @@ -141,6 +142,7 @@ namespace RobobinApp.ViewModels DisconnectCommand = new Command(OnDisconnect); GoHomeCommand = new Command(async () => await OnGoHome()); ConnectCommand = new Command(OnToggleConnection); + TestReadOperation = new Command(async () => await ReadOperationAsync()); SendWifiInfoCommand = new Command(OnSendWifiInfo); @@ -153,7 +155,7 @@ namespace RobobinApp.ViewModels Debug.WriteLine("Checking and requesting Bluetooth permissions."); CheckAndRequestBluetoothPermissions(); } - + private async void OnSendWifiInfo(object obj) { try diff --git a/App/RobobinApp/ViewModels/MainPageViewModel.cs b/App/RobobinApp/ViewModels/MainPageViewModel.cs index da7f2073..7bccfcb6 100644 --- a/App/RobobinApp/ViewModels/MainPageViewModel.cs +++ b/App/RobobinApp/ViewModels/MainPageViewModel.cs @@ -1,5 +1,6 @@ using System.Collections.ObjectModel; using System.ComponentModel; +using System.Diagnostics; using System.Runtime.CompilerServices; using System.Windows.Input; using Microsoft.Extensions.Logging; @@ -17,10 +18,11 @@ namespace RobobinApp.ViewModels private bool _isBusy; private string _statusMessage; + public ICommand GoToHelpPage { get; } + + + - - - public ICommand ConnectToRobobinCommand { get; } private Graph _selectedGraph; @@ -39,9 +41,11 @@ namespace RobobinApp.ViewModels public MainPageViewModel() { + GoToHelpPage = new Command(OnHelpPageAccess); ConnectToRobobinCommand = new Command(async () => await OnConnectToRobobin()); SelectGraphCommand = new Command<int>(OnSelectGraph); var graphNodes1 = new List<Node> + { new Node("A", 50, 50), new Node("B", 150, 50), @@ -161,6 +165,15 @@ namespace RobobinApp.ViewModels return polarMatrix; } + private async void OnHelpPageAccess() + { + Debug.WriteLine("Navigating to help page."); + + + var helpPageUrl = "https://butternut-pint-1dd.notion.site/RoboBin-Help-Page-1367bb78dcfd80a49052e41ba17511f1?pvs=74"; + + await Launcher.OpenAsync(new Uri(helpPageUrl)); + } public bool IsBusy { get => _isBusy; diff --git a/App/RobobinApp/Views/ConnectionPage.xaml b/App/RobobinApp/Views/ConnectionPage.xaml index b690ba31..d3856956 100644 --- a/App/RobobinApp/Views/ConnectionPage.xaml +++ b/App/RobobinApp/Views/ConnectionPage.xaml @@ -39,7 +39,6 @@ <Button Text="{Binding ConnectButtonText}" Command="{Binding ConnectCommand}" - IsEnabled="{Binding SelectedDevice, Converter={StaticResource NullToBooleanConverter}}" StyleClass="button-primary" HorizontalOptions="Center" /> </StackLayout> diff --git a/App/RobobinApp/Views/MainPage.xaml b/App/RobobinApp/Views/MainPage.xaml index 6dfef3e9..7f8086d5 100644 --- a/App/RobobinApp/Views/MainPage.xaml +++ b/App/RobobinApp/Views/MainPage.xaml @@ -59,7 +59,7 @@ VerticalOptions="FillAndExpand" Grid.Column="2" Grid.Row="0"> <HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End"> - <Button Text="Info" /> + <Button Text="Info" Command="{Binding GoToHelpPage}"/> <Picker Title="Select Graph" ItemsSource="{Binding GraphNames}" SelectedIndexChanged="OnGraphSelected" diff --git a/App/RobobinApp/Views/MainPage_Android.xaml b/App/RobobinApp/Views/MainPage_Android.xaml index 09ba3e2d..153fb312 100644 --- a/App/RobobinApp/Views/MainPage_Android.xaml +++ b/App/RobobinApp/Views/MainPage_Android.xaml @@ -29,7 +29,7 @@ <HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End"> <Button Text="Admin" Command="{Binding ConnectToRobobinCommand}"/> <Button Text="Setup" Command="{Binding ConnectToRobobinCommand}"/> - <Button Text="Info" /> + <Button Text="Info" Command= "{Binding GoToHelpPage}"/> <Picker Title="Select Graph" ItemsSource="{Binding GraphNames}" SelectedIndexChanged="OnGraphSelected" -- GitLab