mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-10 09:53:53 +00:00
Begin UI Redesign, switch to icon font
This commit is contained in:
Executable
BIN
Binary file not shown.
@@ -198,6 +198,9 @@
|
||||
<Name>qController</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidAsset Include="Assets\qfont.ttf" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
<Import Project="..\packages\Xamarin.Forms.3.6.0.293080\build\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.6.0.293080\build\Xamarin.Forms.targets')" />
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"images": [
|
||||
{
|
||||
"idiom": "universal"
|
||||
},
|
||||
{
|
||||
"filename": "hamburger@2x-1.png",
|
||||
"scale": "1x",
|
||||
"idiom": "universal"
|
||||
},
|
||||
{
|
||||
"filename": "hamburger@2x.png",
|
||||
"scale": "2x",
|
||||
"idiom": "universal"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"idiom": "universal"
|
||||
},
|
||||
{
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"subtype": "retina4",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"screenWidth": "{130,145}",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"screenWidth": "{146,165}",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"idiom": "car"
|
||||
},
|
||||
{
|
||||
"scale": "2x",
|
||||
"idiom": "car"
|
||||
},
|
||||
{
|
||||
"scale": "3x",
|
||||
"idiom": "car"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
+5
-1
@@ -36,10 +36,14 @@
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0.2</string>
|
||||
<string>2.0.3</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>UIAppFonts</key>
|
||||
<array>
|
||||
<string>qfont.ttf</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Executable
BIN
Binary file not shown.
@@ -166,6 +166,9 @@
|
||||
<ImageAsset Include="Assets.xcassets\back.imageset\Contents.json" />
|
||||
<ImageAsset Include="Assets.xcassets\back.imageset\back.png" />
|
||||
<ImageAsset Include="Assets.xcassets\back.imageset\back%402x.png" />
|
||||
<ImageAsset Include="Assets.xcassets\hamburger.imageset\Contents.json" />
|
||||
<ImageAsset Include="Assets.xcassets\hamburger.imageset\hamburger%402x.png" />
|
||||
<ImageAsset Include="Assets.xcassets\hamburger.imageset\hamburger%402x-1.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
@@ -174,6 +177,7 @@
|
||||
<Folder Include="Assets.xcassets\add.imageset\" />
|
||||
<Folder Include="Assets.xcassets\scan.imageset\" />
|
||||
<Folder Include="Assets.xcassets\back.imageset\" />
|
||||
<Folder Include="Assets.xcassets\hamburger.imageset\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="LaunchScreen.storyboard" />
|
||||
@@ -193,6 +197,9 @@
|
||||
<Name>qController</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\qfont.ttf" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
<Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
|
||||
<Import Project="..\packages\Xamarin.Forms.3.6.0.293080\build\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.3.6.0.293080\build\Xamarin.Forms.targets')" />
|
||||
|
||||
Vendored
BIN
Binary file not shown.
@@ -1,6 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Application xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.App">
|
||||
<Application.Resources>
|
||||
<!-- Application resource dictionary -->
|
||||
<OnPlatform x:Key="qfont" x:TypeArguments="x:String">
|
||||
<On Platform="Android" Value="qfont.otf#qfont" />
|
||||
<On Platform="iOS" Value="qfont" />
|
||||
</OnPlatform>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@@ -5,12 +5,34 @@ namespace qController
|
||||
public partial class App : Application
|
||||
{
|
||||
public static INavigation iNav;
|
||||
public static NavigationPage NavigationPage { get; private set; }
|
||||
public static RootPage rootPage;
|
||||
|
||||
public static bool MenuIsPresented
|
||||
{
|
||||
get
|
||||
{
|
||||
return rootPage.IsPresented;
|
||||
}
|
||||
set
|
||||
{
|
||||
rootPage.IsPresented = value;
|
||||
}
|
||||
}
|
||||
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
MainPage = new NavigationPage(new qControllerPage());
|
||||
iNav = MainPage.Navigation;
|
||||
/*MainPage = new NavigationPage(new QConnectionPage());
|
||||
iNav = MainPage.Navigation;*/
|
||||
var menuPage = new MenuPage();
|
||||
rootPage = new RootPage();
|
||||
NavigationPage = new NavigationPage(new QConnectionPage());
|
||||
rootPage.Master = menuPage;
|
||||
rootPage.Detail = NavigationPage;
|
||||
MainPage = rootPage;
|
||||
rootPage.Init();
|
||||
}
|
||||
|
||||
protected override void OnStart()
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class QCueListView : Frame
|
||||
{
|
||||
ListView listView;
|
||||
public QCueListView()
|
||||
{
|
||||
Padding = new Thickness(5);
|
||||
CornerRadius = 20;
|
||||
BackgroundColor = Color.FromHex("D8D8D8");
|
||||
Grid mainG = new Grid
|
||||
{
|
||||
Padding = new Thickness(0),
|
||||
RowDefinitions =
|
||||
{
|
||||
new RowDefinition{Height = GridLength.Star}
|
||||
},
|
||||
ColumnDefinitions =
|
||||
{
|
||||
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)}
|
||||
}
|
||||
};
|
||||
listView = new ListView();
|
||||
mainG.Children.Add(listView, 0, 0);
|
||||
Margin = new Thickness(10);
|
||||
Content = mainG;
|
||||
}
|
||||
|
||||
public void UpdateWithWorkspace(QWorkSpace qWorkspace)
|
||||
{
|
||||
List<string> cueLists = new List<string>();
|
||||
foreach( var cueList in qWorkspace.data )
|
||||
{
|
||||
cueLists.Add(cueList.listName);
|
||||
foreach(var cue in cueList.cues)
|
||||
{
|
||||
if(cue.number == "")
|
||||
cueLists.Add("\t" + cue.listName);
|
||||
else
|
||||
cueLists.Add("\t" + cue.number + " - " + cue.listName);
|
||||
}
|
||||
}
|
||||
listView.ItemsSource = cueLists.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,16 +14,20 @@ namespace qController
|
||||
Image connectButton = new Image();
|
||||
Image deleteButton = new Image();
|
||||
|
||||
Label connectLabel = new Label();
|
||||
Label deleteLabel = new Label();
|
||||
|
||||
var connectTapGesture = new TapGestureRecognizer();
|
||||
var deleteTapGesture = new TapGestureRecognizer();
|
||||
|
||||
connectTapGesture.Tapped += Connect;
|
||||
connectButton.GestureRecognizers.Add(connectTapGesture);
|
||||
|
||||
connectLabel.GestureRecognizers.Add(connectTapGesture);
|
||||
|
||||
|
||||
deleteTapGesture.Tapped += Delete;
|
||||
deleteButton.GestureRecognizers.Add(deleteTapGesture);
|
||||
deleteLabel.GestureRecognizers.Add(deleteTapGesture);
|
||||
|
||||
InitItems();
|
||||
|
||||
@@ -50,10 +54,10 @@ namespace qController
|
||||
mainG.Children.Add(nameLabel, 1, 0);
|
||||
mainG.Children.Add(addressLabel,1,1);
|
||||
|
||||
mainG.Children.Add(connectButton,2,0);
|
||||
Grid.SetRowSpan(connectButton,2);
|
||||
mainG.Children.Add(deleteButton, 0, 0);
|
||||
Grid.SetRowSpan(deleteButton,2);
|
||||
mainG.Children.Add(connectLabel,2,0);
|
||||
Grid.SetRowSpan(connectLabel,2);
|
||||
mainG.Children.Add(deleteLabel, 0, 0);
|
||||
Grid.SetRowSpan(deleteLabel,2);
|
||||
|
||||
Frame f = new Frame
|
||||
{
|
||||
@@ -87,7 +91,32 @@ namespace qController
|
||||
addressLabel.HorizontalTextAlignment = TextAlignment.Center;
|
||||
addressLabel.VerticalTextAlignment = TextAlignment.Start;
|
||||
|
||||
connectLabel.HorizontalOptions = LayoutOptions.CenterAndExpand;
|
||||
connectLabel.VerticalOptions = LayoutOptions.CenterAndExpand;
|
||||
connectLabel.Text = "\uF1EB";
|
||||
connectLabel.FontSize = 40;
|
||||
connectLabel.TextColor = Color.LimeGreen;
|
||||
|
||||
deleteLabel.HorizontalOptions = LayoutOptions.CenterAndExpand;
|
||||
deleteLabel.VerticalOptions = LayoutOptions.CenterAndExpand;
|
||||
deleteLabel.Text = "\uE802";
|
||||
deleteLabel.FontSize = 40;
|
||||
deleteLabel.TextColor = Color.Red;
|
||||
|
||||
string qfont = "";
|
||||
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
qfont = "qfont";
|
||||
break;
|
||||
case Device.Android:
|
||||
qfont = "qfont.ttf#qfont";
|
||||
break;
|
||||
|
||||
}
|
||||
connectLabel.FontFamily = qfont;
|
||||
deleteLabel.FontFamily = qfont;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +130,7 @@ namespace qController
|
||||
|
||||
void Connect(object sender, EventArgs e)
|
||||
{
|
||||
App.iNav.PushModalAsync(new NavigationPage(new ControlPage(nameLabel.Text,addressLabel.Text)));
|
||||
App.NavigationPage.Navigation.PushModalAsync(new NavigationPage(new ControlPage(nameLabel.Text,addressLabel.Text)));
|
||||
|
||||
Console.WriteLine("Connect To " + nameLabel.Text + " Pressed");
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace qController
|
||||
Padding = new Thickness(0),
|
||||
RowDefinitions =
|
||||
{
|
||||
new RowDefinition{Height = GridLength.Auto},
|
||||
new RowDefinition{Height = GridLength.Auto}
|
||||
new RowDefinition{Height = GridLength.Star},
|
||||
new RowDefinition{Height = GridLength.Star}
|
||||
},
|
||||
ColumnDefinitions =
|
||||
{
|
||||
|
||||
@@ -40,9 +40,9 @@ namespace qController
|
||||
{
|
||||
Padding = new Thickness(0),
|
||||
RowDefinitions = {
|
||||
new RowDefinition{Height = GridLength.Auto},
|
||||
new RowDefinition{Height = GridLength.Auto},
|
||||
new RowDefinition{Height = GridLength.Auto}
|
||||
new RowDefinition{Height = GridLength.Star},
|
||||
new RowDefinition{Height = GridLength.Star},
|
||||
new RowDefinition{Height = GridLength.Star}
|
||||
},
|
||||
ColumnDefinitions = {
|
||||
new ColumnDefinition{Width = new GridLength(1,GridUnitType.Star)},
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace qController
|
||||
qClient.qParser.PlaybackPositionUpdated += this.OnPlaybackPositionUpdated;
|
||||
qClient.qParser.CueInfoUpdated += this.OnCueUpdateReceived;
|
||||
qClient.sendArgsUDP("/updates", 1);
|
||||
qClient.sendArgsUDP("/updates", 1);
|
||||
qClient.sendAndReceiveString("/cueLists");
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ namespace qController
|
||||
Label instanceName = new Label();
|
||||
QSelectedCueCell qCell;
|
||||
QSelectedCueOptionsCell qSelectedCueOptions;
|
||||
QCueListView qCueListView;
|
||||
Grid mainG;
|
||||
ListView listView;
|
||||
public ControlPage(string name, string address)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -44,8 +46,8 @@ namespace qController
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
backButton.Margin = new Thickness(20, 45, 20, 10);
|
||||
instanceName.Margin = new Thickness(20, 45, 20, 10);
|
||||
backButton.Margin = new Thickness(20, 35, 20, 10);
|
||||
instanceName.Margin = new Thickness(20, 35, 20, 10);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -119,6 +121,10 @@ namespace qController
|
||||
|
||||
sLayout.Children.Add(mainG);
|
||||
|
||||
qCueListView = new QCueListView();
|
||||
|
||||
//sLayout.Children.Add(qCueListView);
|
||||
|
||||
}
|
||||
|
||||
void sendOSC(object sender, EventArgs e)
|
||||
@@ -128,7 +134,7 @@ namespace qController
|
||||
|
||||
void Back(object sender, EventArgs e)
|
||||
{
|
||||
App.iNav.PopModalAsync();
|
||||
App.NavigationPage.Navigation.PopModalAsync();
|
||||
}
|
||||
|
||||
public void SelectedCueUpdated(object sender, CueEventArgs e){
|
||||
@@ -153,7 +159,7 @@ namespace qController
|
||||
{
|
||||
Device.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
//
|
||||
qCueListView.UpdateWithWorkspace(e.UpdatedWorkspace);
|
||||
});
|
||||
qController.qWorkspace = e.UpdatedWorkspace;
|
||||
Console.WriteLine("Workspace updated in ControlPage: " + qController.qWorkspace.workspace_id);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.HomePage">
|
||||
<ContentPage.Content>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public partial class HomePage : ContentPage
|
||||
{
|
||||
public HomePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class MasterPageItem
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string Icon { get; set; }
|
||||
public string Command { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.MenuPage">
|
||||
<ContentPage.Content>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public partial class MenuPage : ContentPage
|
||||
{
|
||||
public ListView ListView { get { return listView; } }
|
||||
ListView listView;
|
||||
|
||||
public MenuPage()
|
||||
{
|
||||
Title = "Menu";
|
||||
InitializeComponent();
|
||||
var items = new List<MasterPageItem>();
|
||||
items.Add(new MasterPageItem
|
||||
{
|
||||
Title = "Scan Network",
|
||||
Icon = "\uE800",
|
||||
Command = "scan"
|
||||
});
|
||||
items.Add(new MasterPageItem
|
||||
{
|
||||
Title = "Add Manually",
|
||||
Icon = "\uE801",
|
||||
Command = "add"
|
||||
});
|
||||
/*items.Add(new MasterPageItem
|
||||
{
|
||||
Title = "Open Link",
|
||||
Icon = "\uF0C9",
|
||||
Command = "open_link"
|
||||
});*/
|
||||
listView = new ListView
|
||||
{
|
||||
ItemsSource = items,
|
||||
ItemTemplate = new DataTemplate(() =>
|
||||
{
|
||||
var grid = new Grid { Padding = new Thickness(5, 10) };
|
||||
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(30) });
|
||||
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Star });
|
||||
|
||||
string qfont = "";
|
||||
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
qfont = "qfont";
|
||||
break;
|
||||
case Device.Android:
|
||||
qfont = "qfont.ttf#qfont";
|
||||
break;
|
||||
|
||||
}
|
||||
var icon = new Label();
|
||||
|
||||
icon.FontFamily = qfont as string;
|
||||
icon.SetBinding(Label.TextProperty, "Icon");
|
||||
icon.HorizontalTextAlignment = TextAlignment.Center;
|
||||
icon.VerticalTextAlignment = TextAlignment.Center;
|
||||
icon.FontSize = 20;
|
||||
var label = new Label { VerticalOptions = LayoutOptions.FillAndExpand };
|
||||
label.SetBinding(Label.TextProperty, "Title");
|
||||
|
||||
grid.Children.Add(icon);
|
||||
grid.Children.Add(label, 1, 0);
|
||||
return new ViewCell { View = grid };
|
||||
}),
|
||||
SeparatorVisibility = SeparatorVisibility.None
|
||||
};
|
||||
Content = new StackLayout
|
||||
{
|
||||
Children = { listView }
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.RootPage" xmlns:pages="clr-namespace:qController">
|
||||
|
||||
</MasterDetailPage>
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class MenuEventArgs : EventArgs
|
||||
{
|
||||
public string Command
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class RootPage : MasterDetailPage
|
||||
{
|
||||
MenuPage MenuPage;
|
||||
public delegate void MenuItemSelectedHandler(object source, MenuEventArgs args);
|
||||
public event MenuItemSelectedHandler MenuItemSelected;
|
||||
|
||||
public RootPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
MenuPage = (MenuPage)Master;
|
||||
|
||||
MenuPage.ListView.ItemSelected += OnItemSelected;
|
||||
}
|
||||
|
||||
void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
|
||||
{
|
||||
var item = e.SelectedItem as MasterPageItem;
|
||||
if (item != null)
|
||||
{
|
||||
MenuPage.ListView.SelectedItem = null;
|
||||
IsPresented = false;
|
||||
if (MenuItemSelected != null)
|
||||
MenuItemSelected(this, new MenuEventArgs { Command = item.Command });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.Pages.RootPageDetail" Title="Detail">
|
||||
<StackLayout Padding="10">
|
||||
<Label Text="This is a detail page. To get the 'triple' line icon on each platform add a icon to each platform and update the 'Master' page with an Icon that references it." />
|
||||
</StackLayout>
|
||||
</ContentPage>
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace qController.Pages
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class RootPageDetail : ContentPage
|
||||
{
|
||||
public RootPageDetail()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="qController.Pages.RootPageMaster" Title="Master">
|
||||
<StackLayout>
|
||||
<ListView x:Name="MenuItemsListView" SeparatorVisibility="None" HasUnevenRows="true" ItemsSource="{Binding MenuItems}">
|
||||
<ListView.Header>
|
||||
<Grid BackgroundColor="#03A9F4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="80" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="10" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Column="1" Grid.Row="2" Text="AppName" Style="{DynamicResource SubtitleStyle}" />
|
||||
</Grid>
|
||||
</ListView.Header>
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<StackLayout Padding="15,10" HorizontalOptions="FillAndExpand">
|
||||
<Label VerticalOptions="FillAndExpand" VerticalTextAlignment="Center" Text="{Binding Title}" FontSize="24" />
|
||||
</StackLayout>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</StackLayout>
|
||||
</ContentPage>
|
||||
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace qController.Pages
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class RootPageMaster : ContentPage
|
||||
{
|
||||
public ListView ListView;
|
||||
|
||||
public RootPageMaster()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = new RootPageMasterViewModel();
|
||||
ListView = MenuItemsListView;
|
||||
}
|
||||
|
||||
class RootPageMasterViewModel : INotifyPropertyChanged
|
||||
{
|
||||
public ObservableCollection<RootPageMenuItem> MenuItems { get; set; }
|
||||
|
||||
public RootPageMasterViewModel()
|
||||
{
|
||||
MenuItems = new ObservableCollection<RootPageMenuItem>(new[]
|
||||
{
|
||||
new RootPageMenuItem { Id = 0, Title = "Page 1" },
|
||||
new RootPageMenuItem { Id = 1, Title = "Page 2" },
|
||||
new RootPageMenuItem { Id = 2, Title = "Page 3" },
|
||||
new RootPageMenuItem { Id = 3, Title = "Page 4" },
|
||||
new RootPageMenuItem { Id = 4, Title = "Page 5" },
|
||||
});
|
||||
}
|
||||
|
||||
#region INotifyPropertyChanged Implementation
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
void OnPropertyChanged([CallerMemberName] string propertyName = "")
|
||||
{
|
||||
if (PropertyChanged == null)
|
||||
return;
|
||||
|
||||
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace qController.Pages
|
||||
{
|
||||
public class RootPageMenuItem
|
||||
{
|
||||
public RootPageMenuItem()
|
||||
{
|
||||
TargetType = typeof(RootPageDetail);
|
||||
}
|
||||
public int Id { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
public Type TargetType { get; set; }
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:qController" x:Class="qController.qControllerPage">
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:qController" x:Class="qController.QConnectionPage">
|
||||
<StackLayout x:Name="sLayout">
|
||||
<Grid x:Name="topBar" HorizontalOptions="FillAndExpand">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -10,10 +10,11 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image x:Name = "scanButton" HorizontalOptions = "Start" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" />
|
||||
<Image x:Name = "addButton" HorizontalOptions = "End" Margin="20,10,20,10" Grid.Row="0" Grid.Column="1" />
|
||||
<Label x:Name = "menuButton" FontFamily = "{StaticResource qfont}" HorizontalOptions = "Start" Margin="20,10,20,10" Grid.Row="0" Grid.Column="0" FontSize="25"/>
|
||||
|
||||
</Grid>
|
||||
<ListView x:Name="lstView" HasUnevenRows = "true" >
|
||||
</ListView>
|
||||
|
||||
</StackLayout>
|
||||
</ContentPage>
|
||||
+30
-18
@@ -9,13 +9,29 @@ using System.Collections.Generic;
|
||||
namespace qController
|
||||
{
|
||||
|
||||
public partial class qControllerPage : ContentPage
|
||||
public partial class QConnectionPage : ContentPage
|
||||
{
|
||||
public qControllerPage()
|
||||
public QConnectionPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitGUI();
|
||||
App.rootPage.MenuItemSelected += OnMenuItemSelected;
|
||||
}
|
||||
|
||||
private void OnMenuItemSelected(object source, MenuEventArgs args)
|
||||
{
|
||||
Console.WriteLine("Menu Item Selected: " + args.Command);
|
||||
if(args.Command == "scan")
|
||||
{
|
||||
Scan();
|
||||
}
|
||||
else if(args.Command == "add")
|
||||
{
|
||||
AddWorkspace();
|
||||
}else if(args.Command == "open_link")
|
||||
{
|
||||
Device.OpenUri(new Uri("http://www.example.com"));
|
||||
}
|
||||
}
|
||||
|
||||
private void InitGUI()
|
||||
@@ -38,31 +54,23 @@ namespace qController
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
scanButton.Margin = new Thickness(20, 45, 20, 10);
|
||||
addButton.Margin = new Thickness(20, 45, 20, 10);
|
||||
menuButton.Margin = new Thickness(20, 35, 20, 10);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
addButton.Source = ImageSource.FromFile("add");
|
||||
scanButton.Source = ImageSource.FromFile("scan");
|
||||
menuButton.Text = "\uF0C9";
|
||||
|
||||
lstView.BackgroundColor = Color.FromHex("4A4A4A");
|
||||
BackgroundColor = Color.FromHex("4A4A4A");
|
||||
var scanButtonGesture = new TapGestureRecognizer();
|
||||
|
||||
scanButtonGesture.Tapped += Scan;
|
||||
scanButton.GestureRecognizers.Add(scanButtonGesture);
|
||||
scanButtonGesture.Tapped += showMenu;
|
||||
menuButton.GestureRecognizers.Add(scanButtonGesture);
|
||||
|
||||
|
||||
|
||||
var addButtonGesture = new TapGestureRecognizer();
|
||||
|
||||
addButtonGesture.Tapped += AddWorkspace;
|
||||
addButton.GestureRecognizers.Add(addButtonGesture);
|
||||
}
|
||||
|
||||
void AddWorkspace(object sender, EventArgs e){
|
||||
void AddWorkspace(){
|
||||
|
||||
UserDialogs.Instance.Prompt(new PromptConfig
|
||||
{
|
||||
@@ -97,12 +105,11 @@ namespace qController
|
||||
}
|
||||
|
||||
|
||||
async void Scan(object sender, EventArgs e){
|
||||
async void Scan(){
|
||||
bool workspacesFound = false;
|
||||
showToast("Scanning for Workspaces...");
|
||||
|
||||
|
||||
Console.WriteLine("Begin Scanning");
|
||||
|
||||
IReadOnlyList<IZeroconfHost> results = await ZeroconfResolver.ResolveAsync("_qlab._udp.local.",TimeSpan.FromSeconds(3));
|
||||
if(results != null){
|
||||
foreach (var result in results)
|
||||
@@ -123,6 +130,11 @@ namespace qController
|
||||
}
|
||||
}
|
||||
|
||||
void showMenu(object sender, EventArgs e)
|
||||
{
|
||||
App.MenuIsPresented = true;
|
||||
}
|
||||
|
||||
void showToast(string message)
|
||||
{
|
||||
var toastConfig = new ToastConfig(message);
|
||||
@@ -38,6 +38,11 @@
|
||||
<Compile Remove="Classes\Cues\QDefinitions.cs" />
|
||||
<Compile Remove="Classes\Communication\QSender.cs" />
|
||||
<Compile Remove="Classes\Communication\QSender.cs" />
|
||||
<Compile Remove="ViewModels\MenuPageViewModel.cs" />
|
||||
<Compile Remove="Pages\RootPageMenuItem.cs" />
|
||||
<Compile Remove="Pages\RootPageMaster.xaml.cs" />
|
||||
<Compile Remove="Pages\RootPageDetail.xaml.cs" />
|
||||
<Compile Remove="Pages\HomePage.xaml.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="App.xaml.cs">
|
||||
@@ -85,4 +90,9 @@
|
||||
<Folder Include="Classes\Communication\" />
|
||||
<Folder Include="Classes\Settings\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Remove="Pages\RootPageMaster.xaml" />
|
||||
<EmbeddedResource Remove="Pages\RootPageDetail.xaml" />
|
||||
<EmbeddedResource Remove="Pages\HomePage.xaml" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user