From 85321580df2a7386a7f0bcd2f711c901cf5f9845 Mon Sep 17 00:00:00 2001 From: Anja Date: Wed, 7 Dec 2022 16:54:52 +0100 Subject: [PATCH] Version 3.0.353 --- LastenradBayern/TINK.Android/MainActivity.cs | 8 +- .../Properties/AndroidManifest.xml | 2 +- .../Resources/drawable/Location_Button.png | Bin 1891 -> 1863 bytes LastenradBayern/TINK.iOS/Info.plist | 4 +- .../Location_Button.pdf | 2 +- LastenradBayern/TINK/App.xaml.cs | 4 +- .../BikesAtStation/BikesAtStationPage.xaml | 2 +- .../TINK/View/Contact/SelectStationPage.xaml | 7 +- .../TINK/View/FindBike/FindBikePage.xaml | 2 +- .../TINK/View/MyBikes/MyBikesPage.xaml | 2 +- .../TINK.Android/Assets/Location_Pin.png | Bin 1860 -> 1666 bytes Meinkonrad/TINK.Android/MainActivity.cs | 8 +- .../Properties/AndroidManifest.xml | 2 +- .../Resources/drawable/Location_Button.png | Bin 1891 -> 1863 bytes Meinkonrad/TINK.iOS/Info.plist | 4 +- .../Location_Button.pdf | 2 +- Meinkonrad/TINK/App.xaml.cs | 4 +- .../BikesAtStation/BikesAtStationPage.xaml | 125 +++--- .../TINK/View/Contact/SelectStationPage.xaml | 181 ++++++--- .../TINK/View/FindBike/FindBikePage.xaml | 78 ++-- Meinkonrad/TINK/View/Map/MapPage.xaml | 191 ++++----- Meinkonrad/TINK/View/MyBikes/MyBikesPage.xaml | 43 +- .../ShareeSharedGuiLib.projitems | 9 + .../View/BarLevelInputView.xaml | 6 +- ShareeSharedGuiLib/View/BarLevelView.xaml | 2 + .../View/RunningProcessView.xaml | 65 +-- .../View/RunningProcessViewBay.xaml | 48 +++ .../View/RunningProcessViewBay.xaml.cs | 20 + TINK/TINK.Android/Assets/Location_Pin.png | Bin 1860 -> 1666 bytes TINK/TINK.Android/MainActivity.cs | 8 +- .../Properties/AndroidManifest.xml | 2 +- .../Resources/drawable/Location_Button.png | Bin 1891 -> 1863 bytes TINK/TINK.iOS/Info.plist | 4 +- .../Location_Button.pdf | 2 +- TINK/TINK/App.xaml.cs | 2 +- .../BikesAtStation/BikesAtStationPage.xaml | 123 +++--- TINK/TINK/View/Contact/SelectStationPage.xaml | 179 ++++++--- TINK/TINK/View/FindBike/FindBikePage.xaml | 74 ++-- TINK/TINK/View/Map/MapPage.xaml | 190 ++++----- TINK/TINK/View/MyBikes/MyBikesPage.xaml | 47 ++- TINKLib/Model/WhatsNew.cs | 5 + .../AppResources.Designer.cs | 28 +- .../AppResources.de.resx | 16 +- .../MultilingualResources/AppResources.resx | 16 +- TINKLib/MultilingualResources/TINKLib.de.xlf | 28 +- .../Essentials/LocationPermissions.cs | 80 ++++ .../Permissions/Plugin/LocationPermissions.cs | 59 +++ .../BikesAtStationPageViewModel.cs | 16 +- .../Contact/SelectStationPageViewModel.cs | 90 +++-- .../FindBike/FindBikePageViewModel.cs | 63 ++- TINKLib/ViewModel/Map/MapPageViewModel.cs | 374 ++++++++---------- .../RequestHandler/TestBookedOpen.cs | 34 +- .../RequestHandler/TestBookedUnknown.cs | 12 +- .../RequestHandler/TestDisposableOpen.cs | 6 +- .../RequestHandler/TestReservedOpen.cs | 12 +- .../RequestHandler/TestReservedUnknown.cs | 12 +- .../TestBikesAtStationPageViewModel.cs | 6 +- 57 files changed, 1421 insertions(+), 888 deletions(-) create mode 100644 ShareeSharedGuiLib/View/RunningProcessViewBay.xaml create mode 100644 ShareeSharedGuiLib/View/RunningProcessViewBay.xaml.cs create mode 100644 TINKLib/Services/Permissions/Essentials/LocationPermissions.cs create mode 100644 TINKLib/Services/Permissions/Plugin/LocationPermissions.cs diff --git a/LastenradBayern/TINK.Android/MainActivity.cs b/LastenradBayern/TINK.Android/MainActivity.cs index ad35929..d73928b 100644 --- a/LastenradBayern/TINK.Android/MainActivity.cs +++ b/LastenradBayern/TINK.Android/MainActivity.cs @@ -85,21 +85,21 @@ namespace TINK.Droid } }; - await Permissions.RequestAsync(); - LoadApplication(new App()); + await Permissions.RequestAsync(); + await Permissions.RequestAsync(); } //Bluetooth Permission on Android 12 "Detect Devices nearby" // https://stackoverflow.com/questions/71028853/xamarin-forms-ble-plugin-scan-issue-android-12 - public class BLEAndLocationPermissions : BasePlatformPermission + public class BLEPermissions : BasePlatformPermission { public override (string androidPermission, bool isRuntime)[] RequiredPermissions => new List<(string androidPermission, bool isRuntime)> { (Android.Manifest.Permission.BluetoothScan, true), (Android.Manifest.Permission.BluetoothConnect, true), - (Android.Manifest.Permission.AccessFineLocation, true) + //(Android.Manifest.Permission.AccessFineLocation, true) }.ToArray(); } diff --git a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml index 6d34b3b..787dc31 100644 --- a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml +++ b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/LastenradBayern/TINK.Android/Resources/drawable/Location_Button.png b/LastenradBayern/TINK.Android/Resources/drawable/Location_Button.png index 1da5e0e649f8598039b306dfa4389eb017c2be77..124b7111de8ad41f38a5bca4785e1a7423ad3967 100644 GIT binary patch delta 1789 zcmVG1iZO$t0@7b8hvWoht|}B zKiX28^r30e#57IY_x=I?1+=kgnwa(-sfvwlOzKM?YU73IVylJTs|5tKQY`XAklp*x zt66bZ*#&Gges6PTcjkPYnKR#<1rh`?1&%N{zuSRg@R;CX$1%af4p=OymQJT3hGFH?)6*4!KtQm#xL8K+S1Oh3GMOx))9Ka> z2167<5WE*bG(jL7EZ=ESK~ikr(j2!h}Z4Gn8XqcNaTsS<_sr(gub;c$t~ zW~-f=nyMlQ0)Mh{20~yk7*@?@^Ad`psY3Ww5Q3jSe=d9e{JA<7ixosTAPADVb?er@ zt*xzV`Hq!0!SV6&>Q}E`)nzi7T~QN@#VL(O6Vd5(KNSi^qO`O$0{{T=c%19=`S`Q5 zvm%$vRS}6qPV90FLZYLi!{5=-5z5EEya=hL_yxe5JIB2xA$vvb2F>u%IX{phr=ZU0|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zmD0*rGc0@^*u)Ret`{rb-{Gc%u0MUThBlgVTYbYnFdjoa;ZCv>E%)#^zmo7?T? zQDvb}h~K((t2Yt90Kjqu^YZd=s*Iv2BY{JQ4o&9g=g+O>lgHx)o12>%%OShnzG9Bt z++0>I4ORrzYW0ee#pQB+&*&I}$bTzWuDq5=BpB0}?Ck8o<;$0UTP-t*pF^cmvC4T_ z5!7n6GcXJ<$K*gD@SVkCkuZ%HiA15RSFa8nJ$m$ai9|97!|*bP!-?kPR9%06zh-D?D37f#CZH%P?CI&*Pt_F_ z6-`xCR50#mCM0za8jVJKe1BWv;lqcuR;zW*+;c5B91hXFd-r~fMx&gV4u;`ngTY`= z#$Qqd^Yil;TU%S-P_va#D3sCO-d=AuoA(d|?VY_QdV6~d@7}%J`03N9&;3;p1c8$$ zPg>%0(nOI`+wk$@$0g67Ki?Ox&&$jEN3Yk9XtmneMEp3NPSKMmPk$=ts*l>*TIacQ z=N!q#m~!Ly(W6H{ynOkxoUUCj6bf;rQaN2-Uj9L$P<-U``5^%KKgDyq-8{S9E_JzF zGP-^!2!cROO^x%+nKKTinlllkrFB0zI4JGx?5qxjLMi2qF>pAX=<(ynhmIUM;!f39 z+CIKaO-*r4CR5qy=zr)gl1#pkC@LzNHW&;et0e$zkoM1KD2fUZ1W|cB9x2`T3OYa# zM9AgxS)ESjOy(+B4eRy+G#CuR7K=sdbUI~ob94Oo0$3yx&FAFg;H9Odz5@pi_}FGB ziDKOd#$)S$GV6pbf*T!M1UEXq+9~?2u<2KDi{M7brYHCxdlOpaFc<`kVgLXD07*qo IM6N<$g1E|ePyhe` diff --git a/LastenradBayern/TINK.iOS/Info.plist b/LastenradBayern/TINK.iOS/Info.plist index 603386b..e1f93ef 100644 --- a/LastenradBayern/TINK.iOS/Info.plist +++ b/LastenradBayern/TINK.iOS/Info.plist @@ -55,8 +55,8 @@ CFBundleDisplayName LastenradBayern CFBundleVersion - 352 + 353 CFBundleShortVersionString - 3.0.352 + 3.0.353 diff --git a/LastenradBayern/TINK.iOS/Media.xcassets/Location_Button.imageset/Location_Button.pdf b/LastenradBayern/TINK.iOS/Media.xcassets/Location_Button.imageset/Location_Button.pdf index 625565c..32c2eb1 100644 --- a/LastenradBayern/TINK.iOS/Media.xcassets/Location_Button.imageset/Location_Button.pdf +++ b/LastenradBayern/TINK.iOS/Media.xcassets/Location_Button.imageset/Location_Button.pdf @@ -41,7 +41,7 @@ endobj 6 0 obj << /Producer (cairo 1.17.4 (https://cairographics.org)) /Creator - /CreationDate (D:20221124081702+01'00) + /CreationDate (D:20221206105042+01'00) >> endobj 7 0 obj diff --git a/LastenradBayern/TINK/App.xaml.cs b/LastenradBayern/TINK/App.xaml.cs index e2abf72..d5844a9 100644 --- a/LastenradBayern/TINK/App.xaml.cs +++ b/LastenradBayern/TINK/App.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -322,7 +322,7 @@ namespace TINK if (_PermissionsService != null) return _PermissionsService; - _PermissionsService = new TINK.Services.Permissions.Essentials.Permissions(); + _PermissionsService = new TINK.Services.Permissions.Essentials.LocationPermissions(); return _PermissionsService; } } diff --git a/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml b/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml index 29d9c63..8329322 100644 --- a/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml +++ b/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml @@ -96,7 +96,7 @@ - diff --git a/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml b/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml index b740d4a..d883915 100644 --- a/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml +++ b/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml @@ -1,10 +1,11 @@ - + + x:Class="TINK.View.Contact.SelectStationPage" + BackgroundColor="{DynamicResource Key=primary-back-title-color}"> \ No newline at end of file + diff --git a/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml b/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml index 294b21b..359a86a 100644 --- a/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml +++ b/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml @@ -56,7 +56,7 @@ - diff --git a/LastenradBayern/TINK/View/MyBikes/MyBikesPage.xaml b/LastenradBayern/TINK/View/MyBikes/MyBikesPage.xaml index 81b4d1d..ba57952 100644 --- a/LastenradBayern/TINK/View/MyBikes/MyBikesPage.xaml +++ b/LastenradBayern/TINK/View/MyBikes/MyBikesPage.xaml @@ -53,7 +53,7 @@ - diff --git a/Meinkonrad/TINK.Android/Assets/Location_Pin.png b/Meinkonrad/TINK.Android/Assets/Location_Pin.png index 4ead5e88b0409650e1428c4428bb04404d99b2eb..987c96020951a2f0477ff2ba6cf0c5411e67dc29 100644 GIT binary patch delta 1626 zcmV-g2BrDL4uTCKiBL{Q4GJ0x0000DNk~Le0000m0000m2nGNE09OL}hmj#Ye-BAS zK~!jg)tXyuR8PM>T9R~4Ww5#e)Rm~nO9~lJkcwiIoCNMr!n>(F8s_VU6_IPQy z-HEru2S8GSi_D1$)Fz;+`9K*kFSyRrf7-#~XYlB~sT3Au@WR4OGAAa4YIY7-E+SWkJpol+3VcDYK>~2$dK=rz zuW|U727Em_&@dt4b_vftlF8=68O+U@5L|s5SS=#ohZ`g81XT59;8VbD$(p@gZ2PX3 z-AC)_(V-FVLqg!iMbp^ve?mT!C&b&Ue84&p+1GF1{wh?p7}#T%ovgXV%Doq;Z|N8= z=a9%qiRY`e^LXlhhf`8ut%!UUs!zxX_|>Ki2w2`=ORMk6axAy8WYMSuR@&XWB)#fro<)f7{{D{I2p4HuAfV z*2SDWz}CZ8*n9lCU6cYGQq?%SFxVk)0v@mmKi1r0AQyO_K66gNl6U?W9#S|S%q7Lk?|Son4zUqtG`xdX3b`@_Cbc6rpv z1Keo7%htmVwND0Kf3pe#=D`g33;zUut83%Iw<@FN=Z6bJg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r%tVTfyX<;v;qULbchN5; z0CT5ie>&a6qmrewa;%GB5U7D6b4saJ;A8WQCznr4mcF=f(D{*4ss+MRd(WC@TstG1 zTj&2H!P4Sm#e!U}F3hrq4IhR%rPLlEtQ7R(>LN1j+nQ0q_;e2&D+;aQPn1%|tIe8D zUx%J^2lOq?8~4pjoWeNR{J<;I$V`9Uy zsoZ9NWS&z>h3&R%#mAvK*LT3&P%J1y#jA%#MapkwSuWLU=2$DNdx1sPHjd#ctCs-{ z=)GD14ElpqZaPfe2-fLVmgQ3Qpkrlqu2RaDS9dBtGSug>0=>BffE16$)`#b??uL=M ze?>Pen@aVXIaXtX!0k@P;QZYTtAV$%{1ZNGIK};&kI>n7*7-me$xQd~`n@xqwuC`o zwNk2PxML&fL#Y6^VCh3??Hb_my5kA&LwWhGVy5KSK12tBdz4aJ&vksH9Yi;vw?^6e zmUcIF@br!o>^$OLtK{{wa`^Z1X-+R_e}FFF4yDx2^PMM}-me1mJzJU6`2OE|sQRXr znmvDTsyq5xL*9f`$`|Hx_o7MX`e5FN-Wp|V%WxvvuDw+Bu7O9;YtS}=A{=h+<;%tn z4mJB|Z0)6`bAaA{KV7H&Ot{d)MQI-Lv(hMa~n<9 zUQCEck%)Ynq<+hfMZ~txN;o2NrHFhedS|Pf_(kLc5t*NKQw}C4ipT~LsgJ{`f9Ux2 zB4X=ei-oA3xkwO^EZ`boKH=Tz7ooQ@bpySGcc=e=-ksj%rk4K$ZdgF%q#Iyy00000 LNkvXXu0mjffNh$_ diff --git a/Meinkonrad/TINK.Android/MainActivity.cs b/Meinkonrad/TINK.Android/MainActivity.cs index 7256018..7ae866c 100644 --- a/Meinkonrad/TINK.Android/MainActivity.cs +++ b/Meinkonrad/TINK.Android/MainActivity.cs @@ -85,21 +85,21 @@ namespace TINK.Droid } }; - await Permissions.RequestAsync(); - LoadApplication(new App()); + await Permissions.RequestAsync(); + await Permissions.RequestAsync(); } //Bluetooth Permission on Android 12 "Detect Devices nearby" // https://stackoverflow.com/questions/71028853/xamarin-forms-ble-plugin-scan-issue-android-12 - public class BLEAndLocationPermissions : BasePlatformPermission + public class BLEPermissions : BasePlatformPermission { public override (string androidPermission, bool isRuntime)[] RequiredPermissions => new List<(string androidPermission, bool isRuntime)> { (Android.Manifest.Permission.BluetoothScan, true), (Android.Manifest.Permission.BluetoothConnect, true), - (Android.Manifest.Permission.AccessFineLocation, true) + //(Android.Manifest.Permission.AccessFineLocation, true) }.ToArray(); } diff --git a/Meinkonrad/TINK.Android/Properties/AndroidManifest.xml b/Meinkonrad/TINK.Android/Properties/AndroidManifest.xml index c8465ee..beaeb5e 100644 --- a/Meinkonrad/TINK.Android/Properties/AndroidManifest.xml +++ b/Meinkonrad/TINK.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/Meinkonrad/TINK.Android/Resources/drawable/Location_Button.png b/Meinkonrad/TINK.Android/Resources/drawable/Location_Button.png index 1da5e0e649f8598039b306dfa4389eb017c2be77..124b7111de8ad41f38a5bca4785e1a7423ad3967 100644 GIT binary patch delta 1789 zcmVG1iZO$t0@7b8hvWoht|}B zKiX28^r30e#57IY_x=I?1+=kgnwa(-sfvwlOzKM?YU73IVylJTs|5tKQY`XAklp*x zt66bZ*#&Gges6PTcjkPYnKR#<1rh`?1&%N{zuSRg@R;CX$1%af4p=OymQJT3hGFH?)6*4!KtQm#xL8K+S1Oh3GMOx))9Ka> z2167<5WE*bG(jL7EZ=ESK~ikr(j2!h}Z4Gn8XqcNaTsS<_sr(gub;c$t~ zW~-f=nyMlQ0)Mh{20~yk7*@?@^Ad`psY3Ww5Q3jSe=d9e{JA<7ixosTAPADVb?er@ zt*xzV`Hq!0!SV6&>Q}E`)nzi7T~QN@#VL(O6Vd5(KNSi^qO`O$0{{T=c%19=`S`Q5 zvm%$vRS}6qPV90FLZYLi!{5=-5z5EEya=hL_yxe5JIB2xA$vvb2F>u%IX{phr=ZU0|P2DIRruQJ9qAQu3o(wWJ(TzUq6n~ zXk5N`?|+_~&*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joa;ZCv>E%)#^zmo7?T? zQDvb}h~K((t2Yt90Kjqu^YZd=s*Iv2BY{JQ4o&9g=g+O>lgHx)o12>%%OShnzG9Bt z++0>I4ORrzYW0ee#pQB+&*&I}$bTzWuDq5=BpB0}?Ck8o<;$0UTP-t*pF^cmvC4T_ z5!7n6GcXJ<$K*gD@SVkCkuZ%HiA15RSFa8nJ$m$ai9|97!|*bP!-?kPR9%06zh-D?D37f#CZH%P?CI&*Pt_F_ z6-`xCR50#mCM0za8jVJKe1BWv;lqcuR;zW*+;c5B91hXFd-r~fMx&gV4u;`ngTY`= z#$Qqd^Yil;TU%S-P_va#D3sCO-d=AuoA(d|?VY_QdV6~d@7}%J`03N9&;3;p1c8$$ zPg>%0(nOI`+wk$@$0g67Ki?Ox&&$jEN3Yk9XtmneMEp3NPSKMmPk$=ts*l>*TIacQ z=N!q#m~!Ly(W6H{ynOkxoUUCj6bf;rQaN2-Uj9L$P<-U``5^%KKgDyq-8{S9E_JzF zGP-^!2!cROO^x%+nKKTinlllkrFB0zI4JGx?5qxjLMi2qF>pAX=<(ynhmIUM;!f39 z+CIKaO-*r4CR5qy=zr)gl1#pkC@LzNHW&;et0e$zkoM1KD2fUZ1W|cB9x2`T3OYa# zM9AgxS)ESjOy(+B4eRy+G#CuR7K=sdbUI~ob94Oo0$3yx&FAFg;H9Odz5@pi_}FGB ziDKOd#$)S$GV6pbf*T!M1UEXq+9~?2u<2KDi{M7brYHCxdlOpaFc<`kVgLXD07*qo IM6N<$g1E|ePyhe` diff --git a/Meinkonrad/TINK.iOS/Info.plist b/Meinkonrad/TINK.iOS/Info.plist index 2bcc4a3..55c2a3a 100644 --- a/Meinkonrad/TINK.iOS/Info.plist +++ b/Meinkonrad/TINK.iOS/Info.plist @@ -55,8 +55,8 @@ CFBundleDisplayName Mein konrad CFBundleVersion - 352 + 353 CFBundleShortVersionString - 3.0.352 + 3.0.353 diff --git a/Meinkonrad/TINK.iOS/Media.xcassets/Location_Button.imageset/Location_Button.pdf b/Meinkonrad/TINK.iOS/Media.xcassets/Location_Button.imageset/Location_Button.pdf index 625565c..32c2eb1 100644 --- a/Meinkonrad/TINK.iOS/Media.xcassets/Location_Button.imageset/Location_Button.pdf +++ b/Meinkonrad/TINK.iOS/Media.xcassets/Location_Button.imageset/Location_Button.pdf @@ -41,7 +41,7 @@ endobj 6 0 obj << /Producer (cairo 1.17.4 (https://cairographics.org)) /Creator - /CreationDate (D:20221124081702+01'00) + /CreationDate (D:20221206105042+01'00) >> endobj 7 0 obj diff --git a/Meinkonrad/TINK/App.xaml.cs b/Meinkonrad/TINK/App.xaml.cs index 849a4ad..b56a8fc 100644 --- a/Meinkonrad/TINK/App.xaml.cs +++ b/Meinkonrad/TINK/App.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -320,7 +320,7 @@ namespace TINK if (_PermissionsService != null) return _PermissionsService; - _PermissionsService = new TINK.Services.Permissions.Essentials.Permissions(); + _PermissionsService = new TINK.Services.Permissions.Essentials.LocationPermissions(); return _PermissionsService; } } diff --git a/Meinkonrad/TINK/View/BikesAtStation/BikesAtStationPage.xaml b/Meinkonrad/TINK/View/BikesAtStation/BikesAtStationPage.xaml index e6c7433..98a96cb 100644 --- a/Meinkonrad/TINK/View/BikesAtStation/BikesAtStationPage.xaml +++ b/Meinkonrad/TINK/View/BikesAtStation/BikesAtStationPage.xaml @@ -7,7 +7,7 @@ xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View" Shell.FlyoutBehavior="Disabled" Shell.NavBarIsVisible="{Binding IsIdle}"> - + @@ -15,7 +15,7 @@ Text="{Binding Title}"/> - + @@ -24,36 +24,37 @@ - + + - - - - - - - + - - + + - - + + + - - + + + + + + Grid.Row="0"/> - - - + + diff --git a/Meinkonrad/TINK/View/Contact/SelectStationPage.xaml b/Meinkonrad/TINK/View/Contact/SelectStationPage.xaml index cdf0fff..6e6a31b 100644 --- a/Meinkonrad/TINK/View/Contact/SelectStationPage.xaml +++ b/Meinkonrad/TINK/View/Contact/SelectStationPage.xaml @@ -1,56 +1,137 @@ - + - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Meinkonrad/TINK/View/FindBike/FindBikePage.xaml b/Meinkonrad/TINK/View/FindBike/FindBikePage.xaml index 294b21b..93f91e6 100644 --- a/Meinkonrad/TINK/View/FindBike/FindBikePage.xaml +++ b/Meinkonrad/TINK/View/FindBike/FindBikePage.xaml @@ -21,47 +21,61 @@ - + + - - - - - + - - - + - - - - + + + + + + + - - + - + - - - + + + + + + diff --git a/Meinkonrad/TINK/View/MyBikes/MyBikesPage.xaml b/Meinkonrad/TINK/View/MyBikes/MyBikesPage.xaml index 81b4d1d..5e39fce 100644 --- a/Meinkonrad/TINK/View/MyBikes/MyBikesPage.xaml +++ b/Meinkonrad/TINK/View/MyBikes/MyBikesPage.xaml @@ -1,5 +1,6 @@ - + @@ -22,21 +24,19 @@ - + + - - - - - + - + + + - - + + diff --git a/ShareeSharedGuiLib/ShareeSharedGuiLib.projitems b/ShareeSharedGuiLib/ShareeSharedGuiLib.projitems index b6af761..abc548b 100644 --- a/ShareeSharedGuiLib/ShareeSharedGuiLib.projitems +++ b/ShareeSharedGuiLib/ShareeSharedGuiLib.projitems @@ -33,6 +33,9 @@ RunningProcessView.xaml Code + + RunningProcessViewBay.xaml + VersionNumberView.xaml @@ -58,4 +61,10 @@ MSBuild:UpdateDesignTimeXaml + + + Designer + MSBuild:UpdateDesignTimeXaml + + \ No newline at end of file diff --git a/ShareeSharedGuiLib/View/BarLevelInputView.xaml b/ShareeSharedGuiLib/View/BarLevelInputView.xaml index dc133ee..29c0b5f 100644 --- a/ShareeSharedGuiLib/View/BarLevelInputView.xaml +++ b/ShareeSharedGuiLib/View/BarLevelInputView.xaml @@ -1,4 +1,4 @@ - + - \ No newline at end of file + diff --git a/ShareeSharedGuiLib/View/BarLevelView.xaml b/ShareeSharedGuiLib/View/BarLevelView.xaml index 42b4426..16aa6ce 100644 --- a/ShareeSharedGuiLib/View/BarLevelView.xaml +++ b/ShareeSharedGuiLib/View/BarLevelView.xaml @@ -10,11 +10,13 @@ WidthRequest="50" HeightRequest="30" Aspect="AspectFit" + HorizontalOptions="CenterAndExpand" IsVisible="{Binding IsBatteryChargeLevelImageVisible}" Source="{Binding BatteryChargeLevelImageSourceString}"/> - + - + + - - - - - - - + - - + + - - + + + - + + + + + + Grid.Row="0"/> + + - - - - + diff --git a/TINK/TINK/View/Contact/SelectStationPage.xaml b/TINK/TINK/View/Contact/SelectStationPage.xaml index de1e44c..82cf6d7 100644 --- a/TINK/TINK/View/Contact/SelectStationPage.xaml +++ b/TINK/TINK/View/Contact/SelectStationPage.xaml @@ -1,55 +1,136 @@ - + - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TINK/TINK/View/FindBike/FindBikePage.xaml b/TINK/TINK/View/FindBike/FindBikePage.xaml index fe62a0a..a1faa98 100644 --- a/TINK/TINK/View/FindBike/FindBikePage.xaml +++ b/TINK/TINK/View/FindBike/FindBikePage.xaml @@ -19,42 +19,56 @@ - + - - - + - - - - - - + - - - - + + + + + - - + + + + + + + + + - + - - - + + + + - - diff --git a/TINK/TINK/View/MyBikes/MyBikesPage.xaml b/TINK/TINK/View/MyBikes/MyBikesPage.xaml index d97aab9..0895ef2 100644 --- a/TINK/TINK/View/MyBikes/MyBikesPage.xaml +++ b/TINK/TINK/View/MyBikes/MyBikesPage.xaml @@ -14,30 +14,28 @@ Text="{x:Static resources:AppResources.MarkingMyBikes}"/> - + - + - + + - - - - - + - + - - + + + + + + - - - - + + + diff --git a/TINKLib/Model/WhatsNew.cs b/TINKLib/Model/WhatsNew.cs index a4e71b5..5cb55af 100644 --- a/TINKLib/Model/WhatsNew.cs +++ b/TINKLib/Model/WhatsNew.cs @@ -652,6 +652,11 @@ namespace TINK.Model AppResources.ChangeLog_MinorDesignImprovements, new List { AppFlavor.MeinKonrad, AppFlavor.ShareeBike } }, + { + new Version(3, 0, 353), + AppResources.ChangeLog_3_0_353_MK_SB, + new List { AppFlavor.MeinKonrad, AppFlavor.ShareeBike } + }, }; /// Manges the whats new information. diff --git a/TINKLib/MultilingualResources/AppResources.Designer.cs b/TINKLib/MultilingualResources/AppResources.Designer.cs index 569aea9..9153157 100644 --- a/TINKLib/MultilingualResources/AppResources.Designer.cs +++ b/TINKLib/MultilingualResources/AppResources.Designer.cs @@ -259,7 +259,7 @@ namespace TINK.MultilingualResources { } /// - /// Looks up a localized string similar to <h4><b>Lock is closing.<br/>Please visually check if it is completely closed.</b></h4>. + /// Looks up a localized string similar to <h4><b>Lock is closing.<br/>Please wait until it is completely closed.</b></h4>. /// public static string ActivityTextClosingLock { get { @@ -349,7 +349,7 @@ namespace TINK.MultilingualResources { } /// - /// Looks up a localized string similar to No location info available.. + /// Looks up a localized string similar to No location info available. Activate your device's location services.. /// public static string ActivityTextErrorQueryLocationWhenAny { get { @@ -628,7 +628,7 @@ namespace TINK.MultilingualResources { } /// - /// Looks up a localized string similar to Updateing..... + /// Looks up a localized string similar to Updating..... /// public static string ActivityTextUpdating { get { @@ -725,6 +725,19 @@ namespace TINK.MultilingualResources { } } + /// + /// Looks up a localized string similar to Improvements in + ///<ul> + ///<li/>- Management of location services + ///<li/>- Design of processes + ///</ul>. + /// + public static string ChangeLog_3_0_353_MK_SB { + get { + return ResourceManager.GetString("ChangeLog_3_0_353_MK_SB", resourceCulture); + } + } + /// /// Looks up a localized string similar to We have fixed some bugs. Enjoy the ride!. /// @@ -2524,6 +2537,15 @@ namespace TINK.MultilingualResources { } } + /// + /// Looks up a localized string similar to Turn on your device's location services to center the map on your current location.. + /// + public static string MessageErrorLocationIsOff { + get { + return ResourceManager.GetString("MessageErrorLocationIsOff", resourceCulture); + } + } + /// /// Looks up a localized string similar to Attention: Lock is closed! ///{0} diff --git a/TINKLib/MultilingualResources/AppResources.de.resx b/TINKLib/MultilingualResources/AppResources.de.resx index 7a324e9..d8394cf 100644 --- a/TINKLib/MultilingualResources/AppResources.de.resx +++ b/TINKLib/MultilingualResources/AppResources.de.resx @@ -334,7 +334,7 @@ Freigabedialog öffen? Einen Moment bitte... - <h4><b>Schloss öffnet.<br/>Bitte warten Sie, bis es komplett geöffnet ist.</b></h4> + <h4><b>Schloss öffnet.<br/>Bitte warten Sie bis es komplett geöffnet ist.</b></h4> Starte Aktualisierung... @@ -355,7 +355,7 @@ Freigabedialog öffen? Kein Netz beim Aktualisieren des Schlossstatusses. - <h4><b>Schloss schließt.<br/>Bitte überprüfen Sie visuell, ob es komplett geschlossen ist.</b></h4> + <h4><b>Schloss schließt.<br/>Bitte warten Sie bis es komplett geschlossen ist.</b></h4> Aktualisierrt auf aktuelle Schloss-Firmware. @@ -666,7 +666,7 @@ Kleinere Verbesserungen. Fehler beim Start der Standortabfrage! - Keine Standortinfo verfügbar. + Keine Standortinfo verfügbar. Aktivieren Sie die Standortdienste Ihres Geräts. Standortabfrage nicht möglich. @@ -1098,4 +1098,14 @@ Beim Login können Sie nun Ihr eingegebenes Passwort einsehen.<br/> <br/> Probieren Sie es aus! + + Schalten Sie die Standortdienste Ihres Geräts ein, um die Karte auf Ihren aktuellen Standort zu zentrieren. + + + Verbesserungen im +<ul> +<li/>- Management der Standortdienste +<li/>- Design von Prozessen +</ul> + \ No newline at end of file diff --git a/TINKLib/MultilingualResources/AppResources.resx b/TINKLib/MultilingualResources/AppResources.resx index 9fd628e..61c3057 100644 --- a/TINKLib/MultilingualResources/AppResources.resx +++ b/TINKLib/MultilingualResources/AppResources.resx @@ -460,7 +460,7 @@ Open sharing dialog? No web error on updating locking status. - <h4><b>Lock is closing.<br/>Please visually check if it is completely closed.</b></h4> + <h4><b>Lock is closing.<br/>Please wait until it is completely closed.</b></h4> Updated to latest lock firmware. @@ -662,7 +662,7 @@ Please contact the support for help. Submitting feedback failed! - Updateing.... + Updating.... Minor improvements. @@ -756,7 +756,7 @@ Minor fixes. Can not query location info. - No location info available. + No location info available. Activate your device's location services. Query location... @@ -1188,4 +1188,14 @@ When logging in, you can now view the password you entered. <br/> <br/> Try it out! + + Turn on your device's location services to center the map on your current location. + + + Improvements in +<ul> +<li/>- Management of location services +<li/>- Design of processes +</ul> + diff --git a/TINKLib/MultilingualResources/TINKLib.de.xlf b/TINKLib/MultilingualResources/TINKLib.de.xlf index 20f5278..52cb889 100644 --- a/TINKLib/MultilingualResources/TINKLib.de.xlf +++ b/TINKLib/MultilingualResources/TINKLib.de.xlf @@ -442,7 +442,7 @@ Freigabedialog öffen? <h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4> - <h4><b>Schloss öffnet.<br/>Bitte warten Sie, bis es komplett geöffnet ist.</b></h4> + <h4><b>Schloss öffnet.<br/>Bitte warten Sie bis es komplett geöffnet ist.</b></h4> Updating... @@ -469,8 +469,8 @@ Freigabedialog öffen? Kein Netz beim Aktualisieren des Schlossstatusses. - <h4><b>Lock is closing.<br/>Please visually check if it is completely closed.</b></h4> - <h4><b>Schloss schließt.<br/>Bitte überprüfen Sie visuell, ob es komplett geschlossen ist.</b></h4> + <h4><b>Lock is closing.<br/>Please wait until it is completely closed.</b></h4> + <h4><b>Schloss schließt.<br/>Bitte warten Sie bis es komplett geschlossen ist.</b></h4> Updated to latest lock firmware. @@ -744,7 +744,7 @@ Bitte kontaktieren sie den Support! Übermittlung der Rückmeldung fehlgeschlagen! - Updateing.... + Updating.... Aktualisiere.... @@ -892,8 +892,8 @@ Kleinere Verbesserungen. Fehler beim Start der Standortabfrage! - No location info available. - Keine Standortinfo verfügbar. + No location info available. Activate your device's location services. + Keine Standortinfo verfügbar. Aktivieren Sie die Standortdienste Ihres Geräts. Can not query location info. @@ -1500,6 +1500,22 @@ Beim Login können Sie nun Ihr eingegebenes Passwort einsehen.<br/> <br/> Probieren Sie es aus! + + Turn on your device's location services to center the map on your current location. + Schalten Sie die Standortdienste Ihres Geräts ein, um die Karte auf Ihren aktuellen Standort zu zentrieren. + + + Improvements in +<ul> +<li/>- Management of location services +<li/>- Design of processes +</ul> + Verbesserungen im +<ul> +<li/>- Management der Standortdienste +<li/>- Design von Prozessen +</ul> + diff --git a/TINKLib/Services/Permissions/Essentials/LocationPermissions.cs b/TINKLib/Services/Permissions/Essentials/LocationPermissions.cs new file mode 100644 index 0000000..1a75f5b --- /dev/null +++ b/TINKLib/Services/Permissions/Essentials/LocationPermissions.cs @@ -0,0 +1,80 @@ +using System.Threading.Tasks; +using Xamarin.Essentials; + +namespace TINK.Services.Permissions.Essentials +{ + using XamPermission = Xamarin.Essentials.Permissions; + using XamPermissionStatus = PermissionStatus; + + public class LocationPermissions : ILocationPermission + { + /// Checks the permission status. + /// Current permission status. + public async Task CheckStatusAsync() + { + var status = await XamPermission.CheckStatusAsync(); + if (status == XamPermissionStatus.Granted) + { + return Status.Granted; + } + + if (status == XamPermissionStatus.Denied + && DeviceInfo.Platform == DevicePlatform.iOS) + { + // Prompt the user to turn on in settings + // On iOS once a permission has been denied it may not be requested again from the application + return Status.DeniedRequiresSettingsUI; + } + + if (XamPermission.ShouldShowRationale()) + { + // Prompt the user with additional information as to why the permission is needed + return Status.Denied; + } + + switch (status) + { + case XamPermissionStatus.Unknown: + case XamPermissionStatus.Denied: // Map Denied to unknown because "denied means user did not allow access to location". + return Status.Unknown; + + default: + // Comprises: + // - XamPermissionStatus.Restricted: + // - XamPermissionStatus.Disabled + // Perission XamPermissionStatus.Granted is handled above. + return Status.DeniedRequiresSettingsUI; + } + } + + /// Requests location permission. + /// Permission status after request. + public async Task RequestAsync() + { + switch (await XamPermission.RequestAsync()) + { + case XamPermissionStatus.Unknown: + return Status.Unknown; + + case XamPermissionStatus.Denied: + return Status.Denied; + + case XamPermissionStatus.Granted: + return Status.Granted; + + default: + // Comprises: + // - XamPermissionStatus.Restricted: + // - XamPermissionStatus.Disabled + return Status.DeniedRequiresSettingsUI; + } + } + + /// Opens app settings dialog. + public bool OpenAppSettings() + { + AppInfo.ShowSettingsUI(); + return true; + } + } +} diff --git a/TINKLib/Services/Permissions/Plugin/LocationPermissions.cs b/TINKLib/Services/Permissions/Plugin/LocationPermissions.cs new file mode 100644 index 0000000..c673d67 --- /dev/null +++ b/TINKLib/Services/Permissions/Plugin/LocationPermissions.cs @@ -0,0 +1,59 @@ +using System.Threading.Tasks; + + +namespace TINK.Services.Permissions.Plugin +{ + using global::Plugin.Permissions; + + public class LocationPermissions : ILocationPermission + { + /// Checks the permission status. + public async Task CheckStatusAsync() + { + switch (await CrossPermissions.Current.CheckPermissionStatusAsync()) + { + case global::Plugin.Permissions.Abstractions.PermissionStatus.Denied: + return Status.Denied; + + case global::Plugin.Permissions.Abstractions.PermissionStatus.Granted: + return Status.Granted; + + case global::Plugin.Permissions.Abstractions.PermissionStatus.Unknown: + return Status.Unknown; + + default: + // Comprises + // - PermissionStatus.Disabled and + // - PermissionStatus.Restricted. + return Status.DeniedRequiresSettingsUI; + } + } + + /// Requests location permission. + /// Permission status after request. + public async Task RequestAsync() + { + switch (await CrossPermissions.Current.RequestPermissionAsync()) + { + case global::Plugin.Permissions.Abstractions.PermissionStatus.Denied: + return Status.Denied; + + case global::Plugin.Permissions.Abstractions.PermissionStatus.Granted: + return Status.Granted; + + case global::Plugin.Permissions.Abstractions.PermissionStatus.Unknown: + return Status.Unknown; + + default: + // Comprises + // - PermissionStatus.Disabled and + // - PermissionStatus.Restricted. + return Status.DeniedRequiresSettingsUI; + } + } + + /// Opens app settings dialog. + public bool OpenAppSettings() + => CrossPermissions.Current.OpenAppSettings(); + } +} diff --git a/TINKLib/ViewModel/BikesAtStation/BikesAtStationPageViewModel.cs b/TINKLib/ViewModel/BikesAtStation/BikesAtStationPageViewModel.cs index 790808d..c060400 100644 --- a/TINKLib/ViewModel/BikesAtStation/BikesAtStationPageViewModel.cs +++ b/TINKLib/ViewModel/BikesAtStation/BikesAtStationPageViewModel.cs @@ -244,15 +244,12 @@ namespace TINK.ViewModel.BikesAtStation // Check location permissions. if (bikesAtStation.GetLockIt().Count > 0 - && RuntimePlatform == Device.Android) + && RuntimePlatform == Device.Android + ) { var status = await PermissionsService.CheckStatusAsync(); if (status != Status.Granted) { - var permissionResult = await PermissionsService.RequestAsync(); - - if (permissionResult != Status.Granted) - { var dialogResult = await ViewService.DisplayAlert( AppResources.MessageTitleHint, AppResources.MessageBikesManagementLocationPermissionOpenDialog, @@ -270,10 +267,11 @@ namespace TINK.ViewModel.BikesAtStation IsIdle = true; return; } - - // Open permissions dialog. - PermissionsService.OpenAppSettings(); - } + else if (dialogResult) + { + // Open permissions dialog. + PermissionsService.OpenAppSettings(); + } } if (Geolocation.IsGeolcationEnabled == false) diff --git a/TINKLib/ViewModel/Contact/SelectStationPageViewModel.cs b/TINKLib/ViewModel/Contact/SelectStationPageViewModel.cs index da41b6f..f759090 100644 --- a/TINKLib/ViewModel/Contact/SelectStationPageViewModel.cs +++ b/TINKLib/ViewModel/Contact/SelectStationPageViewModel.cs @@ -191,28 +191,32 @@ namespace TINK.ViewModel.Contact } //Add blue dot for showing current location of user - Location currentLocation = null; - try + var status = await PermissionsService.CheckStatusAsync(); + if (status == Status.Granted) { - currentLocation = await GeolocationService.GetAsync(); - } - catch (Exception ex) - { - Log.ForContext().Error("Getting location failed. {Exception}", ex); - } - - if (currentLocation != null) - { - var currentLocationPin = new Pin() + Location currentLocation = null; + try { - Position = new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude), - Label = "currentLocationPin", - Type = PinType.Place, - Tag = "NotClickable", - Icon = BitmapDescriptorFactory.FromBundle(currentLocationPinName) - }; + currentLocation = await GeolocationService.GetAsync(); + } + catch (Exception ex) + { + Log.ForContext().Error("Getting location failed. {Exception}", ex); + } - Pins.Add(currentLocationPin); + if (currentLocation != null) + { + var currentLocationPin = new Pin() + { + Position = new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude), + Label = "currentLocationPin", + Type = PinType.Place, + Tag = "NotClickable", + Icon = BitmapDescriptorFactory.FromBundle(currentLocationPinName) + }; + + Pins.Add(currentLocationPin); + } } } @@ -313,17 +317,15 @@ namespace TINK.ViewModel.Contact if (Pins.Count <= 0) { - ActionText = AppResources.ActivityTextRequestingLocationPermissions; - - // Check location permission - var status = await PermissionsService.CheckStatusAsync(); - if (TinkApp.CenterMapToCurrentLocation - && !GeolocationService.IsSimulation - && status != Status.Granted) + // Move and scale before getting stations and bikes which takes some time. + if (TinkApp.CenterMapToCurrentLocation) { - var permissionResult = await PermissionsService.RequestAsync(); + ActionText = AppResources.ActivityTextRequestingLocationPermissions; - if (permissionResult != Status.Granted) + // Check location permission + var status = await PermissionsService.CheckStatusAsync(); + if (!GeolocationService.IsSimulation + && status != Status.Granted) { var dialogResult = await ViewService.DisplayAlert( AppResources.MessageTitleHint, @@ -341,23 +343,25 @@ namespace TINK.ViewModel.Contact return; } } - } + if (status == Status.Granted) + { + ActionText = AppResources.ActivityTextCenterMap; - // Move and scale before getting stations and bikes which takes some time. - ActionText = AppResources.ActivityTextCenterMap; - Location currentLocation = null; - try - { - currentLocation = TinkApp.CenterMapToCurrentLocation - ? await GeolocationService.GetAsync() - : null; - } - catch (Exception ex) - { - Log.ForContext().Error("Getting location failed. {Exception}", ex); - } + Location currentLocation = null; + try + { + currentLocation = TinkApp.CenterMapToCurrentLocation + ? await GeolocationService.GetAsync() + : null; + } + catch (Exception ex) + { + Log.ForContext().Error("Getting location failed. {Exception}", ex); + } - MoveAndScale(m_oMoveToRegionDelegate, TinkApp.Uris.ActiveUri, currentLocation); + MoveAndScale(m_oMoveToRegionDelegate, TinkApp.Uris.ActiveUri, currentLocation); + } + } } ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes; diff --git a/TINKLib/ViewModel/FindBike/FindBikePageViewModel.cs b/TINKLib/ViewModel/FindBike/FindBikePageViewModel.cs index 6525540..f3a45f7 100644 --- a/TINKLib/ViewModel/FindBike/FindBikePageViewModel.cs +++ b/TINKLib/ViewModel/FindBike/FindBikePageViewModel.cs @@ -235,36 +235,63 @@ namespace TINK.ViewModel.FindBike ActionText = AppResources.ActivityTextCheckBluetoothState; if (bikeCollection.FirstOrDefault(x => x is BikeInfo btBike) != null - && RuntimePlatform == Device.Android) + //&& RuntimePlatform == Device.Android + ) { // Check location permission var status = await PermissionsService.CheckStatusAsync(); if (status != Status.Granted) { - var permissionResult = await PermissionsService.RequestAsync(); - - if (permissionResult != Status.Granted) + if (RuntimePlatform == Device.Android) { - var dialogResult = await ViewService.DisplayAlert( - AppResources.MessageTitleHint, - AppResources.MessageBikesManagementLocationPermissionOpenDialog, - AppResources.MessageAnswerYes, - AppResources.MessageAnswerNo); + var permissionResult = await PermissionsService.RequestAsync(); - if (!dialogResult) + if (permissionResult != Status.Granted) { - // User decided not to give access to locations permissions. - BikeCollection.Update(bikeCollection, Stations); + var dialogResult = await ViewService.DisplayAlert( + AppResources.MessageTitleHint, + AppResources.MessageBikesManagementLocationPermissionOpenDialog, + AppResources.MessageAnswerYes, + AppResources.MessageAnswerNo); - await StartUpdateTask(() => UpdateTask()); + if (!dialogResult) + { + // User decided not to give access to locations permissions. + BikeCollection.Update(bikeCollection, Stations); - ActionText = ""; - IsIdle = true; - return; + await StartUpdateTask(() => UpdateTask()); + + ActionText = ""; + IsIdle = true; + return; + } + + // Open permissions dialog. + PermissionsService.OpenAppSettings(); } + } + else + { + var dialogResult = await ViewService.DisplayAlert( + AppResources.MessageTitleHint, + AppResources.MessageBikesManagementLocationPermissionOpenDialog, + AppResources.MessageAnswerYes, + AppResources.MessageAnswerNo); - // Open permissions dialog. - PermissionsService.OpenAppSettings(); + if (!dialogResult) + { + // User decided not to give access to locations permissions. + BikeCollection.Update(bikeCollection, Stations); + + await StartUpdateTask(() => UpdateTask()); + + ActionText = ""; + IsIdle = true; + return; + } + + // Open permissions dialog. + PermissionsService.OpenAppSettings(); } } diff --git a/TINKLib/ViewModel/Map/MapPageViewModel.cs b/TINKLib/ViewModel/Map/MapPageViewModel.cs index 4f655b2..843fcf8 100644 --- a/TINKLib/ViewModel/Map/MapPageViewModel.cs +++ b/TINKLib/ViewModel/Map/MapPageViewModel.cs @@ -27,6 +27,7 @@ using TINK.Repository; using TINK.Services.Geolocation; using TINK.Model.State; + #if !TRYNOTBACKSTYLE #endif @@ -55,6 +56,8 @@ namespace TINK.ViewModel.Map /// private ILocationPermission PermissionsService { get; } + private IGeolocation Geolocation { get; } + /// /// Service to manage bluetooth stack. /// @@ -227,28 +230,32 @@ namespace TINK.ViewModel.Map } //Add blue dot for showing current location of user - Location currentLocation = null; - try + var status = await PermissionsService.CheckStatusAsync(); + if (status == Status.Granted) { - currentLocation = await GeolocationService.GetAsync(); - } - catch (Exception ex) - { - Log.ForContext().Error("Getting location failed. {Exception}", ex); - } - - if (currentLocation != null) - { - var currentLocationPin = new Pin() + Location currentLocation = null; + try { - Position = new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude), - Label = "currentLocationPin", - Type = PinType.Place, - Tag = "NotClickable", - Icon = BitmapDescriptorFactory.FromBundle(currentLocationPinName) - }; + currentLocation = await GeolocationService.GetAsync(); + } + catch (Exception ex) + { + Log.ForContext().Error("Getting location failed. {Exception}", ex); + } - Pins.Add(currentLocationPin); + if (currentLocation != null) + { + var currentLocationPin = new Pin() + { + Position = new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude), + Label = "currentLocationPin", + Type = PinType.Place, + Tag = "NotClickable", + Icon = BitmapDescriptorFactory.FromBundle(currentLocationPinName) + }; + + Pins.Add(currentLocationPin); + } } } @@ -343,7 +350,14 @@ namespace TINK.ViewModel.Map { try { + //Request Location Permission on iOS + if(DeviceInfo.Platform == DevicePlatform.iOS) + { + var status = await PermissionsService.RequestAsync(); + } + IsRunning = true; + IsNavBarVisible = false; // Process map page. Polling = TinkApp.Polling; @@ -354,9 +368,6 @@ namespace TINK.ViewModel.Map // Update map page filter ActiveFilterMap = TinkApp.GroupFilterMapPage; - ActionText = AppResources.ActivityTextRequestingLocationPermissions; - var status = await RequestLocationPermission(); - ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes; IsConnected = TinkApp.GetIsConnected(); var resultStationsAndBikes = await TinkApp.GetConnector(IsConnected).Query.GetBikesAndStationsAsync(); @@ -394,11 +405,15 @@ namespace TINK.ViewModel.Map // Get map display area Model.Map.IMapSpan mapSpan = null; - if (TinkApp.CenterMapToCurrentLocation && status == Status.Granted) + if (TinkApp.CenterMapToCurrentLocation) { - // Get from smart device - mapSpan = await GetFromLocationService(status); - } + var status = await PermissionsService.CheckStatusAsync(); + if (status == Status.Granted) + { + // Get from smart device + mapSpan = await GetFromLocationService(status); + } + } if (mapSpan == null) { @@ -433,6 +448,7 @@ namespace TINK.ViewModel.Map Exception = resultStationsAndBikes.Exception; ActionText = ""; IsRunning = false; + IsNavBarVisible = true; IsMapPageEnabled = true; } catch (Exception l_oException) @@ -440,6 +456,7 @@ namespace TINK.ViewModel.Map Log.ForContext().Error($"An error occurred showing bike stations page.\r\n{l_oException.Message}"); IsRunning = false; + IsNavBarVisible = true; await ViewService.DisplayAlert( "Fehler", @@ -552,19 +569,15 @@ namespace TINK.ViewModel.Map { // Check location permission var status = await PermissionsService.CheckStatusAsync(); - if (TinkApp.CenterMapToCurrentLocation - && !GeolocationService.IsSimulation + if (!GeolocationService.IsSimulation + // && DeviceInfo.Platform == DevicePlatform.Android && status != Status.Granted) { - status = await PermissionsService.RequestAsync(); - - if (status != Status.Granted) - { - var dialogResult = await ViewService.DisplayAlert( - AppResources.MessageTitleHint, - AppResources.MessageCenterMapLocationPermissionOpenDialog, - AppResources.MessageAnswerYes, - AppResources.MessageAnswerNo); + var dialogResult = await ViewService.DisplayAlert( + AppResources.MessageTitleHint, + AppResources.MessageCenterMapLocationPermissionOpenDialog, + AppResources.MessageAnswerYes, + AppResources.MessageAnswerNo); if (dialogResult) { @@ -572,9 +585,9 @@ namespace TINK.ViewModel.Map PermissionsService.OpenAppSettings(); ActionText = ""; IsRunning = false; + IsNavBarVisible = true; IsMapPageEnabled = true; } - } } return status; } @@ -598,7 +611,7 @@ namespace TINK.ViewModel.Map { // Start task which periodically updates pins. return new PollingUpdateTaskManager( - async () => + () => { try { @@ -660,6 +673,7 @@ namespace TINK.ViewModel.Map null); Log.ForContext().Verbose("Leaving update cycle."); + return; } }); @@ -845,6 +859,21 @@ namespace TINK.ViewModel.Map } } + private bool isNavBarVisible = true; + + public bool IsNavBarVisible + { + get => isNavBarVisible; + set + { + if (value == isNavBarVisible) + return; + + Log.ForContext().Debug($"Switch value of {nameof(isNavBarVisible)} to {value}."); + isNavBarVisible = value; + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsNavBarVisible))); + } + } /// Holds information whether app is connected to web or not. private bool? isConnected = null; @@ -895,6 +924,9 @@ namespace TINK.ViewModel.Map { try { + IsRunning = true; + ActionText = AppResources.ActivityTextCenterMap; + IsMapPageEnabled = false; Log.ForContext().Information($"Request to center to current position."); @@ -913,127 +945,92 @@ namespace TINK.ViewModel.Map TinkApp.UpdateConnector(); // Check location permission - //ActionText = AppResources.ActivityTextRequestingLocationPermissions; - - var status = await PermissionsService.CheckStatusAsync(); - if (!GeolocationService.IsSimulation - && status != Status.Granted) + var status = await RequestLocationPermission(); + if (status == Status.Granted) { - status = await PermissionsService.RequestAsync(); - - if (status != Status.Granted) - { - var dialogResult = await ViewService.DisplayAlert( - AppResources.MessageTitleHint, - AppResources.MessageCenterMapLocationPermissionOpenDialog, - AppResources.MessageAnswerYes, - AppResources.MessageAnswerNo); - if (dialogResult) - { - // User decided to give access to locations permissions. - PermissionsService.OpenAppSettings(); - ActionText = ""; - IsRunning = false; - IsMapPageEnabled = true; - return; - } - } - - // Do not use property .State to get bluetooth state due - // to issue https://hausource.visualstudio.com/TINK/_workitems/edit/116 / - // see https://github.com/xabre/xamarin-bluetooth-le/issues/112#issuecomment-380994887 - if (await BluetoothService.GetBluetoothState() != Plugin.BLE.Abstractions.Contracts.BluetoothState.On) - { - await ViewService.DisplayAlert( - AppResources.MessageTitleHint, - AppResources.MessageBikesManagementBluetoothActivation, - AppResources.MessageAnswerOk); - ActionText = ""; - IsRunning = false; - IsMapPageEnabled = true; - return; - } - } - - // Move and scale before getting stations and bikes which takes some time. - Location currentLocation = null; - try - { - currentLocation = await GeolocationService.GetAsync(); - } - catch (Exception ex) - { - Log.ForContext().Error("Getting location failed. {Exception}", ex); - } - - if (currentLocation != null) - { - IsRunning = true; - ActionText = AppResources.ActivityTextCenterMap; - - TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius( - new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude), - TinkApp.ActiveMapSpan.Radius); - - TinkApp.Save(); - - MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan); - - //Pins.Clear(); - - //// Update stations - //ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes; - //IsConnected = TinkApp.GetIsConnected(); - //var resultStationsAndBikes = await TinkApp.GetConnector(IsConnected).Query.GetBikesAndStationsAsync(); - - //// Set pins to their positions on map. - //InitializePins(resultStationsAndBikes.Response.StationsAll); - //Log.ForContext().Verbose("Update of pins done..."); - - //// Update pin colors. - //Log.ForContext().Verbose("Starting update pins color..."); - //var l_oColors = GetStationColors( - // Pins.Select(x => x.Tag.ToString()).ToList(), - // resultStationsAndBikes.Response.Bikes); - - //// Update pins color form count of bikes located at station. - //UpdatePinsColor(l_oColors); - - //Log.ForContext().Verbose("Update pins color done."); - + // Move and scale. + Location currentLocation = null; try { - // Update bikes at station or my bikes depending on context. - await m_oViewUpdateManager.StartUpdateAyncPeridically(Polling); + currentLocation = await GeolocationService.GetAsync(); } - catch (Exception) + catch (Exception ex) { - // Excpetions are handled insde update task; + Log.ForContext().Error("Getting location failed. {Exception}", ex); + } + + if (currentLocation != null) + { + IsRunning = true; + ActionText = AppResources.ActivityTextCenterMap; + + TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius( + new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude), + TinkApp.ActiveMapSpan.Radius); + + TinkApp.Save(); + + MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan); + + Pins.Clear(); + + // Update stations + IsConnected = TinkApp.GetIsConnected(); + var resultStationsAndBikes = await TinkApp.GetConnector(IsConnected).Query.GetBikesAndStationsAsync(); + + // Set pins to their positions on map. + ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes; + InitializePins(resultStationsAndBikes.Response.StationsAll); + Log.ForContext().Verbose("Update of pins done..."); + + // Update pin colors. + Log.ForContext().Verbose("Starting update pins color..."); + var l_oColors = GetStationColors( + Pins.Select(x => x.Tag.ToString()).ToList(), + resultStationsAndBikes.Response.Bikes); + + // Update pins color form count of bikes located at station. + UpdatePinsColor(l_oColors); + + Log.ForContext().Verbose("Update pins color done."); + + try + { + // Update bikes at station or my bikes depending on context. + await m_oViewUpdateManager.StartUpdateAyncPeridically(Polling); + } + catch (Exception) + { + // Excpetions are handled insde update task; + } + } + else + { + await ViewService.DisplayAlert( + AppResources.MessageTitleHint, + AppResources.MessageErrorLocationIsOff, + AppResources.MessageAnswerOk); } - } - else - { - ActionText = AppResources.ActivityTextErrorQueryLocationWhenAny; } IsRunning = false; IsMapPageEnabled = true; Log.ForContext().Information($"Center to current Position done."); - ActionText = ""; + ActionText = String.Empty; } catch (Exception l_oException) { Log.ForContext().Error("An error occurred while centering to current position."); - ActionText = ""; - IsRunning = false; + ActionText = String.Empty; await ViewService.DisplayAlert( "Fehler", AppResources.MessageMapPageErrorSwitch, - String.Format(AppResources.MessageMapPageErrorSwitch, l_oException.Message), + String.Format(AppResources.MessageErrorQueryLocationMessage, l_oException.Message), AppResources.MessageAnswerOk); IsMapPageEnabled = true; + IsRunning = false; } } @@ -1080,6 +1077,7 @@ namespace TINK.ViewModel.Map { IsMapPageEnabled = false; IsRunning = true; + IsNavBarVisible = false; Log.ForContext().Information($"Request to toggle to \"{selectedFilter}\"."); @@ -1101,76 +1099,42 @@ namespace TINK.ViewModel.Map Pins.Clear(); - // Check location permission - //ActionText = AppResources.ActivityTextRequestingLocationPermissions; + //// Move and scale before getting stations and bikes which takes some time. + //if (TinkApp.CenterMapToCurrentLocation) + //{ + // // Check location permission + // //ActionText = AppResources.ActivityTextRequestingLocationPermissions; + // var status = await RequestLocationPermission(); + // if (status == Status.Granted) + // { + // //ActionText = AppResources.ActivityTextCenterMap; - var status = await PermissionsService.CheckStatusAsync(); - if (TinkApp.CenterMapToCurrentLocation - && !GeolocationService.IsSimulation - && status != Status.Granted) - { - status = await PermissionsService.RequestAsync(); + // Location currentLocation = null; + // try + // { + // currentLocation = await GeolocationService.GetAsync(); + // } + // catch (Exception ex) + // { + // Log.ForContext().Error("Getting location failed. {Exception}", ex); + // } - if (status != Status.Granted) - { - var dialogResult = await ViewService.DisplayAlert( - AppResources.MessageTitleHint, - AppResources.MessageCenterMapLocationPermissionOpenDialog, - AppResources.MessageAnswerYes, - AppResources.MessageAnswerNo); - if (dialogResult) - { - // User decided to give access to locations permissions. - PermissionsService.OpenAppSettings(); - ActionText = ""; - IsRunning = false; - IsMapPageEnabled = true; - return; - } - } + // if (currentLocation != null) + // { + // TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius( + // new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude), + // TinkApp.ActiveMapSpan.Radius); - // Do not use property .State to get bluetooth state due - // to issue https://hausource.visualstudio.com/TINK/_workitems/edit/116 / - // see https://github.com/xabre/xamarin-bluetooth-le/issues/112#issuecomment-380994887 - if (await BluetoothService.GetBluetoothState() != Plugin.BLE.Abstractions.Contracts.BluetoothState.On) - { - await ViewService.DisplayAlert( - AppResources.MessageTitleHint, - AppResources.MessageBikesManagementBluetoothActivation, - AppResources.MessageAnswerOk); - ActionText = ""; - IsRunning = false; - IsMapPageEnabled = true; - return; - } - } + // TinkApp.Save(); - // Move and scale before getting stations and bikes which takes some time. - if (TinkApp.CenterMapToCurrentLocation) - { - //ActionText = AppResources.ActivityTextCenterMap; - - Location currentLocation = null; - try - { - currentLocation = await GeolocationService.GetAsync(); - } - catch (Exception ex) - { - Log.ForContext().Error("Getting location failed. {Exception}", ex); - } - - if (currentLocation != null) - { - TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius( - new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude), - TinkApp.ActiveMapSpan.Radius); - - TinkApp.Save(); - - //MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan); - } - } + // //MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan); + // } + // else + // { + // ActionText = AppResources.ActivityTextErrorQueryLocationWhenAny; + // } + // } + //} // Update stations ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes; @@ -1204,6 +1168,7 @@ namespace TINK.ViewModel.Map ActionText = ""; IsRunning = false; + IsNavBarVisible = true; IsMapPageEnabled = true; Log.ForContext().Information($"Toggle to \"{selectedFilter}\" done."); } @@ -1212,6 +1177,7 @@ namespace TINK.ViewModel.Map Log.ForContext().Error("An error occurred switching view Cargobike/ Citybike.{}"); ActionText = ""; IsRunning = false; + IsNavBarVisible = true; await ViewService.DisplayAlert( "Fehler", diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedOpen.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedOpen.cs index 335dd95..860709a 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedOpen.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedOpen.cs @@ -154,7 +154,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Query location..."; bikesViewModel.ActionText = "Returning bike..."; @@ -226,7 +226,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = ""; bike.LockInfo.State = LockingState.UnknownDisconnected; @@ -431,7 +431,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = ""; bike.LockInfo.State = LockingState.UnknownDisconnected; @@ -503,7 +503,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = ""; bike.LockInfo.State = LockingState.Open; @@ -577,7 +577,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bike.LockInfo.State = LockingState.Open; bikesViewModel.ActionText = ""; @@ -648,7 +648,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Query location..."; bikesViewModel.ActionText = ""; @@ -720,7 +720,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Query location..."; bikesViewModel.ActionText = "Returning bike..."; @@ -797,7 +797,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Query location..."; bikesViewModel.ActionText = "Returning bike..."; @@ -873,7 +873,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Query location..."; bikesViewModel.ActionText = "Returning bike..."; @@ -949,7 +949,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Query location..."; bikesViewModel.ActionText = "Returning bike..."; @@ -1023,7 +1023,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action bikesViewModel.ActionText = "Starting bike return..."; connector.Command.StartReturningBike(bike); // Notify about start - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Query location..."; bikesViewModel.ActionText = "Returning bike..."; @@ -1084,7 +1084,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); @@ -1144,7 +1144,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = ""; viewService.DisplayAlert("Lock can not be closed!", "Lock cannot be closed until bike is near.", "OK"); @@ -1204,7 +1204,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = ""; viewService.DisplayAlert("Lock can not be closed!", "Exception message.", "OK"); @@ -1265,7 +1265,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); @@ -1327,7 +1327,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); @@ -1390,7 +1390,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedUnknown.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedUnknown.cs index 017c511..f6e270b 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedUnknown.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestBookedUnknown.cs @@ -779,7 +779,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); @@ -839,7 +839,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = ""; viewService.DisplayAlert("Lock can not be closed!", "Lock cannot be closed until bike is near.", "OK"); @@ -899,7 +899,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = ""; viewService.DisplayAlert("Lock can not be closed!", "Exception message.", "OK"); @@ -960,7 +960,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); @@ -1022,7 +1022,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); @@ -1085,7 +1085,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableOpen.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableOpen.cs index 3924d16..4446f93 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableOpen.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestDisposableOpen.cs @@ -91,7 +91,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks[0].CloseAsync(); bikesViewModel.ActionText = "Disconnecting lock..."; locks.DisconnectAsync(Arg.Any(), Arg.Any()); @@ -154,7 +154,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks[0].CloseAsync(); bikesViewModel.ActionText = ""; viewService.DisplayAlert("Lock can not be closed!", "Lock cannot be closed until bike is near.", "OK"); @@ -217,7 +217,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks[0].CloseAsync(); bikesViewModel.ActionText = ""; viewService.DisplayAlert("Lock can not be closed!", "Exception message.", "OK"); diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedOpen.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedOpen.cs index 99d0076..e952a68 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedOpen.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedOpen.cs @@ -288,7 +288,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks[0].CloseAsync(); bikesViewModel.ActionText = "Canceling reservation..."; connector.Command.DoCancelReservation(bike); @@ -360,7 +360,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks[0].CloseAsync(); bikesViewModel.ActionText = ""; viewService.DisplayAlert( @@ -434,7 +434,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks[0].CloseAsync(); bikesViewModel.ActionText = ""; viewService.DisplayAlert( @@ -512,7 +512,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks[0].CloseAsync(); bikesViewModel.ActionText = "Canceling reservation..."; connector.Command.DoCancelReservation(bike); @@ -583,7 +583,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks[0].CloseAsync(); bikesViewModel.ActionText = "Canceling reservation..."; connector.Command.DoCancelReservation(bike); @@ -654,7 +654,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks[0].CloseAsync(); bikesViewModel.ActionText = "Canceling reservation..."; connector.Command.DoCancelReservation(bike); diff --git a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedUnknown.cs b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedUnknown.cs index ea094f4..65c9d2a 100644 --- a/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedUnknown.cs +++ b/TestShareeLib/ViewModel/Bikes/Bike/BluetoothLock/RequestHandler/TestReservedUnknown.cs @@ -652,7 +652,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); @@ -708,7 +708,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = ""; viewService.DisplayAlert("Lock can not be closed!", "Lock cannot be closed until bike is near.", "OK"); @@ -768,7 +768,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = ""; viewService.DisplayAlert("Lock can not be closed!", "Exception message.", "OK"); @@ -830,7 +830,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); @@ -892,7 +892,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); @@ -955,7 +955,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler bikesViewModel.Received(1).IsIdle = false; // GUI must be locked bikesViewModel.ActionText = "One moment please..."; pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action - bikesViewModel.ActionText = "

Lock is closing.
Please visually check if it is completely closed.

"; + bikesViewModel.ActionText = "

Lock is closing.
Please wait until it is completely closed.

"; locks.Received()[0].CloseAsync(); // Lock must be closed bikesViewModel.ActionText = "Updating lock state..."; connector.Command.UpdateLockingStateAsync(bike, Arg.Any()); diff --git a/TestShareeLib/ViewModel/BikesAtStation/TestBikesAtStationPageViewModel.cs b/TestShareeLib/ViewModel/BikesAtStation/TestBikesAtStationPageViewModel.cs index c869b65..c937dc7 100644 --- a/TestShareeLib/ViewModel/BikesAtStation/TestBikesAtStationPageViewModel.cs +++ b/TestShareeLib/ViewModel/BikesAtStation/TestBikesAtStationPageViewModel.cs @@ -389,7 +389,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel { permissions.CheckStatusAsync(); var glDummy = geolocation.Active.Received().IsGeolcationEnabled; - permissions.RequestAsync(); // Ask user from permissions. + // permissions.RequestAsync(); // Ask user from permissions (disabled, since no secondary request allowed). viewService.DisplayAlert( "Hint", "Please allow location sharing so that bike lock/locks can be managed.\r\nOpen sharing dialog?", @@ -398,7 +398,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel permissions.OpenAppSettings(); }); - Assert.IsEmpty(bikesAtStation.StatusInfoText); + Assert.IsTrue(new List { "Updating...", string.Empty }.Contains(bikesAtStation.StatusInfoText)); // Verify list of bikes Assert.AreEqual(4, bikesAtStation.Count); @@ -517,7 +517,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel { permissions.CheckStatusAsync(); var glDummy = geolocation.Active.Received().IsGeolcationEnabled; - permissions.RequestAsync(); // Ask user from permissions. + //permissions.RequestAsync(); // Ask user from permissions (disabled, since no secondary request allowed). viewService.DisplayAlert( "Hint", "Please allow location sharing so that bike lock/locks can be managed.\r\nOpen sharing dialog?",