Prechádzať zdrojové kódy

Merge branch 'developer' of https://github.com/jancoow/Breda-Tour into developer

Jannick van Ballegooijen 10 rokov pred
rodič
commit
1ba02c29ee

+ 1 - 1
Breda-Tour/App.xaml

@@ -112,7 +112,7 @@
                 <Setter Property="Template">
                     <Setter.Value>
                         <ControlTemplate>
-                            <RelativePanel>
+                            <RelativePanel HorizontalAlignment="Stretch">
                                 <VisualStateManager.VisualStateGroups>
                                     <!--<VisualStateGroup x:Name="CommonStates">
                                         <VisualState x:Name="Normal">

+ 27 - 2
Breda-Tour/Data/Gps.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using Windows.ApplicationModel.ExtendedExecution;
 using Windows.Devices.AllJoyn;
 using Windows.Devices.Geolocation;
 using Windows.Devices.Geolocation.Geofencing;
@@ -13,6 +14,7 @@ namespace Breda_Tour.Data
 {
     public class Gps
     {
+        private ExtendedExecutionSession session;
         private MapPage mapPage;
         private Geolocator geolocator;
 
@@ -44,12 +46,13 @@ namespace Breda_Tour.Data
             switch (accessStatus)
             {
                 case GeolocationAccessStatus.Allowed:
-                    geolocator = new Geolocator{DesiredAccuracy = PositionAccuracy.High,MovementThreshold = 3};
+                    geolocator = new Geolocator { DesiredAccuracy = PositionAccuracy.High, MovementThreshold = 3 };
                     // Subscribe events
                     geolocator.StatusChanged += OnStatusChanged;
                     geolocator.PositionChanged += OnPositionChanged;
                     // Get position
                     _position = await geolocator.GetGeopositionAsync();
+                    StartLocationExtensionSession();
                     break;
                 case GeolocationAccessStatus.Denied:
                     _status = PositionStatus.NotAvailable;
@@ -92,5 +95,27 @@ namespace Breda_Tour.Data
                 mapPage.ShowLocaton(_position.Coordinate.Point);
             }
         }
+
+        private async void StartLocationExtensionSession()
+        {
+            session = new ExtendedExecutionSession();
+            session.Description = "Location Tracker";
+            session.Reason = ExtendedExecutionReason.LocationTracking;
+            session.Revoked += ExtendedExecutionSession_Revoked;
+            var result = await session.RequestExtensionAsync();
+            if (result == ExtendedExecutionResult.Denied)
+            {
+                Debug.Write("Denied!!!!");
+            }
+        }
+
+        private void ExtendedExecutionSession_Revoked(object sender, ExtendedExecutionRevokedEventArgs args)
+        {
+            if (session != null)
+            {
+                session.Dispose();
+                session = null;
+            }
+        }
     }
-}
+}

+ 4 - 4
Breda-Tour/MapScreen/WpDetailPage.xaml

@@ -9,7 +9,7 @@
     xmlns:data="using:Breda_Tour.Data"
     mc:Ignorable="d">
 
-    <Grid Background="White">
+    <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto"/>
             <RowDefinition Height="Auto"/>
@@ -18,7 +18,7 @@
         </Grid.RowDefinitions>
 
         <c:DefaultTopBar x:Name="NameBar" Grid.Row="0" Header="{x:Bind wp.Title}"/>
-        <ListView Grid.Row="1" ItemsSource="{x:Bind wp.Pictures}"
+        <ListView Background="White" Grid.Row="1" ItemsSource="{x:Bind wp.Pictures}"
                   ScrollViewer.HorizontalScrollMode="Enabled"
                     ScrollViewer.IsHorizontalRailEnabled="True"
                     ScrollViewer.VerticalScrollMode="Disabled" HorizontalAlignment="Left" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
@@ -40,11 +40,11 @@
             </ListView.ItemTemplate>
         </ListView>
 
-        <RelativePanel Grid.Row="2">
+        <RelativePanel Background="White" Grid.Row="2">
             <TextBlock x:Uid="WpDetailPagetxtBeschrijving" Text="Beschrijving" FontSize="20" Margin="15,15,0,15" />
             <Line X1="0" X2="{x:Bind Width, Mode=OneTime}" Y1="50" Y2="50" Stroke="Gray" StrokeThickness="2" />
         </RelativePanel>
-        <RelativePanel Grid.Row="3">
+        <RelativePanel Background="White" Grid.Row="3">
             <ScrollViewer Margin="15,0,0,0" VerticalScrollBarVisibility="Auto" >
                 <TextBlock HorizontalAlignment="Stretch"  VerticalAlignment="Stretch" TextWrapping="Wrap" Text="{x:Bind wp.Description}"/>
             </ScrollViewer>

+ 8 - 0
Breda-Tour/MultilingualResources/Breda-Tour.en-US.xlf

@@ -58,6 +58,14 @@
           <source>Beschrijving</source>
           <target state="translated" state-qualifier="tm-suggestion">Description</target>
         </trans-unit>
+        <trans-unit id="AppSettingstxtReset.Text" translate="yes" xml:space="preserve">
+          <source>Route afsluiten en applicatie naar basis instellingen resetten</source>
+          <target state="translated">Reset route and application to defaults</target>
+        </trans-unit>
+        <trans-unit id="AppSettingstxtResetHeader.Text" translate="yes" xml:space="preserve">
+          <source>Applicatie resetten</source>
+          <target state="translated">Reset Application</target>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 5 - 5
Breda-Tour/RouteSelectScreen/RouteExample.xaml

@@ -9,7 +9,7 @@
     xmlns:data="using:Breda_Tour.Data"
     mc:Ignorable="d">
 
-    <Grid Background="White">
+    <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto"/>
             <RowDefinition Height="Auto"/>
@@ -19,7 +19,7 @@
 
         <c:DefaultTopBar Grid.Row="0" x:Uid="RouteExamplePagetxtRouteVoorbeeld" Header="Routevoorbeeld"/>
 
-        <StackPanel Grid.Row="1">
+        <StackPanel Background="White" Grid.Row="1">
             <StackPanel Orientation="Horizontal" Margin="10,10,0,0">
                 <TextBlock x:Uid="RouteExamplePagetxtRouteInformatie" Text="Route informatie" FontSize="16"/>
                 <Button x:Name="StartButton" Visibility="Collapsed" Click="Button_Click" Margin="120,0,0,0" >
@@ -32,14 +32,14 @@
             <TextBlock x:Name="WaypointsBlok" FontSize="16" Margin="10,0,0,10"/>
 
         </StackPanel>
-        <StackPanel Grid.Row="2">
+        <StackPanel Background="White" Grid.Row="2">
             <Image Source="ms-appx:///Assets/Map.png" Width="360"  />
         </StackPanel>
 
-        <ListView Grid.Row="3" Margin="10,0,0,0" x:Name="Waypoints" ItemsSource="{x:Bind route.Waypoints}" IsItemClickEnabled="True" ItemClick="Waypoints_OnItemClick">
+        <ListView Background="White" Grid.Row="3" x:Name="Waypoints" ItemsSource="{x:Bind route.Waypoints}" IsItemClickEnabled="True" ItemClick="Waypoints_OnItemClick">
             <ListView.ItemContainerStyle>
                 <Style TargetType="ListViewItem">
-                    <Setter Property="Padding" Value="0"/>
+                    <Setter Property="Padding" Value="10,0,0,0"/>
                     <Setter Property="Margin" Value="0"/>
                 </Style>
             </ListView.ItemContainerStyle>

+ 9 - 4
Breda-Tour/RouteSelectScreen/RouteSelectPage.xaml

@@ -19,16 +19,21 @@
         </Grid.RowDefinitions>
         <c:DefaultTopBar x:Uid="RouteSelectPagetxtSelectRoute" Header="Route Selecteren"/>
         <c:DefaultPivotControl x:Name="DefaultPivot" Grid.Row="1"/>
-        <RelativePanel Grid.Row="2" Margin="0,5">
+        <RelativePanel Grid.Row="2" Padding="0,10,0,5" Background="White">
             <RelativePanel.Resources>
                 <con:Converter x:Key="BoolToVis"/>
                 <con:BoolToString x:Key="BoolToString"/>
             </RelativePanel.Resources>
-            <ListView x:Name="Routes" ItemsSource="{x:Bind CurrentRoutes}" IsItemClickEnabled="True" ItemClick="Routes_ItemClick">
+            <ListView RelativePanel.AlignLeftWithPanel="True"
+                      RelativePanel.AlignRightWithPanel="True"
+                      x:Name="Routes" ItemsSource="{x:Bind CurrentRoutes}"
+                      IsItemClickEnabled="True"
+                      ItemClick="Routes_ItemClick"
+                      HorizontalContentAlignment="Stretch">
                 <ListView.ItemTemplate>
                     <DataTemplate x:DataType="data:Route">
                         <StackPanel>
-                            <StackPanel Orientation="Horizontal" Width="340">
+                            <StackPanel Orientation="Horizontal">
                                 <Image Source="ms-appx:///Assets/Map_Icon.png" Width="35" Height="35"/>
                                 <TextBlock Text="{Binding Title}" FontSize="24" Margin="15,0,0,0"/>
                                 <ToggleButton x:Name="toggleButton" Background="Transparent" IsChecked="False" Width="40" Height="40" Margin="35,0,0,0">
@@ -39,7 +44,7 @@
                                 <Image Source="ms-appx:///Assets/Flag_Icon.png" Width="25" Height="25" Margin="45,0,0,0"/>
                                 <TextBlock Text="Breda" Foreground="DarkGray" FontSize="16" Margin="15,0,0,0"/>
                             </StackPanel>
-                            <Line X1="0" X2="1080" Y1="5" Y2="5" Stroke="Gray" StrokeThickness="2"/>
+                            <Rectangle Height="2" HorizontalAlignment="Stretch" Fill="Gray"/>
                         </StackPanel>
                     </DataTemplate>
                 </ListView.ItemTemplate>

+ 1 - 1
Breda-Tour/SettingsScreen/SettingsPage.xaml

@@ -28,7 +28,7 @@
                 <Rectangle Margin="0,15,0,15" Fill="#99000000" Height="1" />
                 <ListViewItem Name="listViewItemReset" Tapped="listViewItemReset_Tapped">
                     <StackPanel Margin="8,0,0,0">
-                        <TextBlock x:Uid="AppSettingstxtReset" FontSize="18" Text="Applicatie resetten" Foreground="#ec0000" ></TextBlock>
+                        <TextBlock x:Uid="AppSettingstxtResetHeader" FontSize="18" Text="Applicatie resetten" Foreground="#ec0000" ></TextBlock>
                         <TextBlock x:Uid="AppSettingstxtReset" Margin="0,-1,0,0" FontSize="12"  Text="Route afsluiten en applicatie naar basis instellingen resetten" Foreground="#ec0000"></TextBlock>
                     </StackPanel>
                 </ListViewItem>

+ 6 - 0
Breda-Tour/en-US/Resources.resw

@@ -51,4 +51,10 @@
   <data name="WpDetailPagetxtBeschrijving.Text" xml:space="preserve">
     <value>Description</value>
   </data>
+  <data name="AppSettingstxtReset.Text" xml:space="preserve">
+    <value>Reset route and application to defaults</value>
+  </data>
+  <data name="AppSettingstxtResetHeader.Text" xml:space="preserve">
+    <value>Reset Application</value>
+  </data>
 </root>

+ 6 - 0
Breda-Tour/nl-NL/Resources.resw

@@ -126,6 +126,12 @@
   <data name="AppSettingstxtLanguageString.Text" xml:space="preserve">
     <value>Nederlands</value>
   </data>
+  <data name="AppSettingstxtReset.Text" xml:space="preserve">
+    <value>Route afsluiten en applicatie naar basis instellingen resetten</value>
+  </data>
+  <data name="AppSettingstxtResetHeader.Text" xml:space="preserve">
+    <value>Applicatie resetten</value>
+  </data>
   <data name="AppSettingstxtSettings.Header" xml:space="preserve">
     <value>Instellingen</value>
   </data>