Skip to content

Commit

Permalink
UI work #69 #82
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirAkopyan committed Oct 5, 2017
1 parent 285ece6 commit ff46def
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 38 deletions.
4 changes: 2 additions & 2 deletions Quickbird/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- Navigation Panel | SplitView -->
<Style x:Key="NavigationPanel" TargetType="SplitView">
<Setter Property="OpenPaneLength" Value="256" />
<Setter Property="CompactPaneLength" Value="96" />
<Setter Property="CompactPaneLength" Value="50" />
<Setter Property="IsPaneOpen" Value="False" />
<Setter Property="DisplayMode" Value="CompactInline" />
<Setter Property="PaneBackground" Value="#FF515C6B" />
Expand All @@ -24,7 +24,7 @@
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="Foreground" Value="#FFEBEBEB" />
<Setter Property="Height" Value="72" />
<Setter Property="Height" Value="50" />
<Setter Property="Width" Value="256" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Stretch" />
Expand Down
8 changes: 8 additions & 0 deletions Quickbird/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ public App()
InitializeComponent();
Suspending += OnSuspending;
Resuming += OnResuming;

/* If there is an unhandled exception, restart the application */
this.UnhandledException += (sender, e) =>
{
// e.Handled = true;

System.Diagnostics.Debug.WriteLine(e.Exception);
};
}

/// <summary>The UI dispatcher for this app. This ensures that the correct dispatcher is acquired in
Expand Down
15 changes: 14 additions & 1 deletion Quickbird/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class SettingsViewModel : ViewModelBase

private bool _isNetworkConflict;

private bool _SyncInProgress = false;

public SettingsViewModel()
{
_localNetworkConflictAction = LocalNetworkConflictDetected;
Expand Down Expand Up @@ -62,7 +64,6 @@ public bool ToastsEnabled
}
}


public bool DebugToastsEnabled
{
get { return SettingsService.Instance.DebugToastsEnabled; }
Expand Down Expand Up @@ -114,9 +115,21 @@ public string AppVersion { get {

public async void SyncTimeReset()
{
SyncInProgress = true;
SettingsService.Instance.LastSuccessfulGeneralDbGet = DateTimeOffset.MinValue;
SettingsService.Instance.LastSuccessfulGeneralDbPost = DateTimeOffset.MinValue;
await Services.DataService.Instance.SyncWithServerAsync();
SyncInProgress = false;
}

public bool SyncInProgress
{
get { return _SyncInProgress; }
set { if (value == _SyncInProgress)
return;
_SyncInProgress = value;
OnPropertyChanged();
}
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Quickbird/Views/AddCropCycleView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Grid.Row="0" Text="Select a box to monitor your new crops:"
<TextBlock Grid.Column="1" Grid.Row="0" Text="Start recording from a chosen device:\"
HorizontalAlignment="Left" Margin="10"
Style="{StaticResource TitleTextBlockStyle}" />
<ListView Grid.Row="1" Grid.Column="1" ItemsSource="{x:Bind ViewModel.PlaceList, Mode=OneWay}" Margin="10"
Expand Down
14 changes: 12 additions & 2 deletions Quickbird/Views/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,18 @@
<TextBlock Style="{StaticResource Subtitle}" Text="Technical Parameters" />
<TextBlock Text="{x:Bind ViewModel.AppVersion}" />
<TextBlock Text="{x:Bind ViewModel.MachineID}" />
<TextBlock Padding="0, 15, 0, 5" Text="If you are exoeriencing issues with syncing data, you can force the app to download and upload ALL the data agian."/>
<Button Content="Reset LastSyncDate" Click="{x:Bind ViewModel.SyncTimeReset}" Margin="2"/>
<TextBlock Padding="0, 15, 0, 5" Text="The app updates data incrementally, which is more efficient, but can sometimes cause issues. Force the app to re-sync Everything if you xperience sync problems."/>

<Button Click="{x:Bind ViewModel.SyncTimeReset}" Margin="2">
<ContentControl>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Reset Last Sync Date" Padding="2" VerticalAlignment="Center"/>
<ProgressRing x:Name="SyncIndicator" Height="27" Width="27"
Visibility="{x:Bind ViewModel.SyncInProgress, Converter={StaticResource TrueVisible}, Mode=OneWay}"
IsActive="{x:Bind ViewModel.SyncInProgress, Mode=OneWay}"/>
</StackPanel>
</ContentControl>
</Button>
</StackPanel>

<StackPanel Padding="0, 15, 0, 0">
Expand Down
67 changes: 35 additions & 32 deletions Quickbird/Views/Shell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,38 @@
<SplitView.Pane>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="112" />
<RowDefinition Height="70" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<!-- Pane Header -->
<Grid BorderBrush="#66EBEBEB" BorderThickness="0,0,0,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="96" />
<ColumnDefinition Width="40"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>

<Button BorderBrush="{x:Null}"
Click="{x:Bind ViewModel.ToggleNav}"
Style="{ThemeResource NoBackgroundDarkTheme}">
Style="{ThemeResource NoBackgroundDarkTheme}"
Width="50">
<Image Height="44"
Margin="32,32,0,32"
HorizontalAlignment="Left"
HorizontalAlignment="Center"
Opacity="0.95"
Source="ms-appx:///Assets/logo-rocket-light.png"
Stretch="Uniform" />
</Button>
<TextBlock Grid.Column="1"
Margin="0,40"
FontFamily="Segoe UI"
FontSize="24"
FontWeight="Normal"
Foreground="#FFEBEBEB"
Text="Quickbird" />
<TextBlock
Grid.Column="1"
Margin="0,10"
FontFamily="Segoe UI"
FontSize="18"
FontWeight="Normal"
Foreground="#FFEBEBEB"
Text="Recordings In Progress"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"/>
</Grid>

<!-- Pane Body -->
Expand All @@ -63,44 +66,44 @@
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="96" />
<ColumnDefinition Width="50" />
<ColumnDefinition />
<ColumnDefinition Width="44" />
</Grid.ColumnDefinitions>
<Ellipse Margin="24,12,24,12" Fill="#FFEBEBEB" />
<Ellipse Margin="6,6,6,6" Fill="#FFEBEBEB" />
<Ellipse Grid.Column="0"
Margin="24,12,24,12"
Margin="6,6,6,6"
Fill="Gold"
Visibility="{Binding Path=IsAlerted,
Converter={StaticResource TrueVisible},
Mode=OneWay}" />
Mode=OneWay}"/>
<TextBlock Grid.Column="0"
Margin="0,2,2,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="Segoe UI Mono"
FontSize="30"
FontSize="28"
Foreground="#FF515C6B"
Text="{Binding IconLetter,
Mode=OneWay,
FallbackValue=C}"
TextAlignment="Center" />
<StackPanel Grid.Column="1" Margin="0,12,0,12">
<StackPanel Grid.Column="1" Margin="0,4,0,6" >
<TextBlock FontFamily="Segoe UI"
FontSize="18"
FontSize="16"
FontWeight="Normal"
Text="{Binding CropName,
Mode=OneWay,
FallbackValue=Crop}" />
<TextBlock Style="{ThemeResource Subtitle}"
<TextBlock Style="{ThemeResource Subtitle}" FontSize="12"
Text="{Binding BoxName, Mode=OneWay, FallbackValue=Location}" />
</StackPanel>
<TextBlock Grid.Column="2"
Margin="0,0,12,4"
Margin="0,0,12,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
FontFamily="Segoe UI Symbol"
FontSize="28"
FontSize="26"
Foreground="Gold"
Text=""
Visibility="{Binding Path=IsAlerted,
Expand All @@ -122,17 +125,17 @@
Style="{ThemeResource NoBackgroundDarkTheme}">
<Grid Height="50">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="96" />
<ColumnDefinition Width="50" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Margin="24,0,24,0"
<TextBlock Margin="6,0,6,0"
FontSize="28"
Foreground="#FFEBEBEB"
Style="{ThemeResource Icon}"
Text="" />
<TextBlock Grid.Column="1"
Style="{StaticResource ShellButtonText}"
Text="Add Crop" />
Text="New Recording" />
</Grid>
</Button>

Expand All @@ -143,10 +146,10 @@
Style="{ThemeResource NoBackgroundDarkTheme}">
<Grid Height="50">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="96" />
<ColumnDefinition Width="50" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Margin="24,0,24,0"
<TextBlock Margin="6,0,6,0"
FontSize="28"
Foreground="#FFEBEBEB"
Style="{ThemeResource Icon}"
Expand All @@ -164,14 +167,14 @@
Style="{ThemeResource NoBackgroundDarkTheme}">
<Grid Height="50">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="96" />
<ColumnDefinition Width="50" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Margin="24,0,24,0"
<TextBlock Margin="6,0,6,0"
FontSize="28"
Foreground="#FFEBEBEB"
Style="{ThemeResource Icon}"
Text="" />
Text="" />
<TextBlock Grid.Column="1"
Style="{StaticResource ShellButtonText}"
Text="Graphs" />
Expand All @@ -185,10 +188,10 @@
Style="{ThemeResource NoBackgroundDarkTheme}">
<Grid Height="50">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="96" />
<ColumnDefinition Width="50" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Margin="24,0,24,0"
<TextBlock Margin="6,0,6,0"
FontSize="28"
Foreground="#FFEBEBEB"
Style="{ThemeResource Icon}"
Expand Down

0 comments on commit ff46def

Please sign in to comment.