mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-20 14:39:12 +00:00
Switch to Heights based on Display Dimensions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using Acr.UserDialogs;
|
||||
using Xamarin.Forms;
|
||||
|
||||
using Xamarin.Essentials;
|
||||
namespace qController
|
||||
{
|
||||
public partial class App : Application
|
||||
@@ -9,7 +9,9 @@ namespace qController
|
||||
public static NavigationPage NavigationPage { get; private set; }
|
||||
public static RootPage rootPage;
|
||||
public static string QFont;
|
||||
|
||||
public static DisplayInfo mainDisplayInfo;
|
||||
public static double Height;
|
||||
public static double Width;
|
||||
public static bool MenuIsPresented
|
||||
{
|
||||
get
|
||||
@@ -29,6 +31,11 @@ namespace qController
|
||||
/*MainPage = new NavigationPage(new QConnectionPage());
|
||||
iNav = MainPage.Navigation;*/
|
||||
|
||||
mainDisplayInfo = DeviceDisplay.MainDisplayInfo;
|
||||
Height = mainDisplayInfo.Height / mainDisplayInfo.Density;
|
||||
Width = mainDisplayInfo.Width / mainDisplayInfo.Density;
|
||||
System.Console.WriteLine(Height);
|
||||
System.Console.WriteLine(Width);
|
||||
switch (Device.RuntimePlatform)
|
||||
{
|
||||
case Device.iOS:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?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.ControlPage">
|
||||
<ContentPage.Content>
|
||||
<StackLayout x:Name="sLayout">
|
||||
|
||||
@@ -73,11 +73,14 @@ namespace qController
|
||||
{
|
||||
App.rootPage.MenuPage.ChangeToControl();
|
||||
NavigationPage.SetHasNavigationBar(this, false);
|
||||
|
||||
instanceName.HorizontalTextAlignment = TextAlignment.Center;
|
||||
instanceName.HorizontalOptions = LayoutOptions.CenterAndExpand;
|
||||
instanceName.VerticalOptions = LayoutOptions.CenterAndExpand;
|
||||
topBar.Children.Add(instanceName, 1, 0);
|
||||
topBar.BackgroundColor = Color.FromHex("71AEFF");
|
||||
topBar.HeightRequest = Math.Max(App.Height * .09, 65);
|
||||
|
||||
|
||||
BackgroundColor = Color.FromHex("4A4A4A");
|
||||
menuButton.Text = QIcon.MENU;
|
||||
@@ -96,6 +99,8 @@ namespace qController
|
||||
|
||||
|
||||
qCell = new QSelectedCueCell();
|
||||
qCell.HeightRequest = Math.Max(App.Height * .20, 125);
|
||||
|
||||
sLayout.Children.Add(qCell);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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.QConnectionPage">
|
||||
<StackLayout x:Name="sLayout">
|
||||
@@ -11,7 +11,6 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<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>
|
||||
|
||||
@@ -30,13 +30,14 @@ namespace qController
|
||||
AddWorkspace();
|
||||
}else if(args.Command == "open_link")
|
||||
{
|
||||
Device.OpenUri(new Uri("http://www.example.com"));
|
||||
Device.OpenUri(new Uri("http://www.jwetzell.com"));
|
||||
}
|
||||
}
|
||||
|
||||
private void InitGUI()
|
||||
{
|
||||
NavigationPage.SetHasNavigationBar(this, false);
|
||||
topBar.HeightRequest = Math.Max(App.Height * .09, 65);
|
||||
lstView.ItemsSource = QStorage.qInstances;
|
||||
|
||||
lstView.ItemTemplate = new DataTemplate(typeof(QInstanceCell));
|
||||
|
||||
Reference in New Issue
Block a user