Skip to content

Commit

Permalink
Merge dev to master (#46)
Browse files Browse the repository at this point in the history
Beta 0.1


* app will check your connection, when on metered connection it will connect to the remote url, otherwise take the normal url

* implemented demo url, disabled settings fields when demomode is checked

* #4 Implemented demo mode

* navigating forward in a sitemap works

* 7 implement new design (#10)

* app will check your connection, when on metered connection it will connect to the remote url, otherwise take the normal url

* implemented demo url, disabled settings fields when demomode is checked

* #4 Implemented demo mode

* navigating forward in a sitemap works

* Implemented NavigationService for widgets

* Added styled Switch widget

* add SliderWidget

* added slider widget

* fix merge issues

* Added section switch widget (#14)

* 15 add color widget (#16)

* fix #11

* First step in fixing layout issues is done

* generic UI fixes

* added color widget, fixes #15

* added colorchanged handling and default value

* fix widget bug

* 15 add color widget (#17)

* fix #11

* First step in fixing layout issues is done

* generic UI fixes

* added color widget, fixes #15

* added colorchanged handling and default value

* fix widget bug

* Made frame icon smaller and next to label (#27)

* Added MJPEG widget (#28)

* Fixed slider bug where click didn't trigger change event (#29)

* fixes #22, background image gets a dark overlay to make titles more visible (#30)

* Fixed nullreference on app launch and url set (#31)

* added app title, icon and splashscreen (#32)

* fixed issue #33 with not working demo mode (#34)

* added demo mode check to url check

* Replaced ListViewItemPresenter with UIElement structure like dokumented here - https://msdn.microsoft.com/de-de/library/windows/apps/mt299136.aspx (#35)

Fixes issue #21

* Fixes #23 style of settingspage matches app design (#37)

* Added support for authorization

* 38-AddSupportForUsernameAndPassword (#39)

* Fixes #23 style of settingspage matches app design

* Added support for authorization

* Fixes #23 style of settingspage matches app design

* Added support for authorization

* Completed rollershutter widget (#40)

* Added capability to access private network for lokal openHAB instance access. (#43)

issue #41

* Fixes #42 Crash on save with invalid url (#45)

* change logo + disable colorpicker for now
  • Loading branch information
NicoVermeir authored Jan 20, 2017
1 parent b10e6ac commit 28931d4
Show file tree
Hide file tree
Showing 119 changed files with 3,762 additions and 364 deletions.
25 changes: 25 additions & 0 deletions OpenHAB.Windows/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,22 @@
<controls:FrameWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<DataTemplate x:Key="MjpegTemplate">
<controls:MjpegWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<DataTemplate x:Key="PageLinkTemplate">
<controls:PageLinkWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<DataTemplate x:Key="SwitchTemplate">
<controls:SwitchWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<DataTemplate x:Key="RollershutterTemplate">
<controls:RollershutterWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<DataTemplate x:Key="SliderTemplate">
<controls:SliderWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>
Expand All @@ -34,9 +46,22 @@
<controls:ImageWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<DataTemplate x:Key="SectionSwitchTemplate">
<controls:SectionSwitchWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<DataTemplate x:Key="ColorTemplate">
<controls:ColorWidget Widget="{Binding Mode=OneWay}" />
</DataTemplate>

<converters:WidgetTemplateSelector x:Key="WidgetTemplateSelector"
ColorTemplate="{StaticResource ColorTemplate}"
FrameTemplate="{StaticResource FrameTemplate}"
ImageTemplate="{StaticResource ImageItemTemplate}"
MjpegTemplate="{StaticResource MjpegTemplate}"
PageLinkTemplate="{StaticResource PageLinkTemplate}"
RollershutterTemplate="{StaticResource RollershutterTemplate}"
SectionSwitchTemplate="{StaticResource SectionSwitchTemplate}"
SliderTemplate="{StaticResource SliderTemplate}"
SwitchTemplate="{StaticResource SwitchTemplate}"
TextTemplate="{StaticResource TextItemTemplate}" />
Expand Down
22 changes: 21 additions & 1 deletion OpenHAB.Windows/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
using OpenHAB.Windows.View;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation.Metadata;
using Windows.UI;
using Windows.UI.Core;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
Expand Down Expand Up @@ -29,8 +33,19 @@ public App()
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
protected override async void OnLaunched(LaunchActivatedEventArgs e)
{
if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
var statusbar = StatusBar.GetForCurrentView();
await statusbar.ShowAsync();
statusbar.BackgroundColor = Color.FromArgb(255, 34, 40, 40);
statusbar.BackgroundOpacity = 1;
statusbar.ForegroundColor = Colors.White;
}

SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;

var rootFrame = Window.Current.Content as Frame;

// Do not repeat app initialization when the Window already has content,
Expand Down Expand Up @@ -66,6 +81,11 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
}
}

private void OnBackRequested(object sender, BackRequestedEventArgs e)
{
e.Handled = true;
}

/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
Expand Down
Binary file added OpenHAB.Windows/Assets/LogoFlat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/LogoSplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/NewStoreLogo.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/NewStoreLogo.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/NewStoreLogo.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/NewStoreLogo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/NewStoreLogo.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/SplashScreen.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/SplashScreen.scale-125.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/SplashScreen.scale-150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified OpenHAB.Windows/Assets/SplashScreen.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added OpenHAB.Windows/Assets/SplashScreen.scale-400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified OpenHAB.Windows/Assets/Square150x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified OpenHAB.Windows/Assets/Square44x44Logo.scale-200.png
Binary file modified OpenHAB.Windows/Assets/Wide310x150Logo.scale-200.png
Binary file added OpenHAB.Windows/Assets/background.jpg
Binary file added OpenHAB.Windows/Assets/openhab-logo-square.png
26 changes: 26 additions & 0 deletions OpenHAB.Windows/Controls/ChartWidget.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<local:WidgetBase x:Class="OpenHAB.Windows.Controls.ChartWidget"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:OpenHAB.Windows.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Height="600"
Margin="8,4,8,4"
Background="{StaticResource OpenHABLightColor}"
CornerRadius="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<local:ImageLabel VerticalAlignment="Center"
IconPath="{x:Bind Widget.Icon, Converter={StaticResource IconToPathConverter}, Mode=OneWay}"
LabelText="{x:Bind Widget.Label, Mode=OneWay}" />

<Image x:Name="Chart"
Grid.Row="1"
Stretch="UniformToFill" />
</Grid>
</local:WidgetBase>
50 changes: 50 additions & 0 deletions OpenHAB.Windows/Controls/ChartWidget.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using System.ComponentModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Imaging;
using Microsoft.Practices.ServiceLocation;
using OpenHAB.Core.Common;
using OpenHAB.Core.Contracts.Services;

namespace OpenHAB.Windows.Controls
{
/// <summary>
/// Widget control that represents an OpenHAB slider
/// </summary>
public sealed partial class ChartWidget : WidgetBase
{
public static readonly DependencyProperty ChartUriProperty = DependencyProperty.Register(
"ChartUri", typeof(string), typeof(ChartWidget), new PropertyMetadata(default(string)));

public string ChartUri
{
get { return (string) GetValue(ChartUriProperty); }
set { SetValue(ChartUriProperty, value); }
}

/// <summary>
/// Initializes a new instance of the <see cref="ChartWidget"/> class.
/// </summary>
public ChartWidget()
{
InitializeComponent();
Loaded += OnLoaded;
}

private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
{
var settingsService = ServiceLocator.Current.GetInstance<ISettingsService>();
var settings = settingsService.Load();
var serverUrl = settings.IsRunningInDemoMode.Value ? Constants.Api.DemoModeUrl : settings.OpenHABUrl;

if (!serverUrl.EndsWith("/"))
{
serverUrl += "/";
}

// http://demo.openhab.org:8080/chart?groups=Weather_Chart&period=d
ChartUri = $"{serverUrl}chart?groups={Widget.Item.Name}&period=d";
Chart.Source = new BitmapImage(new Uri(ChartUri));
}
}
}
39 changes: 39 additions & 0 deletions OpenHAB.Windows/Controls/ColorMap.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<UserControl x:Class="OpenHAB.Windows.Controls.ColorMap"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="map"
mc:Ignorable="d">

<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid>
<Grid x:Name="poly">
<Ellipse x:Name="ellipse"
Stretch="Uniform"
Stroke="Purple"
StrokeThickness="2">
<Ellipse.Fill>
<ImageBrush x:Name="image3" />
</Ellipse.Fill>
</Ellipse>
</Grid>
<Canvas>
<Thumb x:Name="thumb"
Width="10"
Height="10"
Visibility="Collapsed">
<Thumb.Template>
<ControlTemplate>
<Ellipse Stroke="Gray" StrokeThickness="2">
<Ellipse.Fill>
<SolidColorBrush Color="{StaticResource OpenHABLightGrey}" />
</Ellipse.Fill>
</Ellipse>
</ControlTemplate>
</Thumb.Template>
</Thumb>
</Canvas>
</Grid>
</Grid>
</UserControl>
Loading

0 comments on commit 28931d4

Please sign in to comment.