Просмотр исходного кода

Tweaked Avalonia Home Page to respect Clock On Security Tokens

frogsoftware 3 недель назад
Родитель
Сommit
2de72b5771

+ 5 - 7
PRS.Avalonia/PRS.Avalonia.Android/PRS.Avalonia.Android.csproj

@@ -14,16 +14,10 @@
     <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
       <AndroidLinkMode>None</AndroidLinkMode>
     </PropertyGroup>
-    
-    <ItemGroup>
-        <PackageReference Include="Avalonia.Android" Version="11.3.3" />
-        <PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.3" />
-        <PackageReference Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.0.1.14" />
-    </ItemGroup>
 
     <ItemGroup>
         <ProjectReference Include="..\..\..\inabox\InABox.Avalonia.Platform.Android\InABox.Avalonia.Platform.Android.csproj" />
-        <ProjectReference Include="..\PRS.Avalonia\PRS.Avalonia.csproj"/>
+        <ProjectReference Include="..\PRS.Avalonia\PRS.Avalonia.csproj" />
     </ItemGroup>
 
     <ItemGroup>
@@ -31,5 +25,9 @@
         <Link>Resources\drawable\Icon.png</Link>
       </AndroidResource>
     </ItemGroup>
+
+    <ItemGroup>
+      <PackageReference Include="Avalonia.Android" Version="11.3.2" />
+    </ItemGroup>
     
 </Project>

+ 1 - 1
PRS.Avalonia/PRS.Avalonia.Android/Properties/AndroidManifest.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
 	<uses-permission android:name="android.permission.INTERNET" />
 	<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
 	<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

+ 3 - 2
PRS.Avalonia/PRS.Avalonia.Android/Resources/values-v31/styles.xml

@@ -4,14 +4,15 @@
   <style name="MyTheme">
   </style>
 
-  <style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">
+<!--    <style name="MyTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar">-->
+    <style name="MyTheme.NoActionBar">
     <item name="android:windowActionBar">false</item>
     <item name="android:windowBackground">@null</item>
     <item name="android:windowNoTitle">true</item>
     <item name="android:windowSplashScreenBackground">@color/splash_background</item>
     <item name="android:windowSplashScreenAnimatedIcon">@drawable/avalonia_anim</item>
     <item name="android:windowSplashScreenAnimationDuration">1000</item>
-    <item name="postSplashScreenTheme">@style/MyTheme.Main</item>
+<!--    <item name="postSplashScreenTheme">@style/MyTheme.Main</item>-->
 
   </style>
   <style name="MyTheme.Main"

+ 3 - 4
PRS.Avalonia/PRS.Avalonia.Desktop/PRS.Avalonia.Desktop.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
     <PropertyGroup>
         <OutputType>WinExe</OutputType>
-        <TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
+        <TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
         <Nullable>enable</Nullable>
         <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
         <Platforms>x64</Platforms>
@@ -25,9 +25,8 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Avalonia.Desktop" Version="11.3.3" />
-        <PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.3" />
-        <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
+        <PackageReference Include="Avalonia.Desktop" Version="11.3.2" />
+        <PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.2" />
     </ItemGroup>
 
     <ItemGroup>

+ 6 - 2
PRS.Avalonia/PRS.Avalonia/HomePage/HomePageViewModel.cs

@@ -172,8 +172,12 @@ public partial class HomePageViewModel : ViewModelBase
         get
         {
             if (CurrentLocation == null)
+            {
+                if (Security.IsAllowed<CanBypassGPSClockIn>())
+                    return "";
                 return null;
-            
+            }
+
             if (CurrentJob != null)
                 return CurrentJob.DisplayName;
 
@@ -183,7 +187,7 @@ public partial class HomePageViewModel : ViewModelBase
             if (info.Geofence.Contains(CurrentLocation))
                 return info.CompanyName;
             
-            if (Security.IsAllowed<CanBypassGPSClockIn>() || IsClockedOn)
+            if (Security.IsAllowed<CanBypassBluetoothGates>() || IsClockedOn)
                 return "";
             
             return null;