Skip to content
Snippets Groups Projects
Commit d14c47ab authored by Paul-Winpenny's avatar Paul-Winpenny
Browse files

Android build + info button works

parent 44163e9b
No related branches found
No related tags found
Loading
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">#512BD4</color> <color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color> <color name="colorPrimaryDark">#FFFFFF</color>
<color name="colorAccent">#2B0B98</color> <color name="colorAccent">#FFFFFF</color>
</resources> </resources>
\ No newline at end of file
...@@ -32,6 +32,7 @@ namespace RobobinApp.ViewModels ...@@ -32,6 +32,7 @@ namespace RobobinApp.ViewModels
private BluetoothDevice _selectedDevice; private BluetoothDevice _selectedDevice;
private IDevice _connectedDevice; private IDevice _connectedDevice;
public ICommand GoHomeCommand { get; } public ICommand GoHomeCommand { get; }
public ICommand GoToHelpPage { get; }
public ObservableCollection<BluetoothDevice> BluetoothDevices { get; } public ObservableCollection<BluetoothDevice> BluetoothDevices { get; }
public ObservableCollection<WifiNetwork> WifiNetworks { get; } public ObservableCollection<WifiNetwork> WifiNetworks { get; }
...@@ -141,6 +142,7 @@ namespace RobobinApp.ViewModels ...@@ -141,6 +142,7 @@ namespace RobobinApp.ViewModels
DisconnectCommand = new Command(OnDisconnect); DisconnectCommand = new Command(OnDisconnect);
GoHomeCommand = new Command(async () => await OnGoHome()); GoHomeCommand = new Command(async () => await OnGoHome());
ConnectCommand = new Command(OnToggleConnection); ConnectCommand = new Command(OnToggleConnection);
TestReadOperation = new Command(async () => await ReadOperationAsync()); TestReadOperation = new Command(async () => await ReadOperationAsync());
SendWifiInfoCommand = new Command(OnSendWifiInfo); SendWifiInfoCommand = new Command(OnSendWifiInfo);
...@@ -153,7 +155,7 @@ namespace RobobinApp.ViewModels ...@@ -153,7 +155,7 @@ namespace RobobinApp.ViewModels
Debug.WriteLine("Checking and requesting Bluetooth permissions."); Debug.WriteLine("Checking and requesting Bluetooth permissions.");
CheckAndRequestBluetoothPermissions(); CheckAndRequestBluetoothPermissions();
} }
private async void OnSendWifiInfo(object obj) private async void OnSendWifiInfo(object obj)
{ {
try try
......
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Windows.Input; using System.Windows.Input;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
...@@ -17,10 +18,11 @@ namespace RobobinApp.ViewModels ...@@ -17,10 +18,11 @@ namespace RobobinApp.ViewModels
private bool _isBusy; private bool _isBusy;
private string _statusMessage; private string _statusMessage;
public ICommand GoToHelpPage { get; }
public ICommand ConnectToRobobinCommand { get; } public ICommand ConnectToRobobinCommand { get; }
private Graph _selectedGraph; private Graph _selectedGraph;
...@@ -39,9 +41,11 @@ namespace RobobinApp.ViewModels ...@@ -39,9 +41,11 @@ namespace RobobinApp.ViewModels
public MainPageViewModel() public MainPageViewModel()
{ {
GoToHelpPage = new Command(OnHelpPageAccess);
ConnectToRobobinCommand = new Command(async () => await OnConnectToRobobin()); ConnectToRobobinCommand = new Command(async () => await OnConnectToRobobin());
SelectGraphCommand = new Command<int>(OnSelectGraph); SelectGraphCommand = new Command<int>(OnSelectGraph);
var graphNodes1 = new List<Node> var graphNodes1 = new List<Node>
{ {
new Node("A", 50, 50), new Node("A", 50, 50),
new Node("B", 150, 50), new Node("B", 150, 50),
...@@ -161,6 +165,15 @@ namespace RobobinApp.ViewModels ...@@ -161,6 +165,15 @@ namespace RobobinApp.ViewModels
return polarMatrix; 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 public bool IsBusy
{ {
get => _isBusy; get => _isBusy;
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
<Button Text="{Binding ConnectButtonText}" <Button Text="{Binding ConnectButtonText}"
Command="{Binding ConnectCommand}" Command="{Binding ConnectCommand}"
IsEnabled="{Binding SelectedDevice, Converter={StaticResource NullToBooleanConverter}}"
StyleClass="button-primary" StyleClass="button-primary"
HorizontalOptions="Center" /> HorizontalOptions="Center" />
</StackLayout> </StackLayout>
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
VerticalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
Grid.Column="2" Grid.Row="0"> Grid.Column="2" Grid.Row="0">
<HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End"> <HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End">
<Button Text="Info" /> <Button Text="Info" Command="{Binding GoToHelpPage}"/>
<Picker Title="Select Graph" <Picker Title="Select Graph"
ItemsSource="{Binding GraphNames}" ItemsSource="{Binding GraphNames}"
SelectedIndexChanged="OnGraphSelected" SelectedIndexChanged="OnGraphSelected"
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End"> <HorizontalStackLayout HorizontalOptions="Start" VerticalOptions="End">
<Button Text="Admin" Command="{Binding ConnectToRobobinCommand}"/> <Button Text="Admin" Command="{Binding ConnectToRobobinCommand}"/>
<Button Text="Setup" Command="{Binding ConnectToRobobinCommand}"/> <Button Text="Setup" Command="{Binding ConnectToRobobinCommand}"/>
<Button Text="Info" /> <Button Text="Info" Command= "{Binding GoToHelpPage}"/>
<Picker Title="Select Graph" <Picker Title="Select Graph"
ItemsSource="{Binding GraphNames}" ItemsSource="{Binding GraphNames}"
SelectedIndexChanged="OnGraphSelected" SelectedIndexChanged="OnGraphSelected"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment