From 0468955d492ccdc070499b5f75a84d5bd5693076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anja=20M=C3=BCller-Mei=C3=9Fner?= Date: Tue, 6 Sep 2022 16:08:19 +0200 Subject: [PATCH] Version 3.0.338 --- .editorconfig | 22 +- LastenradBayern/TINK.Android/MainActivity.cs | 150 +- .../TINK.Android/Model/Device/AppInfo.cs | 60 +- .../TINK.Android/Model/Device/Device.cs | 22 +- .../Model/Device/ExternalBrowseService.cs | 24 +- .../TINK.Android/Model/Device/Gps.cs | 22 +- .../Model/Device/SpecialFolder.cs | 70 +- .../TINK.Android/Model/Device/WebView.cs | 18 +- .../Properties/AndroidManifest.xml | 2 +- LastenradBayern/TINK.iOS/AppDelegate.cs | 70 +- LastenradBayern/TINK.iOS/Device/AppInfo.cs | 62 +- LastenradBayern/TINK.iOS/Device/Device.cs | 38 +- .../TINK.iOS/Device/ExternalBrowseService.cs | 24 +- LastenradBayern/TINK.iOS/Device/Gps.cs | 8 +- .../TINK.iOS/Device/SpecialFolder.cs | 34 +- LastenradBayern/TINK.iOS/Device/WebView.cs | 20 +- LastenradBayern/TINK.iOS/Device/iOSCipher.cs | 38 +- LastenradBayern/TINK.iOS/Info.plist | 12 +- .../TINK.iOS/LastenradBayern.iOS.csproj | 17 +- LastenradBayern/TINK.iOS/Main.cs | 20 +- LastenradBayern/TINK/App.xaml.cs | 512 +-- LastenradBayern/TINK/BackdoorMethodHelpers.cs | 44 +- .../TINK/Model/Device/SpecialFolder.cs | 34 +- .../TINK/View/Account/AccountPage.xaml.cs | 192 +- LastenradBayern/TINK/View/Bike/BCBike.xaml.cs | 16 +- .../View/Bike/BikeViewCellTemplateSelector.cs | 36 +- .../TINK/View/Bike/ILockItBike.xaml.cs | 56 +- .../BikesAtStation/BikesAtStationPage.xaml.cs | 296 +- .../TINK/View/BoolInverterConverter.cs | 22 +- .../TINK/View/Contact/ContactPage.xaml | 2 +- .../TINK/View/Contact/ContactPage.xaml.cs | 153 +- .../View/Contact/SelectStationPage.xaml.cs | 282 +- .../CopriWebView/ManageAccountPage.xaml.cs | 86 +- .../PasswordForgottenPage.xaml.cs | 72 +- .../View/CopriWebView/RegisterPage.xaml.cs | 74 +- LastenradBayern/TINK/View/FeedbackPopup.xaml | 100 +- .../TINK/View/FeedbackPopup.xaml.cs | 138 +- .../FeesAndBikes/FeesAndBikesPage.xaml.cs | 48 +- .../TINK/View/FindBike/FindBikePage.xaml.cs | 218 +- .../BikeInfo/BikeInfoCarouselPage.xaml.cs | 144 +- .../TINK/View/Info/InfoTabbedPage.xaml.cs | 54 +- .../TINK/View/ListViewAttachedBehavior.cs | 52 +- .../TINK/View/Login/LoginPage.xaml.cs | 122 +- LastenradBayern/TINK/View/Map/MapPage.xaml.cs | 410 +-- .../View/MiniSurvey/MiniSurveyPage.xaml.cs | 136 +- .../Question/CheckOneViewCell.xaml.cs | 16 +- .../Question/FreeTextViewCell.xaml.cs | 16 +- .../QuestionViewCellTemplateSelector.cs | 38 +- .../TINK/View/MyBikes/MyBikesPage.xaml.cs | 282 +- .../TINK/View/RootFlyout/RootPage.xaml.cs | 106 +- .../View/RootFlyout/RootPageFlyout.xaml.cs | 22 +- .../View/RootFlyout/RootPageFlyoutMenuItem.cs | 22 +- .../View/RootMasterDetail/MainPageMenuItem.cs | 62 +- .../TINK/View/RootShell/AppShell.xaml.cs | 16 +- .../TINK/View/RootShell/FlyoutHeader.xaml.cs | 16 +- .../TINK/View/Settings/SettingsPage.xaml.cs | 188 +- .../StringNotNullOrEmptyToVisibleConverter.cs | 30 +- .../TINK/View/ViewTypesTypeProvider.cs | 86 +- .../TINK/View/WhatsNew/Agb/AgbPage.xaml.cs | 104 +- .../TINK/View/WhatsNew/WhatsNewPage.xaml.cs | 148 +- .../ViewModel/RootFlyout/RootPageViewModel.cs | 280 +- .../TINK/ViewModel/RootMasterDetail/Helper.cs | 198 +- .../ViewModel/RootShell/AppShellViewModel.cs | 94 +- .../TINK/ViewModel/ViewModelResourceHelper.cs | 52 +- .../Services/BluetoothLock/BLE/LockItBase.cs | 2147 ++++++------- .../BluetoothLock/BLE/LockItByGuidService.cs | 244 +- .../BluetoothLock/BLE/LockItByScanService.cs | 480 +-- .../BLE/LockItByScanServiceEventBased.cs | 20 +- .../BLE/LockItByScanServicePolling.cs | 20 +- .../BluetoothLock/BLE/LockItEventBased.cs | 532 ++-- .../BluetoothLock/BLE/LockItPolling.cs | 362 +-- .../BluetoothLock/BLE/LockItServiceBase.cs | 284 +- .../BluetoothLock/BLE/LockItServiceHelper.cs | 8 +- .../BluetoothLock/BLE/PluginBleHelper.cs | 50 +- .../Services/BluetoothLock/StateChecker.cs | 64 +- .../Bikes/Bike/BluetoothLock/ILockInfo.cs | 14 +- .../Bikes/Bike/BluetoothLock/LockInfo.cs | 184 +- .../Model/Bikes/Bike/CopriLock/ILockInfo.cs | 10 +- .../Model/Bikes/Bike/CopriLock/LockInfo.cs | 122 +- .../Model/Connector/TextToLockItTypeHelper.cs | 44 +- LockItShared/Model/Device/ICipher.cs | 26 +- .../BluetoothLock/Crypto/AuthCryptoHelper.cs | 128 +- .../Services/BluetoothLock/Crypto/Cipher.cs | 138 +- .../Exception/AlreadyConnectedException.cs | 8 +- .../Exception/AuthKeyException.cs | 10 +- .../BluetoothDisconnectedException.cs | 26 +- .../ConnectBluetoothNotOnException.cs | 20 +- .../Exception/ConnectLocationOffException.cs | 8 +- ...nnectLocationPermissionMissingException.cs | 8 +- .../CouldntCloseBoldBlockedException.cs | 16 +- .../CouldntCloseInconsistentStateExecption.cs | 22 +- .../Exception/CouldntCloseMovingException.cs | 16 +- .../CouldntOpenBoldIsBlockedException.cs | 22 +- .../CouldntOpenBoldWasBlockedException.cs | 22 +- .../CouldntOpenInconsistentStateExecption.cs | 18 +- .../CoundntGetCharacteristicException.cs | 10 +- .../Exception/GuidUnknownException.cs | 12 +- .../Exception/OutOfReachException.cs | 10 +- .../Exception/StateAwareException.cs | 18 +- .../Services/BluetoothLock/ILockService.cs | 78 +- .../Services/BluetoothLock/ILocksService.cs | 104 +- .../Services/BluetoothLock/ITimeOutProvide.cs | 10 +- .../Services/BluetoothLock/LockInfoHelper.cs | 102 +- .../LockItByGuidServiceHelper.cs | 26 +- .../Services/BluetoothLock/NullLock.cs | 80 +- .../BluetoothLock/Tdo/LockInfoAuthTdo.cs | 76 +- .../Services/BluetoothLock/Tdo/LockInfoTdo.cs | 70 +- .../Services/BluetoothLock/TimeOutProvider.cs | 36 +- Meinkonrad/TINK.Android/MainActivity.cs | 150 +- .../TINK.Android/Model/Device/AppInfo.cs | 60 +- .../TINK.Android/Model/Device/Device.cs | 22 +- .../Model/Device/ExternalBrowseService.cs | 24 +- Meinkonrad/TINK.Android/Model/Device/Gps.cs | 22 +- .../Model/Device/SpecialFolder.cs | 70 +- .../TINK.Android/Model/Device/WebView.cs | 18 +- .../Properties/AndroidManifest.xml | 2 +- Meinkonrad/TINK.iOS/AppDelegate.cs | 70 +- Meinkonrad/TINK.iOS/Device/AppInfo.cs | 62 +- Meinkonrad/TINK.iOS/Device/Device.cs | 38 +- .../TINK.iOS/Device/ExternalBrowseService.cs | 24 +- Meinkonrad/TINK.iOS/Device/Gps.cs | 8 +- Meinkonrad/TINK.iOS/Device/SpecialFolder.cs | 34 +- Meinkonrad/TINK.iOS/Device/WebView.cs | 20 +- Meinkonrad/TINK.iOS/Device/iOSCipher.cs | 38 +- Meinkonrad/TINK.iOS/Info.plist | 12 +- Meinkonrad/TINK.iOS/Main.cs | 20 +- Meinkonrad/TINK.iOS/Meinkonrad.iOS.csproj | 18 +- Meinkonrad/TINK/App.xaml.cs | 514 +-- Meinkonrad/TINK/BackdoorMethodHelpers.cs | 44 +- Meinkonrad/TINK/Model/Device/SpecialFolder.cs | 34 +- .../TINK/View/Account/AccountPage.xaml.cs | 192 +- Meinkonrad/TINK/View/Bike/BCBike.xaml.cs | 16 +- .../View/Bike/BikeViewCellTemplateSelector.cs | 38 +- Meinkonrad/TINK/View/Bike/ILockItBike.xaml.cs | 56 +- .../BikesAtStation/BikesAtStationPage.xaml.cs | 296 +- Meinkonrad/TINK/View/BoolInverterConverter.cs | 22 +- Meinkonrad/TINK/View/Contact/ContactPage.xaml | 2 +- .../TINK/View/Contact/ContactPage.xaml.cs | 153 +- .../View/Contact/SelectStationPage.xaml.cs | 280 +- .../CopriWebView/ManageAccountPage.xaml.cs | 86 +- .../PasswordForgottenPage.xaml.cs | 72 +- .../View/CopriWebView/RegisterPage.xaml.cs | 74 +- Meinkonrad/TINK/View/FeedbackPopup.xaml | 100 +- Meinkonrad/TINK/View/FeedbackPopup.xaml.cs | 138 +- .../FeesAndBikes/FeesAndBikesPage.xaml.cs | 48 +- .../TINK/View/FindBike/FindBikePage.xaml.cs | 212 +- .../BikeInfo/BikeInfoCarouselPage.xaml.cs | 144 +- .../TINK/View/Info/InfoTabbedPage.xaml.cs | 54 +- .../TINK/View/ListViewAttachedBehavior.cs | 52 +- Meinkonrad/TINK/View/Login/LoginPage.xaml.cs | 122 +- Meinkonrad/TINK/View/Map/MapPage.xaml.cs | 410 +-- .../View/MiniSurvey/MiniSurveyPage.xaml.cs | 136 +- .../Question/CheckOneViewCell.xaml.cs | 16 +- .../Question/FreeTextViewCell.xaml.cs | 16 +- .../QuestionViewCellTemplateSelector.cs | 38 +- .../TINK/View/MyBikes/MyBikesPage.xaml.cs | 282 +- .../TINK/View/RootFlyout/RootPage.xaml.cs | 106 +- .../View/RootFlyout/RootPageFlyout.xaml.cs | 22 +- .../View/RootFlyout/RootPageFlyoutMenuItem.cs | 22 +- .../View/RootMasterDetail/MainPageMenuItem.cs | 62 +- .../TINK/View/RootShell/AppShell.xaml.cs | 16 +- .../TINK/View/RootShell/FlyoutFooter.xaml.cs | 16 +- .../TINK/View/RootShell/FlyoutHeader.xaml.cs | 16 +- .../TINK/View/Settings/SettingsPage.xaml.cs | 188 +- .../StringNotNullOrEmptyToVisibleConverter.cs | 30 +- Meinkonrad/TINK/View/ViewTypesTypeProvider.cs | 86 +- .../TINK/View/WhatsNew/Agb/AgbPage.xaml.cs | 104 +- .../TINK/View/WhatsNew/WhatsNewPage.xaml.cs | 148 +- .../ViewModel/RootFlyout/RootPageViewModel.cs | 280 +- .../TINK/ViewModel/RootMasterDetail/Helper.cs | 198 +- .../ViewModel/RootShell/AppShellViewModel.cs | 94 +- .../TINK/ViewModel/ViewModelResourceHelper.cs | 52 +- .../View/BarLevelInputView.xaml.cs | 166 +- ShareeSharedGuiLib/View/BarLevelView.xaml.cs | 142 +- ShareeSharedGuiLib/ViewModel/Bar.cs | 50 +- .../ViewModel/BarLevelInputViewModel.cs | 96 +- .../ViewModel/BarLevelViewModel.cs | 144 +- TINK/TINK.Android/MainActivity.cs | 150 +- TINK/TINK.Android/Model/Device/AppInfo.cs | 60 +- TINK/TINK.Android/Model/Device/Device.cs | 22 +- .../Model/Device/ExternalBrowseService.cs | 24 +- TINK/TINK.Android/Model/Device/Gps.cs | 22 +- .../Model/Device/SpecialFolder.cs | 70 +- TINK/TINK.Android/Model/Device/WebView.cs | 18 +- .../Properties/AndroidManifest.xml | 2 +- .../Resources/Resource.Designer.cs | 592 ++-- .../drawable/bike_Cargo_Pedelec_Two.png | Bin 0 -> 5573 bytes .../bike_Cargo_SoleHumanPowered_Trike.png | Bin 0 -> 5525 bytes .../bike_Cargo_SoleHumanPowered_Two.png | Bin 0 -> 4888 bytes .../bike_City_SoleHumanPowered_Two.png | Bin 0 -> 3760 bytes .../drawable/sharee_no_background.png | Bin 3799 -> 77566 bytes TINK/TINK.Android/TINK.Android.csproj | 12 + TINK/TINK.iOS/AppDelegate.cs | 70 +- TINK/TINK.iOS/Device/AppInfo.cs | 62 +- TINK/TINK.iOS/Device/Device.cs | 38 +- TINK/TINK.iOS/Device/ExternalBrowseService.cs | 24 +- TINK/TINK.iOS/Device/Gps.cs | 8 +- TINK/TINK.iOS/Device/SpecialFolder.cs | 34 +- TINK/TINK.iOS/Device/WebView.cs | 20 +- TINK/TINK.iOS/Device/iOSCipher.cs | 38 +- TINK/TINK.iOS/Info.plist | 12 +- TINK/TINK.iOS/Main.cs | 20 +- .../StationMarkerOpenBlue.pdf | Bin 1564 -> 1579 bytes .../StationMarkerOpenGreen.pdf | Bin 1560 -> 1583 bytes .../StationMarkerOpenLightBlue.pdf | Bin 1560 -> 1582 bytes .../StationMarkerOpenRed.pdf | Bin 1559 -> 1582 bytes .../Contents.json | 393 +++ .../bike_Cargo_Pedelec_Two.svg | 151 + .../Contents.json | 393 +++ .../bike_Cargo_SoleHumanPowered_Trike.svg | 81 + .../Contents.json | 393 +++ .../bike_Cargo_SoleHumanPowered_Two.svg | 66 + .../Contents.json | 393 +++ .../bike_City_SoleHumanPowered_Two.svg | 77 + .../ShareeBike NoBackground.pdf | Bin 2349 -> 2481 bytes TINK/TINK.iOS/TINK.iOS.csproj | 46 +- TINK/TINK/App.xaml.cs | 518 +-- TINK/TINK/BackdoorMethodHelpers.cs | 44 +- TINK/TINK/Model/Device/SpecialFolder.cs | 34 +- TINK/TINK/View/Account/AccountPage.xaml.cs | 192 +- TINK/TINK/View/Bike/BCBike.xaml.cs | 16 +- .../View/Bike/BikeViewCellTemplateSelector.cs | 38 +- TINK/TINK/View/Bike/ILockItBike.xaml | 47 +- TINK/TINK/View/Bike/ILockItBike.xaml.cs | 56 +- .../BikesAtStation/BikesAtStationPage.xaml.cs | 296 +- TINK/TINK/View/BoolInverterConverter.cs | 22 +- TINK/TINK/View/Contact/ContactPage.xaml | 2 +- TINK/TINK/View/Contact/ContactPage.xaml.cs | 153 +- .../View/Contact/SelectStationPage.xaml.cs | 280 +- .../CopriWebView/ManageAccountPage.xaml.cs | 86 +- .../PasswordForgottenPage.xaml.cs | 72 +- .../View/CopriWebView/RegisterPage.xaml.cs | 74 +- TINK/TINK/View/FeedbackPopup.xaml | 75 +- TINK/TINK/View/FeedbackPopup.xaml.cs | 138 +- .../FeesAndBikes/FeesAndBikesPage.xaml.cs | 48 +- TINK/TINK/View/FindBike/FindBikePage.xaml.cs | 218 +- .../BikeInfo/BikeInfoCarouselPage.xaml.cs | 144 +- TINK/TINK/View/Info/InfoTabbedPage.xaml.cs | 54 +- TINK/TINK/View/ListViewAttachedBehavior.cs | 52 +- TINK/TINK/View/Login/LoginPage.xaml.cs | 122 +- TINK/TINK/View/Map/MapPage.xaml.cs | 410 +-- .../View/MiniSurvey/MiniSurveyPage.xaml.cs | 136 +- .../Question/CheckOneViewCell.xaml.cs | 16 +- .../Question/FreeTextViewCell.xaml.cs | 16 +- .../QuestionViewCellTemplateSelector.cs | 38 +- TINK/TINK/View/MyBikes/MyBikesPage.xaml.cs | 282 +- TINK/TINK/View/RootFlyout/RootPage.xaml.cs | 106 +- .../View/RootFlyout/RootPageFlyout.xaml.cs | 22 +- .../View/RootFlyout/RootPageFlyoutMenuItem.cs | 22 +- .../View/RootMasterDetail/MainPageMenuItem.cs | 62 +- TINK/TINK/View/RootShell/AppShell.xaml | 18 +- TINK/TINK/View/RootShell/AppShell.xaml.cs | 16 +- TINK/TINK/View/RootShell/FlyoutHeader.xaml | 39 +- TINK/TINK/View/RootShell/FlyoutHeader.xaml.cs | 16 +- TINK/TINK/View/Settings/SettingsPage.xaml.cs | 188 +- .../StringNotNullOrEmptyToVisibleConverter.cs | 30 +- TINK/TINK/View/ViewTypesTypeProvider.cs | 86 +- TINK/TINK/View/WhatsNew/Agb/AgbPage.xaml.cs | 104 +- TINK/TINK/View/WhatsNew/WhatsNewPage.xaml.cs | 148 +- .../ViewModel/RootFlyout/RootPageViewModel.cs | 280 +- .../TINK/ViewModel/RootMasterDetail/Helper.cs | 198 +- .../ViewModel/RootShell/AppShellViewModel.cs | 94 +- .../TINK/ViewModel/ViewModelResourceHelper.cs | 52 +- TINKLib/Model/Bikes/BikeCollection.cs | 72 +- TINKLib/Model/Bikes/BikeCollectionFilter.cs | 48 +- TINKLib/Model/Bikes/BikeCollectionMutable.cs | 276 +- TINKLib/Model/Bikes/BikeCollectionUpdater.cs | 54 +- TINKLib/Model/Bikes/BikeInfoNS/BC/BikeInfo.cs | 272 +- .../Bikes/BikeInfoNS/BC/BikeInfoMutable.cs | 202 +- .../Model/Bikes/BikeInfoNS/BC/IBikeInfo.cs | 64 +- .../Bikes/BikeInfoNS/BC/IBikeInfoMutable.cs | 94 +- TINKLib/Model/Bikes/BikeInfoNS/BikeNS/Bike.cs | 244 +- .../Bikes/BikeInfoNS/BikeNS/BikeExtension.cs | 30 +- .../BikeInfoNS/BluetoothLock/BikeInfo.cs | 288 +- .../BluetoothLock/BikeInfoMutable.cs | 61 +- .../BikeInfoNS/BluetoothLock/IBikeInfo.cs | 6 +- .../BluetoothLock/IBikeInfoMutable.cs | 8 +- .../BluetoothLock/ILockInfoMutable.cs | 26 +- .../BluetoothLock/LockInfoMutable.cs | 78 +- .../Bikes/BikeInfoNS/CopriLock/BikeInfo.cs | 290 +- .../BikeInfoNS/CopriLock/BikeInfoMutable.cs | 72 +- .../BikeInfoNS/CopriLock/IBikeInfoMutable.cs | 10 +- .../BikeInfoNS/CopriLock/ILockInfoMutable.cs | 8 +- .../BikeInfoNS/CopriLock/LockInfoMutable.cs | 46 +- .../BikeInfoNS/DriveNS/BatteryNS/Battery.cs | 178 +- .../BikeInfoNS/DriveNS/BatteryNS/IBattery.cs | 46 +- .../Model/Bikes/BikeInfoNS/DriveNS/Drive.cs | 98 +- .../BikeInfoNS/DriveNS/EngineNS/Engine.cs | 18 +- .../BikeInfoNS/DriveNS/EngineNS/IEngine.cs | 14 +- .../Model/Bikes/BikeInfoNS/DriveNS/IDrive.cs | 30 +- .../Bikes/BikeInfoNS/RentalDescription.cs | 72 +- .../Bikes/BikeInfoNS/TariffDescription.cs | 68 +- TINKLib/Model/Bikes/IBikeCollection.cs | 56 +- TINKLib/Model/BookingFinishedModel.cs | 20 +- TINKLib/Model/Connector/Command/Command.cs | 290 +- .../Connector/Command/CommandLoggedIn.cs | 528 ++-- TINKLib/Model/Connector/Command/ICommand.cs | 208 +- .../Connector/Command/UserFeedbackDto.cs | 20 +- TINKLib/Model/Connector/Connector.cs | 114 +- TINKLib/Model/Connector/ConnectorCache.cs | 74 +- TINKLib/Model/Connector/ConnectorFactory.cs | 46 +- .../Connector/Filter/GroupFilterFactory.cs | 38 +- .../Model/Connector/Filter/IGroupFilter.cs | 8 +- .../Connector/Filter/IntersectGroupFilter.cs | 24 +- .../Filter/IntersectGroupFilterHelper.cs | 66 +- .../Model/Connector/Filter/NullGroupFilter.cs | 8 +- TINKLib/Model/Connector/FilterHelper.cs | 30 +- TINKLib/Model/Connector/FilteredConnector.cs | 184 +- .../Connector/FilteredConnectorFactory.cs | 24 +- TINKLib/Model/Connector/IConnector.cs | 18 +- TINKLib/Model/Connector/IFilteredConnector.cs | 8 +- .../Model/Connector/NullFilterConnector.cs | 168 +- TINKLib/Model/Connector/Query/Base.cs | 38 +- TINKLib/Model/Connector/Query/BaseLoggedIn.cs | 52 +- TINKLib/Model/Connector/Query/CachedQuery.cs | 140 +- .../Connector/Query/CachedQueryLoggedIn.cs | 376 +-- TINKLib/Model/Connector/Query/IQuery.cs | 22 +- TINKLib/Model/Connector/Query/Query.cs | 94 +- .../Model/Connector/Query/QueryLoggedIn.cs | 134 +- TINKLib/Model/Connector/TextToTypeHelper.cs | 634 ++-- .../Connector/Updater/BikeInfoFactory.cs | 534 ++-- .../Updater/BookingFinishedModelFactory.cs | 72 +- .../Model/Connector/Updater/DriveFactory.cs | 64 +- .../Updater/RentalDescriptionFactory.cs | 102 +- .../Updater/TariffDescriptionFactory.cs | 122 +- .../Model/Connector/Updater/UpdaterJSON.cs | 466 +-- TINKLib/Model/Device/IAppInfo.cs | 16 +- TINKLib/Model/Device/IDevice.cs | 12 +- .../Model/Device/IExternalBrowserService.cs | 12 +- TINKLib/Model/Device/IGeolodationDependent.cs | 8 +- TINKLib/Model/Device/ISmartDevice.cs | 26 +- TINKLib/Model/Device/ISpecialFolder.cs | 22 +- TINKLib/Model/Device/IWebView.cs | 10 +- TINKLib/Model/EnumExtensions.cs | 48 +- TINKLib/Model/FileOperationException.cs | 12 +- TINKLib/Model/FilterCollectionStore.cs | 12 +- TINKLib/Model/GroupFilterHelper.cs | 70 +- TINKLib/Model/IBookingFinishedModel.cs | 14 +- TINKLib/Model/IPosition.cs | 12 +- TINKLib/Model/ITinkApp.cs | 153 +- .../Logging/EmptyDirectoryLoggingManger.cs | 24 +- .../Model/Logging/ILoggingDirectoryManager.cs | 26 +- .../Model/Logging/LogEntryClassifyHelper.cs | 52 +- .../Logging/LoggerConfigurationHelper.cs | 182 +- .../Model/Logging/LoggingDirectoryManager.cs | 224 +- TINKLib/Model/Map/IMapSpan.cs | 18 +- TINKLib/Model/Map/MapSpan.cs | 40 +- TINKLib/Model/Map/MapSpanFactory.cs | 14 +- TINKLib/Model/Map/NullMapSpan.cs | 18 +- TINKLib/Model/MiniSurvey/IMiniSurveyModel.cs | 22 +- TINKLib/Model/MiniSurvey/IQuestionModel.cs | 18 +- TINKLib/Model/MiniSurvey/MiniSurveyModel.cs | 46 +- TINKLib/Model/MiniSurvey/QuestionModel.cs | 18 +- TINKLib/Model/NullPostion.cs | 18 +- TINKLib/Model/Position.cs | 90 +- TINKLib/Model/PositionFactory.cs | 14 +- TINKLib/Model/ResourceUrls.cs | 42 +- TINKLib/Model/Settings/GroupFilterSettings.cs | 90 +- .../Model/Settings/IGroupFilterSettings.cs | 10 +- .../Model/Settings/JsonSettingsDictionary.cs | 1076 +++---- TINKLib/Model/Settings/PollingParameters.cs | 164 +- TINKLib/Model/Settings/Settings.cs | 176 +- TINKLib/Model/State/BaseState.cs | 36 +- TINKLib/Model/State/IBaseState.cs | 14 +- TINKLib/Model/State/INotAvailableState.cs | 18 +- TINKLib/Model/State/IStateInfo.cs | 18 +- TINKLib/Model/State/IStateInfoMutable.cs | 32 +- TINKLib/Model/State/StateAvailableInfo.cs | 40 +- .../Model/State/StateFeedbackPendingInfo.cs | 40 +- TINKLib/Model/State/StateInfo.cs | 300 +- TINKLib/Model/State/StateInfoHelper.cs | 20 +- TINKLib/Model/State/StateInfoMutable.cs | 504 +-- TINKLib/Model/State/StateOccupiedInfo.cs | 134 +- TINKLib/Model/State/StateRequestedInfo.cs | 190 +- TINKLib/Model/Station/IStation.cs | 26 +- TINKLib/Model/Station/NullStation.cs | 28 +- TINKLib/Model/Station/Operator/Data.cs | 52 +- TINKLib/Model/Station/Operator/IData.cs | 26 +- TINKLib/Model/Station/Station.cs | 64 +- TINKLib/Model/Station/StationCollection.cs | 152 +- TINKLib/Model/TinkApp.cs | 653 ++-- TINKLib/Model/User/Account/Account.cs | 170 +- .../Model/User/Account/AccountExtensions.cs | 52 +- TINKLib/Model/User/Account/AccountMutable.cs | 118 +- TINKLib/Model/User/Account/EmptyAccount.cs | 20 +- TINKLib/Model/User/Account/IAccount.cs | 36 +- TINKLib/Model/User/Account/IStore.cs | 38 +- TINKLib/Model/User/Account/Store.cs | 110 +- TINKLib/Model/User/Account/Validator.cs | 278 +- TINKLib/Model/User/IUser.cs | 18 +- TINKLib/Model/User/User.cs | 234 +- .../User/UsernamePasswordInvalidException.cs | 12 +- TINKLib/Model/WhatsNew.cs | 1218 ++++---- TINKLib/Model/WhatsNewMessages.cs | 178 +- .../AppResources.Designer.cs | 99 +- .../AppResources.de.resx | 63 +- .../MultilingualResources/AppResources.resx | 63 +- TINKLib/MultilingualResources/TINKLib.de.xlf | 114 +- TINKLib/Repository/AppContextInfo.cs | 48 +- TINKLib/Repository/CopriCallsHttps.cs | 1560 +++++----- TINKLib/Repository/CopriCallsMonkeyStore.cs | 526 ++-- TINKLib/Repository/CopriCallsStatic.cs | 80 +- .../AuthcookieNotDefinedException.cs | 104 +- .../AuthorizationResponseException.cs | 22 +- .../Exception/BookingDeclinedException.cs | 64 +- .../Exception/CallNotRequiredException.cs | 6 +- .../Exception/CommunicationException.cs | 46 +- .../Exception/DeserializationException.cs | 12 +- .../Exception/InvalidResponseException.cs | 56 +- .../Exception/NoGPSDataException.cs | 40 +- .../Exception/NotAtStationException.cs | 58 +- .../Repository/Exception/ResponseException.cs | 18 +- .../Exception/ReturnBikeException.cs | 10 +- ...nsupportedCopriVersionDetectedException.cs | 10 +- .../Exception/WebConnectFailureException.cs | 32 +- .../Exception/WebExceptionHelper.cs | 64 +- .../Exception/WebForbiddenException.cs | 22 +- TINKLib/Repository/ICopriServer.cs | 276 +- TINKLib/Repository/Request/IRequestBuilder.cs | 252 +- .../Repository/Request/QueryBuilderHelper.cs | 46 +- TINKLib/Repository/Request/RequestBuilder.cs | 230 +- .../Request/RequestBuilderHelper.cs | 24 +- .../Request/RequestBuilderLoggedIn.cs | 520 ++-- .../Response/AuthorizationResponse.cs | 24 +- .../Response/AuthorizationoutResponse.cs | 8 +- .../Repository/Response/BikeInfoAvailable.cs | 20 +- TINKLib/Repository/Response/BikeInfoBase.cs | 170 +- .../Response/BikeInfoReservedBooked.cs | 44 +- TINKLib/Repository/Response/BikeType.cs | 142 +- .../Response/BikesAvailableResponse.cs | 24 +- .../Response/BikesReservedOccupiedResponse.cs | 16 +- TINKLib/Repository/Response/CopriVersion.cs | 12 +- .../Repository/Response/DoReturnResponse.cs | 16 +- .../Repository/Response/JsonConvertRethrow.cs | 42 +- TINKLib/Repository/Response/MapSpan.cs | 22 +- TINKLib/Repository/Response/MiniSurvey.cs | 44 +- TINKLib/Repository/Response/Position.cs | 22 +- .../Repository/Response/RentalDescription.cs | 64 +- .../Response/ReservationBookingResponse.cs | 20 +- .../ReservationCancelReturnResponse.cs | 12 +- TINKLib/Repository/Response/ResponseBase.cs | 82 +- .../Repository/Response/ResponseContainer.cs | 36 +- TINKLib/Repository/Response/ResponseHelper.cs | 420 +-- .../Response/StationsAvailableResponse.cs | 104 +- .../Response/SubmitFeedbackResponse.cs | 6 +- .../Repository/Response/TariffDescription.cs | 86 +- .../Response/VersionindependentResponse.cs | 30 +- .../BluetoothLock/ILocksServiceFake.cs | 8 +- .../BluetoothLock/LocksServiceInReach.cs | 256 +- .../BluetoothLock/LocksServiceOutOfReach.cs | 90 +- .../LocksServicesContainerMutable.cs | 70 +- .../Services/CopriApi/CopriProviderHttps.cs | 512 +-- .../CopriApi/CopriProviderMonkeyStore.cs | 184 +- .../Exception/BikeStillInStationException.cs | 8 +- TINKLib/Services/CopriApi/GeneralData.cs | 50 +- .../Services/CopriApi/ICachedCopriServer.cs | 46 +- TINKLib/Services/CopriApi/ICopriCache.cs | 36 +- TINKLib/Services/CopriApi/Polling.cs | 374 +-- TINKLib/Services/CopriApi/Result.cs | 56 +- .../CopriApi/ServerUris/CopriHelper.cs | 20 +- .../CopriApi/ServerUris/CopriServerUriList.cs | 134 +- .../CopriApi/StationsAndBikesContainer.cs | 20 +- .../GeolocationAccuracyBestService.cs | 14 +- .../GeolocationAccuracyHighService.cs | 14 +- .../GeolocationAccuracyMediumService.cs | 14 +- .../Geolocation/GeolocationService.cs | 106 +- TINKLib/Services/Geolocation/IGeolocation.cs | 22 +- .../LastKnownGeolocationService.cs | 110 +- .../SimulatedGeolocationService.cs | 36 +- TINKLib/Services/IServicesContainer.cs | 16 +- TINKLib/Services/Logging/MemoryStackSink.cs | 64 +- .../Logging/MemoryStackSinkExtensions.cs | 18 +- .../Permissions/Essentials/Permissions.cs | 128 +- .../Permissions/ILocationPermission.cs | 64 +- .../Permissions/Plugin/Permissions.cs | 88 +- TINKLib/Services/ServicesContainerMutable.cs | 72 +- TINKLib/Services/ServicesContainerMutableT.cs | 76 +- TINKLib/Services/ThemeNS/ITheme.cs | 26 +- TINKLib/Services/ThemeNS/Theme.cs | 72 +- TINKLib/TINKLib.csproj | 2 +- TINKLib/View/IViewService.cs | 166 +- .../BackendPermissionsToVisibleConverter.cs | 40 +- .../Settings/PermissionToVisibleConverter.cs | 46 +- TINKLib/View/Themes/ITheme.cs | 8 +- TINKLib/View/Themes/Konrad.xaml.cs | 20 +- TINKLib/View/Themes/LastenradBayern.xaml.cs | 20 +- TINKLib/View/Themes/ShareeBike.xaml.cs | 20 +- .../ViewModel/Account/AccountPageViewModel.cs | 753 +++-- .../ViewModel/Bikes/Bike/BC/BikeViewModel.cs | 214 +- .../Bikes/Bike/BC/RequestHandler/Base.cs | 154 +- .../Bikes/Bike/BC/RequestHandler/Booked.cs | 104 +- .../Bike/BC/RequestHandler/Disposable.cs | 170 +- .../Bike/BC/RequestHandler/IRequestHandler.cs | 16 +- .../Bike/BC/RequestHandler/NotLoggedIn.cs | 118 +- .../Bikes/Bike/BC/RequestHandler/Reserved.cs | 176 +- .../Bikes/Bike/BC/RequestHandlerFactory.cs | 96 +- .../ViewModel/Bikes/Bike/BC/StateToText.cs | 36 +- .../ViewModel/Bikes/Bike/BikeViewModelBase.cs | 776 ++--- .../Bikes/Bike/BikeViewModelFactory.cs | 112 +- .../Bikes/Bike/BluetoothLock/BikeViewModel.cs | 304 +- .../Bike/BluetoothLock/RequestHandler/Base.cs | 66 +- .../RequestHandler/BookedClosed.cs | 736 ++--- .../RequestHandler/BookedDisconnected.cs | 396 +-- .../RequestHandler/BookedOpen.cs | 1122 +++---- .../RequestHandler/BookedUnknown.cs | 604 ++-- .../RequestHandler/DisposableDisconnected.cs | 668 ++-- .../RequestHandler/DisposableOpen.cs | 460 +-- .../RequestHandler/IRequestHandler.cs | 34 +- .../RequestHandler/InvalidState.cs | 70 +- .../RequestHandler/NotLoggedIn.cs | 126 +- .../RequestHandler/ReservedClosed.cs | 598 ++-- .../RequestHandler/ReservedDisconnected.cs | 1016 +++--- .../RequestHandler/ReservedOpen.cs | 686 ++-- .../RequestHandler/ReservedUnknown.cs | 604 ++-- .../BluetoothLock/RequestHandlerFactory.cs | 422 +-- .../Bikes/Bike/CopriLock/BikeViewModel.cs | 286 +- .../Bike/CopriLock/RequestHandler/Base.cs | 50 +- .../CopriLock/RequestHandler/BookedClosed.cs | 176 +- .../CopriLock/RequestHandler/BookedOpen.cs | 176 +- .../RequestHandler/DisposableClosed.cs | 332 +- .../RequestHandler/FeedbackPending.cs | 196 +- .../RequestHandler/ReservedClosed.cs | 346 +- .../Bike/CopriLock/RequestHandlerFactory.cs | 212 +- .../Bikes/Bike/IRequestHandlerBase.cs | 42 +- .../Bikes/Bike/TariffDescriptionViewModel.cs | 98 +- TINKLib/ViewModel/Bikes/BikesViewModel.cs | 744 ++--- TINKLib/ViewModel/Bikes/IBikesViewModel.cs | 18 +- .../BikeAtStationInUseStateInfoProvider.cs | 90 +- .../BikesAtStationPageViewModel.cs | 556 ++-- .../ViewModel/Contact/ContactPageViewModel.cs | 598 ++-- .../Contact/SelectStationPageViewModel.cs | 969 +++--- .../CopriWebView/ManageAccountViewModel.cs | 80 +- .../PasswordForgottonViewModel.cs | 72 +- .../CopriWebView/RegisterPageViewModel.cs | 70 +- .../FeesAndBikes/FeesAndBikesPageViewModel.cs | 120 +- .../FindBike/FindBikePageViewModel.cs | 476 +-- TINKLib/ViewModel/IInUseStateInfoProvider.cs | 38 +- .../ViewModel/IPollingUpdateTaskManager.cs | 26 +- .../ViewModel/IdlePollingUpdateTaskManager.cs | 26 +- .../BikeInfo/BikeInfoCarouselViewModel.cs | 244 +- .../BikeInfo/BikeInfoCarouseltemViewModel.cs | 120 +- TINKLib/ViewModel/Info/InfoPageViewModel.cs | 328 +- TINKLib/ViewModel/Login/LoginPageViewModel.cs | 565 ++-- TINKLib/ViewModel/Map/EmptyToggleViewModel.cs | 34 +- TINKLib/ViewModel/Map/GroupFilterMapPage.cs | 76 +- .../ViewModel/Map/GroupFilterMapPageHelper.cs | 116 +- TINKLib/ViewModel/Map/IGroupFilterMapPage.cs | 16 +- .../Map/ITinkKonradToggleViewModel.cs | 24 +- TINKLib/ViewModel/Map/MapPageViewModel.cs | 1751 ++++++----- .../Map/TinkKonradToggleViewModel.cs | 124 +- .../MiniSurvey/MiniSurveyViewModel.cs | 230 +- .../MiniSurvey/Question/CheckOneViewModel.cs | 66 +- .../MiniSurvey/Question/FreeTextViewModel.cs | 46 +- .../Question/IMiniSurveyQuestion.cs | 14 +- TINKLib/ViewModel/MyBikes/MyBikeViewModel.cs | 152 +- .../ViewModel/MyBikes/MyBikesPageViewModel.cs | 410 +-- TINKLib/ViewModel/PollingUpdateTask.cs | 213 +- TINKLib/ViewModel/PollingUpdateTaskManager.cs | 150 +- .../Settings/CopriServerUriListViewModel.cs | 122 +- .../ViewModel/Settings/FilterItemMutable.cs | 98 +- .../Settings/LocksServicesViewModel.cs | 48 +- .../ViewModel/Settings/PollingViewModel.cs | 172 +- .../ViewModel/Settings/ServicesViewModel.cs | 120 +- .../Settings/SettingsBikeFilterViewModel.cs | 104 +- .../Settings/SettingsPageViewModel.cs | 590 ++-- TINKLib/ViewModel/ViewModelHelper.cs | 454 +-- .../ViewModel/WhatsNew/Agb/AgbViewModel.cs | 124 +- .../ViewModel/WhatsNew/WhatsNewViewModel.cs | 158 +- TINKLib/ViewTypes.cs | 40 +- TestFramework/LoginSessionCopriInfo.cs | 114 +- TestFramework/Model/Device/DeviceMock.cs | 66 +- .../Model/Device/SpecialFolderMock.cs | 34 +- TestFramework/Model/User/Account/StoreMock.cs | 60 +- .../Repository/CopriCallMemoryBase.cs | 510 +-- .../Repository/CopriCallsMemory001.cs | 32 +- TestFramework/Repository/ExceptionServer.cs | 148 +- .../BluetoothLock/LocksServiceMock.cs | 126 +- .../CopriApi/CopriCallsCacheMemory001.cs | 174 +- .../Services/Geolocation/GeolocationMock.cs | 20 +- TestFramework/TestHelper.cs | 30 +- .../BluetoothLock/BLE/TestLockItBase.cs | 298 +- .../BluetoothLock/BLE/TestLockItEventBased.cs | 522 ++-- .../BluetoothLock/BLE/TestLockItPolling.cs | 438 +-- .../BLE/TestLockItServiceBase.cs | 92 +- .../BluetoothLock/BLE/TestPluginBleHelper.cs | 64 +- TestLockItBLE/TestLockItBLE.csproj | 2 +- ...tCouldntCloseInconsistentStateExecption.cs | 40 +- ...stCouldntOpenInconsistentStateExecption.cs | 40 +- .../BluetoothLock/TestTimeOutProvider.cs | 38 +- TestLockItShared/TestLockItShared.csproj | 2 +- TestShareeLib/Model/Bike/BC/TestBikeInfo.cs | 114 +- .../Model/Bike/BC/TestBikeMutable.cs | 154 +- .../Model/Bike/BluetoothLock/TestBikeInfo.cs | 172 +- .../Bike/BluetoothLock/TestBikeInfoMutalbe.cs | 36 +- .../Model/Bike/BluetoothLock/TestLockInfo.cs | 322 +- .../Bike/BluetoothLock/TestLockInfoHelper.cs | 72 +- .../Bike/BluetoothLock/TestLockInfoMutable.cs | 102 +- .../Model/Bike/CopriLock/TestBikeInfo.cs | 142 +- .../Bike/CopriLock/TestBikeInfoMutable.cs | 52 +- TestShareeLib/Model/Bike/TestBike.cs | 66 +- .../Model/Bike/TestBikeCollection.cs | 24 +- .../Model/Bike/TestBikeCollectionMutable.cs | 402 +-- TestShareeLib/Model/Bike/TestBikeExtension.cs | 36 +- .../BikeInfo/DriveNS/BatteryNS/TestBattery.cs | 72 +- .../BikeInfo/DriveNS/TestDriveMutable.cs | 66 +- .../Filter/TestIntersectGroupFilterHelper.cs | 120 +- .../Connector/TestCachedQueryLoggedIn.cs | 310 +- .../Model/Connector/TestCachetimings.cs | 208 +- .../Model/Connector/TestConnectorFactory.cs | 32 +- .../Model/Connector/TestCopriProviderHttps.cs | 852 ++--- .../Model/Connector/TestTextToTypeHelper.cs | 1038 +++--- .../TestBookingFinishedModelFactory.cs | 230 +- .../Connector/Updater/TestDriveFactory.cs | 244 +- .../Updater/TestRentalDescription.cs | 204 +- .../Updater/TestTariffDescriptionFactory.cs | 300 +- .../Connector/Updater/TestUpdaterJSON.cs | 990 +++--- TestShareeLib/Model/Map/TestMapSpan.cs | 88 +- TestShareeLib/Model/Map/TestMapSpanFactory.cs | 36 +- TestShareeLib/Model/Map/TestNullMapSpan.cs | 38 +- .../Model/MiniSurvey/TestMiniSurveyModel.cs | 24 +- .../Model/MiniSurvey/TestQuestionModel.cs | 20 +- .../Settings/TestJsonSettingsDictionary.cs | 282 +- .../State/TestStateBookedInfoSerializeJSON.cs | 50 +- TestShareeLib/Model/Station/TestData.cs | 88 +- .../Model/TestBikeCollectionFilter.cs | 132 +- .../Model/TestBookingFinishedModel.cs | 24 +- .../Model/TestJsonSettingsDictionary.cs | 202 +- TestShareeLib/Model/TestNullPosition.cs | 38 +- TestShareeLib/Model/TestPosition.cs | 116 +- TestShareeLib/Model/TestPositionFactory.cs | 36 +- TestShareeLib/Model/TestTinkApp.cs | 126 +- TestShareeLib/Model/TestTinkAppLogin.cs | 118 +- TestShareeLib/Model/TestWhatsNew.cs | 328 +- TestShareeLib/Model/TestWhatsNewMessage.cs | 846 ++--- .../Request/TestQueryBuilderHelper.cs | 68 +- .../Repository/Request/TestRequestBuilder.cs | 152 +- .../Request/TestRequestBuilderLoggedIn.cs | 518 +-- .../Repository/Response/TestJsonConvert.cs | 24 +- .../Repository/Response/TestMiniSurvey.cs | 158 +- .../Response/TestRentalDescription.cs | 200 +- .../Response/TestTariffDescription.cs | 128 +- .../Repository/TestAppContextInfo.cs | 52 +- .../Repository/TestCopriCallsHttps.cs | 16 +- .../Repository/TestCopriCallsMonkeyStore.cs | 130 +- .../Repository/TestCopriCallsStatic.cs | 82 +- .../Services/CopriApi/TestGeneralData.cs | 116 +- TestShareeLib/Services/CopriApi/TestResult.cs | 44 +- .../Services/TestServicesContainerMutable.cs | 94 +- TestShareeLib/TestShareeLib.csproj | 2 +- .../RequestHandler/TestBookedClosed.cs | 2629 ++++++++-------- .../RequestHandler/TestBookedDisconnected.cs | 782 ++--- .../RequestHandler/TestBookedOpen.cs | 2772 +++++++++-------- .../RequestHandler/TestBookedUnknown.cs | 2168 ++++++------- .../TestDisposableDisconnected.cs | 1134 +++---- .../RequestHandler/TestDisposableOpen.cs | 726 ++--- .../RequestHandler/TestReservedClosed.cs | 2266 +++++++------- .../TestReservedDisconnected.cs | 1418 ++++----- .../RequestHandler/TestReservedOpen.cs | 1116 +++---- .../RequestHandler/TestReservedUnknown.cs | 1908 ++++++------ .../RequestHandler/TestBookedClosed.cs | 358 +-- .../RequestHandler/TestBookedOpen.cs | 358 +-- .../RequestHandler/TestDisposableClosed.cs | 1278 ++++---- .../RequestHandler/TestFeedbackPending.cs | 340 +- .../RequestHandler/TestReservedClosed.cs | 1244 ++++---- .../CopriLock/TestReqeustHandlerFactory.cs | 228 +- .../Bikes/Bike/TestBikeViewModelBase.cs | 50 +- .../Bike/TestTariffDescriptionViewModel.cs | 120 +- .../TestBikesAtStationPageViewModel.cs | 2526 +++++++-------- .../TestManageAccountViewModel.cs | 20 +- .../TestPasswordForgottonViewModel.cs | 54 +- .../CopriWebView/TestRegisterPageViewModel.cs | 18 +- .../Login/TestManageAccountViewModel.cs | 18 +- .../Question/TestCheckOneViewModel.cs | 86 +- .../Question/TestFreeTextViewModel.cs | 74 +- .../Settings/TestServicesViewModel.cs | 202 +- .../ViewModel/TestPollingTaskManager.cs | 58 +- .../ViewModel/TestPollingUpdateTask.cs | 60 +- .../ViewModel/TestViewModelHelper.cs | 204 +- .../TestShareeSharedGuiLib.csproj | 2 +- .../ViewModel/TestBarLevelViewModel.cs | 118 +- .../Bike/BC/TestBikeInfoMutable.cs | 246 +- .../Connector/CopriCallsHttpReference.cs | 406 +-- .../TestAuthcookieNotDefinedException.cs | 72 +- .../Connector/Filter/TestIntersectFilter.cs | 54 +- .../Connector/Filter/TestNullFilter.cs | 24 +- .../Connector/Query/TestCachedQuery.cs | 184 +- .../Query/TestCachedQueryLoggedIn.cs | 378 +-- .../Response/TestBikesAvailableResponse.cs | 36 +- .../Response/TestBikesOccupiedResponse.cs | 74 +- .../Connector/Response/TestBookingResponse.cs | 78 +- .../Connector/Response/TestResponseBase.cs | 50 +- .../Connector/Response/TestResponseHelper.cs | 128 +- .../Response/TestStationsAllResponse.cs | 58 +- .../Connector/TestCommandLoggedIn.cs | 86 +- .../ObjectTests/Connector/TestConnector.cs | 138 +- .../Connector/TestConnectorCache.cs | 130 +- .../Connector/TestCopriCallsHttps.cs | 970 +++--- .../Connector/TestCopriCallsMemory.cs.cs | 110 +- .../Connector/TestCopriCallsStatic.cs | 124 +- .../Connector/TestCopriServerUriList.cs | 98 +- .../ObjectTests/Connector/TestFilter.cs | 150 +- .../Logging/TestLoggingDirectoryManager.cs | 116 +- .../ObjectTests/Map/TestMapPageFilter.cs | 52 +- .../Exception/TestBookingDeclinedException.cs | 48 +- .../Exception/TestNoGPSDataException.cs | 40 +- .../Exception/TestNotAtStationException.cs | 48 +- .../BluetoothLock/Crypto/TestCryptoHelper.cs | 114 +- .../BluetoothLock/Tdo/TestLockInfoAuthTdo.cs | 34 +- .../BluetoothLock/TestLockItBaseService.cs | 130 +- .../TestLockServiceSimulation.cs | 40 +- .../TestLocksServicesContainerMutable.cs | 32 +- .../Services/TestServicesContainerMutable.cs | 62 +- .../Settings/BluetoothLock/TestLockIt.cs | 310 +- .../Settings/TestGroupFilterSettings.cs | 24 +- .../Settings/TestPollingParameters.cs | 62 +- .../ObjectTests/Settings/TestSettings.cs | 54 +- .../ObjectTests/State/TestStateBookedInfo.cs | 36 +- .../State/TestStateDisposableInfo.cs | 18 +- .../ObjectTests/State/TestStateInfoMutable.cs | 294 +- .../State/TestStateInfoSerializeJSON.cs | 294 +- .../State/TestStateRequestedInfo.cs | 126 +- .../TestStateRequestedInfoSerializeJSON.cs | 58 +- .../ObjectTests/Station/TestNullStation.cs | 40 +- .../ObjectTests/Station/TestStation.cs | 72 +- .../ObjectTests/TestFilterCollection.cs | 34 +- .../ObjectTests/TestFilterCollectionStore.cs | 192 +- .../ObjectTests/User/Account/TestAccount.cs | 92 +- .../User/Account/TestAccountExtensions.cs | 66 +- .../ObjectTests/User/Account/TestValidator.cs | 30 +- .../Fixtures/ObjectTests/User/TestUser.cs | 136 +- .../Account/TestAccountPageViewModel.cs | 414 +-- .../TestRequestHandlerFactory.cs | 272 +- .../ViewModel/Info/TestInfoViewModel.cs | 18 +- .../ViewModel/Map/TestMapPageFilter.cs | 262 +- .../ViewModel/Map/TestMapPageViewModel.cs | 1116 +++---- .../Settings/TestFilterCollectionMutable.cs | 166 +- ...TestBikeAtStationInUseStateInfoProvider.cs | 38 +- .../ViewModel/TestBikeAtStationViewModel.cs | 398 +-- .../ViewModel/TestBikeViewModel.cs | 252 +- .../ViewModel/TestBikeViewModelFactory.cs | 128 +- .../TestMyBikeInUseStateInfoProvider.cs | 46 +- .../ViewModel/TestMyBikePageViewModel.cs | 140 +- .../ViewModel/TestMyBikesPageViewModel.cs | 1618 +++++----- .../ViewModel/TestViewModelHelper.cs | 136 +- .../UseCases/ConnectedOffline/TestTinkApp.cs | 74 +- .../UseCases/SelectStation/TestTinkApp.cs | 102 +- TestTINKLib/Fixtures/UseCases/TestHelper.cs | 34 +- TestTINKLib/Mocks/Bike/BikeCollectionMock.cs | 30 +- .../Mocks/Connector/CopriCallsCacheMemory.cs | 192 +- TestTINKLib/Mocks/DateTimeMocker.cs | 30 +- TestTINKLib/TestHelper.cs | 30 +- 751 files changed, 62747 insertions(+), 60672 deletions(-) create mode 100644 TINK/TINK.Android/Resources/drawable/bike_Cargo_Pedelec_Two.png create mode 100644 TINK/TINK.Android/Resources/drawable/bike_Cargo_SoleHumanPowered_Trike.png create mode 100644 TINK/TINK.Android/Resources/drawable/bike_Cargo_SoleHumanPowered_Two.png create mode 100644 TINK/TINK.Android/Resources/drawable/bike_City_SoleHumanPowered_Two.png create mode 100644 TINK/TINK.iOS/Media.xcassets/bike_Cargo_Pedelec_Two.imageset/Contents.json create mode 100644 TINK/TINK.iOS/Media.xcassets/bike_Cargo_Pedelec_Two.imageset/bike_Cargo_Pedelec_Two.svg create mode 100644 TINK/TINK.iOS/Media.xcassets/bike_Cargo_SoleHumanPowered_Trike.imageset/Contents.json create mode 100644 TINK/TINK.iOS/Media.xcassets/bike_Cargo_SoleHumanPowered_Trike.imageset/bike_Cargo_SoleHumanPowered_Trike.svg create mode 100644 TINK/TINK.iOS/Media.xcassets/bike_Cargo_SoleHumanPowered_Two.imageset/Contents.json create mode 100644 TINK/TINK.iOS/Media.xcassets/bike_Cargo_SoleHumanPowered_Two.imageset/bike_Cargo_SoleHumanPowered_Two.svg create mode 100644 TINK/TINK.iOS/Media.xcassets/bike_City_SoleHumanPowered_Two.imageset/Contents.json create mode 100644 TINK/TINK.iOS/Media.xcassets/bike_City_SoleHumanPowered_Two.imageset/bike_City_SoleHumanPowered_Two.svg diff --git a/.editorconfig b/.editorconfig index 3e013bb..cf3a7e8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,21 +4,13 @@ root = true # All files [*] -indent_style = space - -# XML project files -[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] -indent_size = 2 - -# XML config files -[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] -indent_size = 2 - -# Code files -[*.{cs,csx,vb,vbx}] -indent_size = 4 +indent_style = tab +tab_width = 4 insert_final_newline = true -charset = utf-8-bom +trim_trailing_whitespace = true +charset = utf-8 +end_of_line = crlf + ############################### # .NET Coding Conventions # ############################### @@ -139,4 +131,4 @@ csharp_style_expression_bodied_local_functions = false:silent ############################### [*.vb] # Modifier preferences -visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion \ No newline at end of file +visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion diff --git a/LastenradBayern/TINK.Android/MainActivity.cs b/LastenradBayern/TINK.Android/MainActivity.cs index 033c3dd..1eea213 100644 --- a/LastenradBayern/TINK.Android/MainActivity.cs +++ b/LastenradBayern/TINK.Android/MainActivity.cs @@ -13,96 +13,96 @@ using Xamarin.Forms.Platform.Android.AppLinks; namespace TINK.Droid { - [Activity(Label = "LastenradBayern", Icon = "@drawable/sharee", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] + [Activity(Label = "LastenradBayern", Icon = "@drawable/sharee", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] - [IntentFilter(new[] { Intent.ActionView }, - Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault }, - DataScheme = "https", - DataHost = "sharee.bike", - DataPathPrefix = "/lastenrad", - AutoVerify = true)] + [IntentFilter(new[] { Intent.ActionView }, + Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault }, + DataScheme = "https", + DataHost = "sharee.bike", + DataPathPrefix = "/lastenrad", + AutoVerify = true)] - [IntentFilter(new[] { Intent.ActionView }, - Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault }, - DataScheme = "http", - DataHost = "sharee.bike", - DataPathPrefix = "/lastenrad", - AutoVerify = true)] + [IntentFilter(new[] { Intent.ActionView }, + Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault }, + DataScheme = "http", + DataHost = "sharee.bike", + DataPathPrefix = "/lastenrad", + AutoVerify = true)] - public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity - { - private void initFontScale() - { - Configuration configuration = Resources.Configuration; - configuration.FontScale = (float)1; - //0.85 small, 1 standard, 1.15 big,1.3 more bigger ,1.45 supper big - DisplayMetrics metrics = new DisplayMetrics(); - WindowManager.DefaultDisplay.GetMetrics(metrics); - metrics.ScaledDensity = configuration.FontScale * metrics.Density; - BaseContext.Resources.UpdateConfiguration(configuration, metrics); - } - protected override void OnCreate(Bundle bundle) - { - initFontScale(); + public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity + { + private void initFontScale() + { + Configuration configuration = Resources.Configuration; + configuration.FontScale = (float)1; + //0.85 small, 1 standard, 1.15 big,1.3 more bigger ,1.45 supper big + DisplayMetrics metrics = new DisplayMetrics(); + WindowManager.DefaultDisplay.GetMetrics(metrics); + metrics.ScaledDensity = configuration.FontScale * metrics.Density; + BaseContext.Resources.UpdateConfiguration(configuration, metrics); + } + protected override void OnCreate(Bundle bundle) + { + initFontScale(); - TabLayoutResource = Resource.Layout.Tabbar; - ToolbarResource = Resource.Layout.Toolbar; + TabLayoutResource = Resource.Layout.Tabbar; + ToolbarResource = Resource.Layout.Toolbar; - base.OnCreate(bundle); + base.OnCreate(bundle); - global::Xamarin.Forms.Forms.Init(this, bundle); + global::Xamarin.Forms.Forms.Init(this, bundle); - FirebaseApp.InitializeApp(this); - AndroidAppLinks.Init(this); + FirebaseApp.InitializeApp(this); + AndroidAppLinks.Init(this); - // Initialize xamarin.essentials, see https://docs.microsoft.com/en-us/xamarin/essentials/get-started?tabs=macos%2Candroid. - Xamarin.Essentials.Platform.Init(this, bundle); + // Initialize xamarin.essentials, see https://docs.microsoft.com/en-us/xamarin/essentials/get-started?tabs=macos%2Candroid. + Xamarin.Essentials.Platform.Init(this, bundle); - // Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/ - Xamarin.FormsGoogleMaps.Init(this, bundle); + // Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/ + Xamarin.FormsGoogleMaps.Init(this, bundle); - // Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings. - Xamarin.FormsGoogleMapsBindings.Init(); + // Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings. + Xamarin.FormsGoogleMapsBindings.Init(); - // Get version name of app. - Context context = ApplicationContext; - new Model.Device.AppInfo(context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName); + // Get version name of app. + Context context = ApplicationContext; + new Model.Device.AppInfo(context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName); - Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) => - { - if (!string.IsNullOrWhiteSpace(e.View.AutomationId)) - { - e.NativeView.ContentDescription = e.View.AutomationId; - } - }; + Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) => + { + if (!string.IsNullOrWhiteSpace(e.View.AutomationId)) + { + e.NativeView.ContentDescription = e.View.AutomationId; + } + }; - LoadApplication(new App()); - } + LoadApplication(new App()); + } - /// - /// Handles opening the dialog to request for permissions. - /// - public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults) - { - if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Essentials.Permissions)) - { - Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); - } - else if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Plugin.Permissions)) - { - // Bug in 3.0.244 and earlier versions of sharee.bike app: Call of PermissionsImplementation.Current.OnRequestedPermission result was missing. - // see https://dev.azure.com/TeilRad/sharee.bike%20Buchungsplattform/_workitems/edit/136 for further details. - PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults); - } + /// + /// Handles opening the dialog to request for permissions. + /// + public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults) + { + if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Essentials.Permissions)) + { + Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults); + } + else if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Plugin.Permissions)) + { + // Bug in 3.0.244 and earlier versions of sharee.bike app: Call of PermissionsImplementation.Current.OnRequestedPermission result was missing. + // see https://dev.azure.com/TeilRad/sharee.bike%20Buchungsplattform/_workitems/edit/136 for further details. + PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults); + } - base.OnRequestPermissionsResult(requestCode, permissions, grantResults); - } + base.OnRequestPermissionsResult(requestCode, permissions, grantResults); + } - [Export("TapStation")] - public void TapStation(string stationNr) - { - BackdoorMethodHelpers.DoTapPage(stationNr); - } - } + [Export("TapStation")] + public void TapStation(string stationNr) + { + BackdoorMethodHelpers.DoTapPage(stationNr); + } + } } diff --git a/LastenradBayern/TINK.Android/Model/Device/AppInfo.cs b/LastenradBayern/TINK.Android/Model/Device/AppInfo.cs index 58b23f0..8febfc6 100644 --- a/LastenradBayern/TINK.Android/Model/Device/AppInfo.cs +++ b/LastenradBayern/TINK.Android/Model/Device/AppInfo.cs @@ -6,40 +6,40 @@ using Xamarin.Forms; [assembly: Dependency(typeof(AppInfo))] namespace TINK.Droid.Model.Device { - /// Holds information about the TINK- app. - public class AppInfo : IAppInfo - { - /// Holds the the version of the app. - private static Version m_oVersion = null; + /// Holds information about the TINK- app. + public class AppInfo : IAppInfo + { + /// Holds the the version of the app. + private static Version m_oVersion = null; - /// Constructs a app info object. - public AppInfo() - { - } + /// Constructs a app info object. + public AppInfo() + { + } - /// Constructs a app info object for initialization. - /// Version to initializ object with. - internal AppInfo(string p_strVersionText) - { - if (m_oVersion != null) - { - // Set version only once. - return; - } + /// Constructs a app info object for initialization. + /// Version to initializ object with. + internal AppInfo(string p_strVersionText) + { + if (m_oVersion != null) + { + // Set version only once. + return; + } - if (!Version.TryParse(p_strVersionText, out Version l_oVersion)) - { - m_oVersion = new Version(0, 8); - } + if (!Version.TryParse(p_strVersionText, out Version l_oVersion)) + { + m_oVersion = new Version(0, 8); + } - m_oVersion = l_oVersion; - } + m_oVersion = l_oVersion; + } - /// Get the version of the app. - public Version Version => m_oVersion ?? new Version(0, 9); + /// Get the version of the app. + public Version Version => m_oVersion ?? new Version(0, 9); - /// Gets the URL to the app store. - /// The store URL. - public string StoreUrl => $"https://play.google.com/store/apps/details?id={Android.App.Application.Context.PackageName}"; - } + /// Gets the URL to the app store. + /// The store URL. + public string StoreUrl => $"https://play.google.com/store/apps/details?id={Android.App.Application.Context.PackageName}"; + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.Android/Model/Device/Device.cs b/LastenradBayern/TINK.Android/Model/Device/Device.cs index d01840b..d4c162b 100644 --- a/LastenradBayern/TINK.Android/Model/Device/Device.cs +++ b/LastenradBayern/TINK.Android/Model/Device/Device.cs @@ -5,19 +5,19 @@ using Xamarin.Forms; [assembly: Dependency(typeof(TINK.Droid.Model.Device.Device))] namespace TINK.Droid.Model.Device { - public class Device : ISmartDevice - { - public string Manufacturer => DeviceInfo.Manufacturer; + public class Device : ISmartDevice + { + public string Manufacturer => DeviceInfo.Manufacturer; - public string Model => DeviceInfo.Model; + public string Model => DeviceInfo.Model; - public DevicePlatform Platform => DeviceInfo.Platform; + public DevicePlatform Platform => DeviceInfo.Platform; - public string VersionText => DeviceInfo.VersionString; + public string VersionText => DeviceInfo.VersionString; - /// Gets unitque device identifier. - /// Gets the identifies specifying device. - public string Identifier - => Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId); - } + /// Gets unitque device identifier. + /// Gets the identifies specifying device. + public string Identifier + => Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId); + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.Android/Model/Device/ExternalBrowseService.cs b/LastenradBayern/TINK.Android/Model/Device/ExternalBrowseService.cs index a971c11..15bb1e6 100644 --- a/LastenradBayern/TINK.Android/Model/Device/ExternalBrowseService.cs +++ b/LastenradBayern/TINK.Android/Model/Device/ExternalBrowseService.cs @@ -6,18 +6,18 @@ using Xamarin.Forms; [assembly: Dependency(typeof(ExternalBrowseService))] namespace TINK.Droid.Model.Device { - public class ExternalBrowseService : IExternalBrowserService - { - /// Opens an external browser. - /// Url to open. - public void OpenUrl(string p_strUrl) - { - var uri = Android.Net.Uri.Parse(p_strUrl); - var intent = new Intent(Intent.ActionView, uri); + public class ExternalBrowseService : IExternalBrowserService + { + /// Opens an external browser. + /// Url to open. + public void OpenUrl(string p_strUrl) + { + var uri = Android.Net.Uri.Parse(p_strUrl); + var intent = new Intent(Intent.ActionView, uri); - intent.AddFlags(ActivityFlags.NewTask); + intent.AddFlags(ActivityFlags.NewTask); - Android.App.Application.Context.StartActivity(intent); - } - } + Android.App.Application.Context.StartActivity(intent); + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.Android/Model/Device/Gps.cs b/LastenradBayern/TINK.Android/Model/Device/Gps.cs index dfa055f..9087413 100644 --- a/LastenradBayern/TINK.Android/Model/Device/Gps.cs +++ b/LastenradBayern/TINK.Android/Model/Device/Gps.cs @@ -16,15 +16,15 @@ using Xamarin.Forms; [assembly: Dependency(typeof(TINK.Droid.Model.Device.Gps))] namespace TINK.Droid.Model.Device { - public class Gps : IGeolodationDependent - { - public bool IsGeolcationEnabled - { - get - { - LocationManager locationManager = (LocationManager)Android.App.Application.Context.GetSystemService(Context.LocationService); - return locationManager.IsProviderEnabled(LocationManager.GpsProvider); - } - } - } + public class Gps : IGeolodationDependent + { + public bool IsGeolcationEnabled + { + get + { + LocationManager locationManager = (LocationManager)Android.App.Application.Context.GetSystemService(Context.LocationService); + return locationManager.IsProviderEnabled(LocationManager.GpsProvider); + } + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.Android/Model/Device/SpecialFolder.cs b/LastenradBayern/TINK.Android/Model/Device/SpecialFolder.cs index 3ca8eae..d07b4cb 100644 --- a/LastenradBayern/TINK.Android/Model/Device/SpecialFolder.cs +++ b/LastenradBayern/TINK.Android/Model/Device/SpecialFolder.cs @@ -6,44 +6,44 @@ using Xamarin.Forms; [assembly: Dependency(typeof(TINK.Droid.Model.Device.SpecialFolder))] namespace TINK.Droid.Model.Device { - public class SpecialFolder : ISpecialFolder - { - /// Get the folder name of external folder to write to. - /// Name of the external folder. - public string GetExternalFilesDir() - { - string baseFolderPath = string.Empty; - try - { - var context = Android.App.Application.Context; - Java.IO.File[] dirs = context.GetExternalFilesDirs(null); + public class SpecialFolder : ISpecialFolder + { + /// Get the folder name of external folder to write to. + /// Name of the external folder. + public string GetExternalFilesDir() + { + string baseFolderPath = string.Empty; + try + { + var context = Android.App.Application.Context; + Java.IO.File[] dirs = context.GetExternalFilesDirs(null); - foreach (Java.IO.File folder in dirs) - { - bool IsRemovable = Android.OS.Environment.InvokeIsExternalStorageRemovable(folder); - bool IsEmulated = Android.OS.Environment.InvokeIsExternalStorageEmulated(folder); + foreach (Java.IO.File folder in dirs) + { + bool IsRemovable = Android.OS.Environment.InvokeIsExternalStorageRemovable(folder); + bool IsEmulated = Android.OS.Environment.InvokeIsExternalStorageEmulated(folder); - if (IsRemovable - && !IsEmulated) - { - baseFolderPath = folder.Path; - } - } - } + if (IsRemovable + && !IsEmulated) + { + baseFolderPath = folder.Path; + } + } + } - catch (Exception l_oException) - { - Log.Error("Getting external files directory failed. {@l_oException}", l_oException); - } + catch (Exception l_oException) + { + Log.Error("Getting external files directory failed. {@l_oException}", l_oException); + } - return baseFolderPath; - } + return baseFolderPath; + } - /// Gets the folder name of the personal data folder dir on internal storage. - /// Directory name. - public string GetInternalPersonalDir() - { - return Environment.GetFolderPath(Environment.SpecialFolder.Personal); - } - } + /// Gets the folder name of the personal data folder dir on internal storage. + /// Directory name. + public string GetInternalPersonalDir() + { + return Environment.GetFolderPath(Environment.SpecialFolder.Personal); + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.Android/Model/Device/WebView.cs b/LastenradBayern/TINK.Android/Model/Device/WebView.cs index dacf5dd..409c1c9 100644 --- a/LastenradBayern/TINK.Android/Model/Device/WebView.cs +++ b/LastenradBayern/TINK.Android/Model/Device/WebView.cs @@ -4,13 +4,13 @@ using TINK.Model.Device; [assembly: Xamarin.Forms.Dependency(typeof(TINK.Droid.Model.Device.WebView))] namespace TINK.Droid.Model.Device { - public class WebView : IWebView - { - /// Clears the cookie cache for all web views. - public void ClearCookies() - { - var cookieManager = CookieManager.Instance; - cookieManager.RemoveAllCookie(); - } - } + public class WebView : IWebView + { + /// Clears the cookie cache for all web views. + public void ClearCookies() + { + var cookieManager = CookieManager.Instance; + cookieManager.RemoveAllCookie(); + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml index d8a024c..3a74495 100644 --- a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml +++ b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/LastenradBayern/TINK.iOS/AppDelegate.cs b/LastenradBayern/TINK.iOS/AppDelegate.cs index 03eaae8..6e4119a 100644 --- a/LastenradBayern/TINK.iOS/AppDelegate.cs +++ b/LastenradBayern/TINK.iOS/AppDelegate.cs @@ -4,45 +4,45 @@ using Xamarin.Forms; namespace TINK.iOS { - // The UIApplicationDelegate for the application. This class is responsible for launching the - // User Interface of the application, as well as listening (and optionally responding) to - // application events from iOS. - [Register("AppDelegate")] - public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate - { - // - // This method is invoked when the application has loaded and is ready to run. In this - // method you should instantiate the window, load the UI into it and then make the window - // visible. - // - // You have 17 seconds to return from this method, or iOS will terminate your application. - // - public override bool FinishedLaunching(UIApplication app, NSDictionary options) - { - global::Xamarin.Forms.Forms.Init(); + // The UIApplicationDelegate for the application. This class is responsible for launching the + // User Interface of the application, as well as listening (and optionally responding) to + // application events from iOS. + [Register("AppDelegate")] + public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate + { + // + // This method is invoked when the application has loaded and is ready to run. In this + // method you should instantiate the window, load the UI into it and then make the window + // visible. + // + // You have 17 seconds to return from this method, or iOS will terminate your application. + // + public override bool FinishedLaunching(UIApplication app, NSDictionary options) + { + global::Xamarin.Forms.Forms.Init(); - //Color of Icons in Navigation bar (e.g. burger menu and back arrow) - //UINavigationBar.Appearance.TintColor = Color.White.ToUIColor(); + //Color of Icons in Navigation bar (e.g. burger menu and back arrow) + //UINavigationBar.Appearance.TintColor = Color.White.ToUIColor(); - new iOS.Device.AppInfo(NSBundle.MainBundle.InfoDictionary[new NSString("CFBundleShortVersionString")]?.ToString() ?? string.Empty); + new iOS.Device.AppInfo(NSBundle.MainBundle.InfoDictionary[new NSString("CFBundleShortVersionString")]?.ToString() ?? string.Empty); - Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => - { - // http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/ - if (null != e.View.AutomationId) - { - e.NativeView.AccessibilityIdentifier = e.View.AutomationId; - } - }; - LoadApplication(new TINK.App()); + Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => + { + // http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/ + if (null != e.View.AutomationId) + { + e.NativeView.AccessibilityIdentifier = e.View.AutomationId; + } + }; + LoadApplication(new TINK.App()); - // Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/ - Xamarin.FormsGoogleMaps.Init("000000000000000000000000000000000000000"); + // Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/ + Xamarin.FormsGoogleMaps.Init("000000000000000000000000000000000000000"); - // Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings. - Xamarin.FormsGoogleMapsBindings.Init(); + // Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings. + Xamarin.FormsGoogleMapsBindings.Init(); - return base.FinishedLaunching(app, options); - } - } + return base.FinishedLaunching(app, options); + } + } } diff --git a/LastenradBayern/TINK.iOS/Device/AppInfo.cs b/LastenradBayern/TINK.iOS/Device/AppInfo.cs index 22cec2a..8c62628 100644 --- a/LastenradBayern/TINK.iOS/Device/AppInfo.cs +++ b/LastenradBayern/TINK.iOS/Device/AppInfo.cs @@ -7,41 +7,41 @@ using Xamarin.Forms; [assembly: Dependency(typeof(AppInfo))] namespace TINK.iOS.Device { - /// Holds information about the TINK- app. - public class AppInfo : IAppInfo - { - /// Holds the the version of the app. - private static Version m_oVersion = null; + /// Holds information about the TINK- app. + public class AppInfo : IAppInfo + { + /// Holds the the version of the app. + private static Version m_oVersion = null; - /// Constructs a app info object. - public AppInfo() - { - } + /// Constructs a app info object. + public AppInfo() + { + } - /// Constructs a app info object for initialization. - /// Version to initializ object with. - internal AppInfo(string p_strVersionText) - { - if (m_oVersion != null) - { - // Set version only once. - return; - } + /// Constructs a app info object for initialization. + /// Version to initializ object with. + internal AppInfo(string p_strVersionText) + { + if (m_oVersion != null) + { + // Set version only once. + return; + } - if (!Version.TryParse(p_strVersionText, out Version l_oVersion)) - { - m_oVersion = new Version(0, 8); - } + if (!Version.TryParse(p_strVersionText, out Version l_oVersion)) + { + m_oVersion = new Version(0, 8); + } - m_oVersion = l_oVersion; - } + m_oVersion = l_oVersion; + } - /// Get the version of the app. - public Version Version => m_oVersion ?? new Version(0, 9); + /// Get the version of the app. + public Version Version => m_oVersion ?? new Version(0, 9); - /// Gets the URL to the app store. - /// TINK Url was @"http://itunes.apple.com/de/app/tink-konstanz/id1181519270?mt=8" - /// The store URL. - public string StoreUrl => $"https://itunes.apple.com/de/app/apple-store/{NSBundle.MainBundle.BundleIdentifier}?mt=8"; - } + /// Gets the URL to the app store. + /// TINK Url was @"http://itunes.apple.com/de/app/tink-konstanz/id1181519270?mt=8" + /// The store URL. + public string StoreUrl => $"https://itunes.apple.com/de/app/apple-store/{NSBundle.MainBundle.BundleIdentifier}?mt=8"; + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.iOS/Device/Device.cs b/LastenradBayern/TINK.iOS/Device/Device.cs index a715f2b..9fc0b4a 100644 --- a/LastenradBayern/TINK.iOS/Device/Device.cs +++ b/LastenradBayern/TINK.iOS/Device/Device.cs @@ -6,30 +6,30 @@ using Xamarin.Essentials; [assembly: Xamarin.Forms.Dependency(typeof(TINK.iOS.Device.Device))] namespace TINK.iOS.Device { - public class Device : ISmartDevice - { - [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")] - private static extern uint IOServiceGetMatchingService(uint masterPort, IntPtr matching); + public class Device : ISmartDevice + { + [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")] + private static extern uint IOServiceGetMatchingService(uint masterPort, IntPtr matching); - [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")] - private static extern IntPtr IOServiceMatching(string s); + [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")] + private static extern IntPtr IOServiceMatching(string s); - [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")] - private static extern IntPtr IORegistryEntryCreateCFProperty(uint entry, IntPtr key, IntPtr allocator, uint options); + [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")] + private static extern IntPtr IORegistryEntryCreateCFProperty(uint entry, IntPtr key, IntPtr allocator, uint options); - [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")] - private static extern int IOObjectRelease(uint o); + [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")] + private static extern int IOObjectRelease(uint o); - public string Manufacturer => DeviceInfo.Manufacturer; + public string Manufacturer => DeviceInfo.Manufacturer; - public string Model => DeviceInfo.Model; + public string Model => DeviceInfo.Model; - public DevicePlatform Platform => DeviceInfo.Platform; + public DevicePlatform Platform => DeviceInfo.Platform; - public string VersionText => DeviceInfo.VersionString; - /// Gets unitque device identifier. - /// Gets the identifies specifying device. - public string Identifier - => UIKit.UIDevice.CurrentDevice?.IdentifierForVendor?.AsString() ?? string.Empty; - } + public string VersionText => DeviceInfo.VersionString; + /// Gets unitque device identifier. + /// Gets the identifies specifying device. + public string Identifier + => UIKit.UIDevice.CurrentDevice?.IdentifierForVendor?.AsString() ?? string.Empty; + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.iOS/Device/ExternalBrowseService.cs b/LastenradBayern/TINK.iOS/Device/ExternalBrowseService.cs index c9a7998..b0ac186 100644 --- a/LastenradBayern/TINK.iOS/Device/ExternalBrowseService.cs +++ b/LastenradBayern/TINK.iOS/Device/ExternalBrowseService.cs @@ -7,17 +7,17 @@ using Xamarin.Forms; [assembly: Dependency(typeof(ExternalBrowseService))] namespace TINK.iOS.Device { - public class ExternalBrowseService : IExternalBrowserService - { - /// Opens an external browser. - /// Url to open. - public void OpenUrl(string p_strUrl) - { - var l_oUrl = NSUrl.FromString(p_strUrl); - if (l_oUrl == null) - return; + public class ExternalBrowseService : IExternalBrowserService + { + /// Opens an external browser. + /// Url to open. + public void OpenUrl(string p_strUrl) + { + var l_oUrl = NSUrl.FromString(p_strUrl); + if (l_oUrl == null) + return; - UIApplication.SharedApplication.OpenUrl(l_oUrl); - } - } + UIApplication.SharedApplication.OpenUrl(l_oUrl); + } + } } diff --git a/LastenradBayern/TINK.iOS/Device/Gps.cs b/LastenradBayern/TINK.iOS/Device/Gps.cs index 6728593..21c425b 100644 --- a/LastenradBayern/TINK.iOS/Device/Gps.cs +++ b/LastenradBayern/TINK.iOS/Device/Gps.cs @@ -3,8 +3,8 @@ [assembly: Xamarin.Forms.Dependency(typeof(TINK.iOS.Device.Gps))] namespace TINK.iOS.Device { - public class Gps : IGeolodationDependent - { - public bool IsGeolcationEnabled => true; - } + public class Gps : IGeolodationDependent + { + public bool IsGeolcationEnabled => true; + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.iOS/Device/SpecialFolder.cs b/LastenradBayern/TINK.iOS/Device/SpecialFolder.cs index 9434b04..5230371 100644 --- a/LastenradBayern/TINK.iOS/Device/SpecialFolder.cs +++ b/LastenradBayern/TINK.iOS/Device/SpecialFolder.cs @@ -5,23 +5,23 @@ using Xamarin.Forms; [assembly: Dependency(typeof(TINK.iOS.Device.SpecialFolder))] namespace TINK.iOS.Device { - public class SpecialFolder : ISpecialFolder - { - /// - /// Get the folder name of external folder to write to. - /// - /// - public string GetExternalFilesDir() - { - return Environment.GetFolderPath(Environment.SpecialFolder.Personal); - } + public class SpecialFolder : ISpecialFolder + { + /// + /// Get the folder name of external folder to write to. + /// + /// + public string GetExternalFilesDir() + { + return Environment.GetFolderPath(Environment.SpecialFolder.Personal); + } - /// Gets the folder name of the personal data folder dir on internal storage. - /// Directory name. - public string GetInternalPersonalDir() - { - return Environment.GetFolderPath(Environment.SpecialFolder.Personal); - } + /// Gets the folder name of the personal data folder dir on internal storage. + /// Directory name. + public string GetInternalPersonalDir() + { + return Environment.GetFolderPath(Environment.SpecialFolder.Personal); + } - } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.iOS/Device/WebView.cs b/LastenradBayern/TINK.iOS/Device/WebView.cs index 5a5a5cb..f490266 100644 --- a/LastenradBayern/TINK.iOS/Device/WebView.cs +++ b/LastenradBayern/TINK.iOS/Device/WebView.cs @@ -5,14 +5,14 @@ using TINK.Model.Device; [assembly: Xamarin.Forms.Dependency(typeof(TINK.iOS.Device.WebView))] namespace TINK.iOS.Device { - public class WebView : IWebView - { - /// Clears the cookie cache for all web views. - public void ClearCookies() - { - NSHttpCookieStorage CookieStorage = NSHttpCookieStorage.SharedStorage; - foreach (var cookie in CookieStorage.Cookies) - CookieStorage.DeleteCookie(cookie); - } - } + public class WebView : IWebView + { + /// Clears the cookie cache for all web views. + public void ClearCookies() + { + NSHttpCookieStorage CookieStorage = NSHttpCookieStorage.SharedStorage; + foreach (var cookie in CookieStorage.Cookies) + CookieStorage.DeleteCookie(cookie); + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.iOS/Device/iOSCipher.cs b/LastenradBayern/TINK.iOS/Device/iOSCipher.cs index 4dc6464..fa4a22e 100644 --- a/LastenradBayern/TINK.iOS/Device/iOSCipher.cs +++ b/LastenradBayern/TINK.iOS/Device/iOSCipher.cs @@ -5,24 +5,24 @@ using Xamarin.Forms; [assembly: Dependency(typeof(TINK.iOS.Device.IOSCipher))] namespace TINK.iOS.Device { - public class IOSCipher : ICipher - { - /// Encrypt data. - /// Key to encrypt data. - /// Data to entrycpt. - /// - public byte[] Encrypt(byte[] key, byte[] clear) - { - throw new NotSupportedException(); - } + public class IOSCipher : ICipher + { + /// Encrypt data. + /// Key to encrypt data. + /// Data to entrycpt. + /// + public byte[] Encrypt(byte[] key, byte[] clear) + { + throw new NotSupportedException(); + } - /// Decrypt data. - /// Key to decrypt data with. - /// Encrpyted data to decrypt. - /// Decrypted data. - public byte[] Decrypt(byte[] key, byte[] encrypted) - { - throw new NotSupportedException(); - } - } + /// Decrypt data. + /// Key to decrypt data with. + /// Encrpyted data to decrypt. + /// Decrypted data. + public byte[] Decrypt(byte[] key, byte[] encrypted) + { + throw new NotSupportedException(); + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK.iOS/Info.plist b/LastenradBayern/TINK.iOS/Info.plist index ba26e6a..1df5dc7 100644 --- a/LastenradBayern/TINK.iOS/Info.plist +++ b/LastenradBayern/TINK.iOS/Info.plist @@ -1,4 +1,4 @@ - + @@ -6,8 +6,8 @@ bluetooth-peripheral - UIUserInterfaceStyle - Light + UIUserInterfaceStyle + Light UIDeviceFamily 1 @@ -47,7 +47,7 @@ NSLocationAlwaysAndWhenInUseUsageDescription Location access is needed to show map at current position and pass position to server when returning bikes. MinimumOSVersion - 9.0 + 13.0 NSLocationWhenInUseUsageDescription Location access is needed to show map at current position and pass position to server when returning bikes. CFBundleIdentifier @@ -55,8 +55,8 @@ CFBundleDisplayName LastenradBayern CFBundleVersion - 337 + 338 CFBundleShortVersionString - 3.0.337 + 3.0.338 diff --git a/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj b/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj index 7a335e8..3d6a35d 100644 --- a/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj +++ b/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj @@ -24,7 +24,7 @@ prompt 4 false - i386, x86_64 + x86_64 None true VS: com.TeilRad.LastenradBayern Development @@ -37,8 +37,8 @@ __IOS__;__MOBILE__;__UNIFIED__ prompt 4 - None - i386, x86_64 + SdkOnly + x86_64 false VS: com.TeilRad.LastenradBayern Development Apple Development: Oliver Hauff (8SZ7J9P24J) @@ -52,11 +52,11 @@ prompt 4 false - ARMv7, ARM64 + ARM64 Apple Development: Oliver Hauff (8SZ7J9P24J) true Entitlements.plist - None + SdkOnly -all VS: com.TeilRad.LastenradBayern Development @@ -67,7 +67,7 @@ __IOS__;__MOBILE__;__UNIFIED__ prompt 4 - ARMv7, ARM64 + ARM64 false Apple Development: Oliver Hauff (8SZ7J9P24J) Entitlements.plist @@ -77,6 +77,7 @@ SdkOnly + 15.5 none @@ -202,10 +203,10 @@ 1.7.3 - 3.3.0 + 5.0.0 - + 0.7.124 diff --git a/LastenradBayern/TINK.iOS/Main.cs b/LastenradBayern/TINK.iOS/Main.cs index c766ee2..7a40150 100644 --- a/LastenradBayern/TINK.iOS/Main.cs +++ b/LastenradBayern/TINK.iOS/Main.cs @@ -2,14 +2,14 @@ namespace TINK.iOS { - public class Application - { - // This is the main entry point of the application. - static void Main(string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, "AppDelegate"); - } - } + public class Application + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, "AppDelegate"); + } + } } diff --git a/LastenradBayern/TINK/App.xaml.cs b/LastenradBayern/TINK/App.xaml.cs index 4e05571..b5d306d 100644 --- a/LastenradBayern/TINK/App.xaml.cs +++ b/LastenradBayern/TINK/App.xaml.cs @@ -30,166 +30,166 @@ using Arendi.BleLibrary.Local; [assembly: XamlCompilation(XamlCompilationOptions.Compile)] namespace TINK { - public partial class App : Application - { - /// Title of the attachment file. - private const string ATTACHMENTTITLE = "Diagnostics.txt"; + public partial class App : Application + { + /// Title of the attachment file. + private const string ATTACHMENTTITLE = "Diagnostics.txt"; - /// Model root. - private static TinkApp m_oModelRoot; + /// Model root. + private static TinkApp m_oModelRoot; - /// - /// Gets the model root. - /// - public static TinkApp ModelRoot - { - get - { - if (m_oModelRoot != null) - { - // Root model already exists, nothing to do. - return m_oModelRoot; - } + /// + /// Gets the model root. + /// + public static TinkApp ModelRoot + { + get + { + if (m_oModelRoot != null) + { + // Root model already exists, nothing to do. + return m_oModelRoot; + } - // Get folder where to read settings from - var specialFolders = DependencyService.Get(); - var internalPersonalDir = specialFolders.GetInternalPersonalDir(); + // Get folder where to read settings from + var specialFolders = DependencyService.Get(); + var internalPersonalDir = specialFolders.GetInternalPersonalDir(); - // Delete attachtment from previous session. - DeleteAttachment(internalPersonalDir); + // Delete attachtment from previous session. + DeleteAttachment(internalPersonalDir); - // Setup logger using default settings. - TinkApp.SetupLogging( - new LoggingLevelSwitch(Model.Settings.Settings.DEFAULTLOGGINLEVEL), - internalPersonalDir); + // Setup logger using default settings. + TinkApp.SetupLogging( + new LoggingLevelSwitch(Model.Settings.Settings.DEFAULTLOGGINLEVEL), + internalPersonalDir); - // Subscribe to any unhandled/ unobserved exceptions. - AppDomain.CurrentDomain.UnhandledException += (sender, unobservedTaskExceptionEventArgs) => { Log.Fatal("Unobserved task exception: {Exception}", unobservedTaskExceptionEventArgs.ExceptionObject); }; - TaskScheduler.UnobservedTaskException += (sender, unhandledExceptionEventArgs) => { Log.Fatal("Unhandled exception: {Exception}", unhandledExceptionEventArgs.Exception); }; + // Subscribe to any unhandled/ unobserved exceptions. + AppDomain.CurrentDomain.UnhandledException += (sender, unobservedTaskExceptionEventArgs) => { Log.Fatal("Unobserved task exception: {Exception}", unobservedTaskExceptionEventArgs.ExceptionObject); }; + TaskScheduler.UnobservedTaskException += (sender, unhandledExceptionEventArgs) => { Log.Fatal("Unhandled exception: {Exception}", unhandledExceptionEventArgs.Exception); }; - // Restore last model state from json- file. - Dictionary settingsJSON = new Dictionary(); - try - { - settingsJSON = JsonSettingsDictionary.Deserialize(internalPersonalDir); - } - catch (Exception exception) - { - Log.Error("Reading application settings from file failed.", exception); - } + // Restore last model state from json- file. + Dictionary settingsJSON = new Dictionary(); + try + { + settingsJSON = JsonSettingsDictionary.Deserialize(internalPersonalDir); + } + catch (Exception exception) + { + Log.Error("Reading application settings from file failed.", exception); + } - Model.Settings.Settings settings; - try - { - settings = new Model.Settings.Settings( - null, // Turn off filtering for LastenradBayern- context - null, // Turn off filtering for LastenradBayern- context - JsonSettingsDictionary.GetCopriHostUri(settingsJSON), - JsonSettingsDictionary.GetPollingParameters(settingsJSON), - JsonSettingsDictionary.GetMinimumLoggingLevel(settingsJSON), - JsonSettingsDictionary.GetIsReportLevelVerbose(settingsJSON), - JsonSettingsDictionary.GetExpiresAfter(settingsJSON), - JsonSettingsDictionary.GetActiveLockService(settingsJSON), - JsonSettingsDictionary.GetConnectTimeout(settingsJSON), - JsonSettingsDictionary.GetActiveGeolocationService(settingsJSON), - JsonSettingsDictionary.GetCenterMapToCurrentLocation(settingsJSON), - Xamarin.Forms.GoogleMaps.MapSpan.FromCenterAndRadius(new Xamarin.Forms.GoogleMaps.Position(49.30881083492271, 11.358449625922889), Xamarin.Forms.GoogleMaps.Distance.FromKilometers(2.9)), - JsonSettingsDictionary.GetLogToExternalFolder(settingsJSON), - JsonSettingsDictionary.GetIsSiteCachingOn(settingsJSON), - JsonSettingsDictionary.GetActiveTheme(settingsJSON) ?? typeof(Themes.LastenradBayern).Name); - } - catch (Exception exception) - { - Log.Error("Deserializing application settings from dictionary failed.", exception); - settings = new Model.Settings.Settings(); - } + Model.Settings.Settings settings; + try + { + settings = new Model.Settings.Settings( + null, // Turn off filtering for LastenradBayern- context + null, // Turn off filtering for LastenradBayern- context + JsonSettingsDictionary.GetCopriHostUri(settingsJSON), + JsonSettingsDictionary.GetPollingParameters(settingsJSON), + JsonSettingsDictionary.GetMinimumLoggingLevel(settingsJSON), + JsonSettingsDictionary.GetIsReportLevelVerbose(settingsJSON), + JsonSettingsDictionary.GetExpiresAfter(settingsJSON), + JsonSettingsDictionary.GetActiveLockService(settingsJSON), + JsonSettingsDictionary.GetConnectTimeout(settingsJSON), + JsonSettingsDictionary.GetActiveGeolocationService(settingsJSON), + JsonSettingsDictionary.GetCenterMapToCurrentLocation(settingsJSON), + Xamarin.Forms.GoogleMaps.MapSpan.FromCenterAndRadius(new Xamarin.Forms.GoogleMaps.Position(49.30881083492271, 11.358449625922889), Xamarin.Forms.GoogleMaps.Distance.FromKilometers(2.9)), + JsonSettingsDictionary.GetLogToExternalFolder(settingsJSON), + JsonSettingsDictionary.GetIsSiteCachingOn(settingsJSON), + JsonSettingsDictionary.GetActiveTheme(settingsJSON) ?? typeof(Themes.LastenradBayern).Name); + } + catch (Exception exception) + { + Log.Error("Deserializing application settings from dictionary failed.", exception); + settings = new Model.Settings.Settings(); + } - if (settings.MinimumLogEventLevel != Model.Settings.Settings.DEFAULTLOGGINLEVEL - || settings.LogToExternalFolder) - { - // Eigher - // - logging is not set to default value or - // - logging is performed to external folder. - // Need to reconfigure. - Log.CloseAndFlush(); // Close before modifying logger configuration. Otherwise a sharing vialation occurs. + if (settings.MinimumLogEventLevel != Model.Settings.Settings.DEFAULTLOGGINLEVEL + || settings.LogToExternalFolder) + { + // Eigher + // - logging is not set to default value or + // - logging is performed to external folder. + // Need to reconfigure. + Log.CloseAndFlush(); // Close before modifying logger configuration. Otherwise a sharing vialation occurs. - TinkApp.SetupLogging( - new LoggingLevelSwitch(settings.MinimumLogEventLevel), - !settings.LogToExternalFolder - ? internalPersonalDir - : specialFolders.GetExternalFilesDir()); - } + TinkApp.SetupLogging( + new LoggingLevelSwitch(settings.MinimumLogEventLevel), + !settings.LogToExternalFolder + ? internalPersonalDir + : specialFolders.GetExternalFilesDir()); + } - // Get auth cookie - Log.Debug("Get auth cookie."); - IStore store = null; + // Get auth cookie + Log.Debug("Get auth cookie."); + IStore store = null; - var lastVersion = JsonSettingsDictionary.GetAppVersion(settingsJSON); - if (new Version(3, 0, 290) <= lastVersion) - { - // App versions newer than 3.0.173 stored geolocation service in configuration. - // Version 3.0.290: Geolocation service "GeolocationService" is no more supported. - // For this reasons a swich of geolocation service is forced when loading configurations from ealier versions. - LocationServicesContainer.SetActive(settings.ActiveGeolocationService); - } + var lastVersion = JsonSettingsDictionary.GetAppVersion(settingsJSON); + if (new Version(3, 0, 290) <= lastVersion) + { + // App versions newer than 3.0.173 stored geolocation service in configuration. + // Version 3.0.290: Geolocation service "GeolocationService" is no more supported. + // For this reasons a swich of geolocation service is forced when loading configurations from ealier versions. + LocationServicesContainer.SetActive(settings.ActiveGeolocationService); + } - store = new Store(); + store = new Store(); - Barrel.ApplicationId = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; + Barrel.ApplicationId = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name; - var context = SynchronizationContext.Current; + var context = SynchronizationContext.Current; - var appInfoService = DependencyService.Get(); + var appInfoService = DependencyService.Get(); - const string MERCHANTID = "0000000000"; + const string MERCHANTID = "0000000000"; - // Create new app instnace. - Log.Debug("Constructing main model..."); - m_oModelRoot = new TinkApp( - settings, - store, // Manages user account - isConnectedFunc: () => CrossConnectivity.Current.IsConnected, - connectorFactory: (isConnected, activeUri, sessionCookie, mail, expiresAfter) => ConnectorFactory.Create( - isConnected, - activeUri, - new Repository.AppContextInfo(MERCHANTID, AppFlavor.LastenradBayern.GetDisplayName().Replace(" ", ""), appInfoService.Version), - CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, - sessionCookie, - mail, - expiresAfter), - merchantId: MERCHANTID, - bluetoothService: BluetoothService, /* locksService */ - locationPermissionsService: PermissionsService, - locationServicesContainer: LocationServicesContainer, - locksService: null, - device: DependencyService.Get(), - specialFolder: specialFolders, - cipher: new Cipher(), - new TINK.Services.ThemeNS.Theme(Application.Current.Resources.MergedDictionaries), - arendiCentral: + // Create new app instnace. + Log.Debug("Constructing main model..."); + m_oModelRoot = new TinkApp( + settings, + store, // Manages user account + isConnectedFunc: () => CrossConnectivity.Current.IsConnected, + connectorFactory: (isConnected, activeUri, sessionCookie, mail, expiresAfter) => ConnectorFactory.Create( + isConnected, + activeUri, + new Repository.AppContextInfo(MERCHANTID, AppFlavor.LastenradBayern.GetDisplayName().Replace(" ", ""), appInfoService.Version), + CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, + sessionCookie, + mail, + expiresAfter), + merchantId: MERCHANTID, + bluetoothService: BluetoothService, /* locksService */ + locationPermissionsService: PermissionsService, + locationServicesContainer: LocationServicesContainer, + locksService: null, + device: DependencyService.Get(), + specialFolder: specialFolders, + cipher: new Cipher(), + new TINK.Services.ThemeNS.Theme(Application.Current.Resources.MergedDictionaries), + arendiCentral: #if ARENDI DependencyService.Get(), #else - null, + null, #endif - postAction: (d, obj) => context.Post(d, obj), - currentVersion: appInfoService.Version, - lastVersion: lastVersion, - whatsNewShownInVersion: JsonSettingsDictionary.GetWhatsNew(settingsJSON) ?? settingsJSON.GetAppVersion(), - appFlavor: AppFlavor.LastenradBayern); + postAction: (d, obj) => context.Post(d, obj), + currentVersion: appInfoService.Version, + lastVersion: lastVersion, + whatsNewShownInVersion: JsonSettingsDictionary.GetWhatsNew(settingsJSON) ?? settingsJSON.GetAppVersion(), + flavor: AppFlavor.LastenradBayern); - Log.Debug("Main model successfully constructed."); - return m_oModelRoot; - } - } + Log.Debug("Main model successfully constructed."); + return m_oModelRoot; + } + } - /// - /// Entry point of application. - /// - public App() - { - InitializeComponent(); + /// + /// Entry point of application. + /// + public App() + { + InitializeComponent(); #if USEFLYOUT // Use flyout page. @@ -197,147 +197,147 @@ namespace TINK ? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.Root.RootPage()) // Show whats new info. : (Page)new View.Root.RootPage(); // Just start sharee- app #else - // Use shell. - MainPage = ModelRoot.WhatsNew.IsShowRequired - ? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.RootShell.AppShell()) // Show whats new info. - : (Page)new View.RootShell.AppShell(); // Just start sharee- app + // Use shell. + MainPage = ModelRoot.WhatsNew.IsShowRequired + ? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.RootShell.AppShell()) // Show whats new info. + : (Page)new View.RootShell.AppShell(); // Just start sharee- app #endif - } + } - /// Concatenates all log files to a single one. - /// Full file name of attachment. - public static string CreateAttachment() - { - var sessionLogFiles = Log.Logger.GetLogFiles().ToArray(); + /// Concatenates all log files to a single one. + /// Full file name of attachment. + public static string CreateAttachment() + { + var sessionLogFiles = Log.Logger.GetLogFiles().ToArray(); - if (sessionLogFiles.Length < 1) - { - // Either - // - there is no logging file - // - an error occurred getting list of log files. - return string.Empty; - } + if (sessionLogFiles.Length < 1) + { + // Either + // - there is no logging file + // - an error occurred getting list of log files. + return string.Empty; + } - var fullLogFileName = System.IO.Path.Combine(ModelRoot.LogFileParentFolder, ATTACHMENTTITLE); + var fullLogFileName = System.IO.Path.Combine(ModelRoot.LogFileParentFolder, ATTACHMENTTITLE); - // Stop logging to avoid file access exception. - Log.CloseAndFlush(); + // Stop logging to avoid file access exception. + Log.CloseAndFlush(); - System.IO.File.WriteAllLines( - fullLogFileName, - sessionLogFiles.SelectMany(name => - (new List { $"{{\"SessionFileName\":\"{name}\"}}" }) - .Concat(System.IO.File.ReadLines(name).ToArray()))); + System.IO.File.WriteAllLines( + fullLogFileName, + sessionLogFiles.SelectMany(name => + (new List { $"{{\"SessionFileName\":\"{name}\"}}" }) + .Concat(System.IO.File.ReadLines(name).ToArray()))); - // Resume logging - TinkApp.SetupLogging( - ModelRoot.Level, - ModelRoot.LogFileParentFolder); + // Resume logging + TinkApp.SetupLogging( + ModelRoot.Level, + ModelRoot.LogFileParentFolder); - return fullLogFileName; - } + return fullLogFileName; + } - /// Deletes an attachment if there is one. - /// Folder to delete, is null folder is queried from model. - private static void DeleteAttachment(string folder = null) - { - var attachment = System.IO.Path.Combine(folder ?? ModelRoot.LogFileParentFolder, ATTACHMENTTITLE); - if (!System.IO.File.Exists(attachment)) - { - // No attachment found. - return; - } + /// Deletes an attachment if there is one. + /// Folder to delete, is null folder is queried from model. + private static void DeleteAttachment(string folder = null) + { + var attachment = System.IO.Path.Combine(folder ?? ModelRoot.LogFileParentFolder, ATTACHMENTTITLE); + if (!System.IO.File.Exists(attachment)) + { + // No attachment found. + return; + } - System.IO.File.Delete(attachment); - } + System.IO.File.Delete(attachment); + } - protected override void OnSleep() - { - // Handle when your app sleeps - Log.CloseAndFlush(); - } + protected override void OnSleep() + { + // Handle when your app sleeps + Log.CloseAndFlush(); + } - protected override void OnResume() - { - DeleteAttachment(); + protected override void OnResume() + { + DeleteAttachment(); - TinkApp.SetupLogging( - ModelRoot.Level, - ModelRoot.LogFileParentFolder); - } + TinkApp.SetupLogging( + ModelRoot.Level, + ModelRoot.LogFileParentFolder); + } - /// The URI for the request. - /// Overriden to respond when the user initiates an app link request. - protected override void OnAppLinkRequestReceived(Uri uri) - { - base.OnAppLinkRequestReceived(uri); - if (uri.Host.ToLower() == "sharee.bike") - { - // Input e.g. sharee.bike/sharee?lat=49.921&long=32.51 - Array segments = Array.ConvertAll(uri.Segments, segment => segment.Replace("/", "")).Skip(1).ToArray(); - if (uri.Query.Length > 0) - { - Dictionary queryDict = uri.Query - .Substring(1) - .Split("&") - .Select(query => query.Split('=')) - .ToDictionary(query => query.FirstOrDefault(), query => query.Skip(1).FirstOrDefault()); - } - // segments == ["sharee"] - // queryDict == [{["lat", "49.921"]}], {["long", "32.51"]}] - // => Navigate and pass params depending on linkinput - // If no custom navigation is configured, the app just opens as if the user opened it - } - } + /// The URI for the request. + /// Overriden to respond when the user initiates an app link request. + protected override void OnAppLinkRequestReceived(Uri uri) + { + base.OnAppLinkRequestReceived(uri); + if (uri.Host.ToLower() == "sharee.bike") + { + // Input e.g. sharee.bike/sharee?lat=49.921&long=32.51 + Array segments = Array.ConvertAll(uri.Segments, segment => segment.Replace("/", "")).Skip(1).ToArray(); + if (uri.Query.Length > 0) + { + Dictionary queryDict = uri.Query + .Substring(1) + .Split("&") + .Select(query => query.Split('=')) + .ToDictionary(query => query.FirstOrDefault(), query => query.Skip(1).FirstOrDefault()); + } + // segments == ["sharee"] + // queryDict == [{["lat", "49.921"]}], {["long", "32.51"]}] + // => Navigate and pass params depending on linkinput + // If no custom navigation is configured, the app just opens as if the user opened it + } + } - /// Gets the current logging level. - /// - private static LogEventLevel GetCurrentLogEventLevel() - { - foreach (LogEventLevel level in Enum.GetValues(typeof(LogEventLevel))) - { - if (Log.IsEnabled(level)) - return level; - } + /// Gets the current logging level. + /// + private static LogEventLevel GetCurrentLogEventLevel() + { + foreach (LogEventLevel level in Enum.GetValues(typeof(LogEventLevel))) + { + if (Log.IsEnabled(level)) + return level; + } - return LogEventLevel.Error; - } + return LogEventLevel.Error; + } - /// - /// Holds the permission service instance. - /// - private static ILocationPermission _PermissionsService = null; + /// + /// Holds the permission service instance. + /// + private static ILocationPermission _PermissionsService = null; - /// - /// Service to manage permissions (location) of the app. - /// - public static ILocationPermission PermissionsService - { - get - { - if (_PermissionsService != null) - return _PermissionsService; + /// + /// Service to manage permissions (location) of the app. + /// + public static ILocationPermission PermissionsService + { + get + { + if (_PermissionsService != null) + return _PermissionsService; - _PermissionsService = new TINK.Services.Permissions.Essentials.Permissions(); - return _PermissionsService; - } - } + _PermissionsService = new TINK.Services.Permissions.Essentials.Permissions(); + return _PermissionsService; + } + } - /// Service to manage bluetooth stack. - public static Plugin.BLE.Abstractions.Contracts.IBluetoothLE BluetoothService => Plugin.BLE.CrossBluetoothLE.Current; + /// Service to manage bluetooth stack. + public static Plugin.BLE.Abstractions.Contracts.IBluetoothLE BluetoothService => Plugin.BLE.CrossBluetoothLE.Current; - /// - /// Service container to manage geolocation services. - /// - public static IServicesContainer LocationServicesContainer { get; } - = new ServicesContainerMutableT( - new HashSet { - new LastKnownGeolocationService(DependencyService.Get()), - new SimulatedGeolocationService(DependencyService.Get()), - new GeolocationAccuracyMediumService(DependencyService.Get()), - new GeolocationAccuracyHighService(DependencyService.Get()), - new GeolocationAccuracyBestService(DependencyService.Get())}, - Model.Settings.Settings.DefaultLocationService.FullName); - } + /// + /// Service container to manage geolocation services. + /// + public static IServicesContainer LocationServicesContainer { get; } + = new ServicesContainerMutableT( + new HashSet { + new LastKnownGeolocationService(DependencyService.Get()), + new SimulatedGeolocationService(DependencyService.Get()), + new GeolocationAccuracyMediumService(DependencyService.Get()), + new GeolocationAccuracyHighService(DependencyService.Get()), + new GeolocationAccuracyBestService(DependencyService.Get())}, + Model.Settings.Settings.DefaultLocationService.FullName); + } } diff --git a/LastenradBayern/TINK/BackdoorMethodHelpers.cs b/LastenradBayern/TINK/BackdoorMethodHelpers.cs index 068f5ac..f8dd015 100644 --- a/LastenradBayern/TINK/BackdoorMethodHelpers.cs +++ b/LastenradBayern/TINK/BackdoorMethodHelpers.cs @@ -5,34 +5,34 @@ using Xamarin.Forms; namespace TINK { - public static class BackdoorMethodHelpers - { - public static void DoTapPage(string stationId) - { - Serilog.Log.Information($"Request via backdoor to tap station {stationId}."); - var currentPage = GetCurrentPage(); - var mapPageViewModel = (currentPage as MapPage)?.BindingContext as MapPageViewModel; - if (mapPageViewModel == null) - { - Serilog.Log.Error($"Request via backdoor to tap station {stationId} aborted because current page is not of expected type {typeof(MapPage).Name}. Type detected is {currentPage.GetType().Name}."); - return; - } + public static class BackdoorMethodHelpers + { + public static void DoTapPage(string stationId) + { + Serilog.Log.Information($"Request via backdoor to tap station {stationId}."); + var currentPage = GetCurrentPage(); + var mapPageViewModel = (currentPage as MapPage)?.BindingContext as MapPageViewModel; + if (mapPageViewModel == null) + { + Serilog.Log.Error($"Request via backdoor to tap station {stationId} aborted because current page is not of expected type {typeof(MapPage).Name}. Type detected is {currentPage.GetType().Name}."); + return; + } - Serilog.Log.Information($"Invoking member to tap."); - mapPageViewModel?.OnStationClicked(stationId); - } + Serilog.Log.Information($"Invoking member to tap."); + mapPageViewModel?.OnStationClicked(stationId); + } - /// Gets the current page assumed that app is master detail page. - /// - static Page GetCurrentPage() - { + /// Gets the current page assumed that app is master detail page. + /// + static Page GetCurrentPage() + { #if USEFLYOUT return (Application.Current.MainPage as FlyoutPage)?.Detail.Navigation.NavigationStack.LastOrDefault(); #else - return Shell.Current.CurrentPage; + return Shell.Current.CurrentPage; #endif - } + } - } + } } diff --git a/LastenradBayern/TINK/Model/Device/SpecialFolder.cs b/LastenradBayern/TINK/Model/Device/SpecialFolder.cs index 811664e..3a90f3f 100644 --- a/LastenradBayern/TINK/Model/Device/SpecialFolder.cs +++ b/LastenradBayern/TINK/Model/Device/SpecialFolder.cs @@ -3,22 +3,22 @@ using Xamarin.Forms; namespace TINK.Model.Device { - public class SpecialFolder : ISpecialFolder - { - /// - /// Get the folder name of external folder to write to. - /// - /// - public string GetExternalFilesDir() - { - return DependencyService.Get().GetExternalFilesDir(); - } + public class SpecialFolder : ISpecialFolder + { + /// + /// Get the folder name of external folder to write to. + /// + /// + public string GetExternalFilesDir() + { + return DependencyService.Get().GetExternalFilesDir(); + } - /// Gets the folder name of the personal data folder dir on internal storage. - /// Directory name. - public string GetInternalPersonalDir() - { - return DependencyService.Get().GetInternalPersonalDir(); - } - } + /// Gets the folder name of the personal data folder dir on internal storage. + /// Directory name. + public string GetInternalPersonalDir() + { + return DependencyService.Get().GetInternalPersonalDir(); + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/Account/AccountPage.xaml.cs b/LastenradBayern/TINK/View/Account/AccountPage.xaml.cs index 4216b3e..d470451 100644 --- a/LastenradBayern/TINK/View/Account/AccountPage.xaml.cs +++ b/LastenradBayern/TINK/View/Account/AccountPage.xaml.cs @@ -12,80 +12,80 @@ using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS; namespace TINK.View.Account { - [XamlCompilation(XamlCompilationOptions.Compile)] + [XamlCompilation(XamlCompilationOptions.Compile)] #if USEFLYOUT public partial class AccountPage : ContentPage, IViewService, IDetailPage #else - public partial class AccountPage : ContentPage, IViewService + public partial class AccountPage : ContentPage, IViewService #endif - { - /// Refernce to view model. - AccountPageViewModel m_oViewModel = null; + { + /// Refernce to view model. + AccountPageViewModel m_oViewModel = null; - /// Constructs a account page. - public AccountPage() - { - InitializeComponent(); + /// Constructs a account page. + public AccountPage() + { + InitializeComponent(); - var l_oModel = App.ModelRoot; + var l_oModel = App.ModelRoot; - m_oViewModel = new AccountPageViewModel( - l_oModel, - (url) => DependencyService.Get().OpenUrl(url), - this); + m_oViewModel = new AccountPageViewModel( + l_oModel, + (url) => DependencyService.Get().OpenUrl(url), + this); - BindingContext = m_oViewModel; - } + BindingContext = m_oViewModel; + } - /// Displays alert message. - /// Title of message. - /// Message to display. - /// Type of buttons. - public new async Task DisplayAlert(string title, string message, string cancel) - => await App.Current.MainPage.DisplayAlert(title, message, cancel); + /// Displays alert message. + /// Title of message. + /// Message to display. + /// Type of buttons. + public new async Task DisplayAlert(string title, string message, string cancel) + => await App.Current.MainPage.DisplayAlert(title, message, cancel); - /// Displays alert message. - /// Title of message. - /// Message to display. - /// Detailed error description. - /// Type of buttons. - public async Task DisplayAdvancedAlert( - string title, - string message, - string details, - string cancel) - => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel); + /// Displays alert message. + /// Title of message. + /// Message to display. + /// Detailed error description. + /// Type of buttons. + public async Task DisplayAdvancedAlert( + string title, + string message, + string details, + string cancel) + => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel); - /// Displays alert message. - /// Title of message. - /// Message to display. - /// Text of accept button. - /// Text of button. - /// True if user pressed accept. - public new async Task DisplayAlert(string title, string message, string accept, string cancel) - => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel); + /// Displays alert message. + /// Title of message. + /// Message to display. + /// Text of accept button. + /// Text of button. + /// True if user pressed accept. + public new async Task DisplayAlert(string title, string message, string accept, string cancel) + => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel); - /// Displays detailed alert message. - /// Title of message. - /// Message to display. - /// Detailed error description. - /// Text of accept button. - /// Text of cancel button. - /// True if user pressed accept. - public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel) - => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel); + /// Displays detailed alert message. + /// Title of message. + /// Message to display. + /// Detailed error description. + /// Text of accept button. + /// Text of cancel button. + /// True if user pressed accept. + public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel) + => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel); - /// - /// Displays an action sheet. - /// - /// Title of message. - /// Message to display. - /// Text of button. - /// - /// Buttons holding options to select. - /// Text selected - public new async Task DisplayActionSheet(String title, String cancel, String destruction, params String[] p_oButtons) - => await base.DisplayActionSheet(title, cancel, destruction, p_oButtons); + /// + /// Displays an action sheet. + /// + /// Title of message. + /// Message to display. + /// Text of button. + /// + /// Buttons holding options to select. + /// Text selected + public new async Task DisplayActionSheet(String title, String cancel, String destruction, params String[] p_oButtons) + => await base.DisplayActionSheet(title, cancel, destruction, p_oButtons); #if USEFLYOUT /// @@ -95,19 +95,19 @@ namespace TINK.View.Account public void ShowPage(ViewTypes p_oType, string title = null) => m_oNavigation.ShowPage(p_oType.GetViewType(), title); #else - /// Shows a page. - /// Route of the page to show. - public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route); + /// Shows a page. + /// Route of the page to show. + public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route); #endif - /// Pushes a page onto the modal stack. - /// Page to display. - public Task PushModalAsync(ViewTypes typeOfPage) - => Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType())); + /// Pushes a page onto the modal stack. + /// Page to display. + public Task PushModalAsync(ViewTypes typeOfPage) + => Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType())); - /// Pops a page from the modal stack. - public Task PopModalAsync() - => throw new NotSupportedException(); + /// Pops a page from the modal stack. + public Task PopModalAsync() + => throw new NotSupportedException(); #if USEFLYOUT @@ -123,34 +123,34 @@ namespace TINK.View.Account } #endif - /// - /// Invoked when page is shown. - /// Starts update process. - /// - protected async override void OnAppearing() - => await m_oViewModel.OnAppearing(); - /// - /// Invoked when pages is closed/ hidden. - /// Stops update process. - /// - protected async override void OnDisappearing() - { - if (m_oViewModel == null) - { - // View model might be null. - return; - } - await m_oViewModel.OnDisappearing(); - } + /// + /// Invoked when page is shown. + /// Starts update process. + /// + protected async override void OnAppearing() + => await m_oViewModel.OnAppearing(); + /// + /// Invoked when pages is closed/ hidden. + /// Stops update process. + /// + protected async override void OnDisappearing() + { + if (m_oViewModel == null) + { + // View model might be null. + return; + } + await m_oViewModel.OnDisappearing(); + } - /// Pushes a page onto the stack. - /// Page to display. - public async Task PushAsync(ViewTypes p_oTypeOfPage) - => await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType())); + /// Pushes a page onto the stack. + /// Page to display. + public async Task PushAsync(ViewTypes p_oTypeOfPage) + => await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType())); #if USCSHARP9 public Task DisplayUserFeedbackPopup() => throw new NotSupportedException(); #else - public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException(); + public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException(); #endif - } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/Bike/BCBike.xaml.cs b/LastenradBayern/TINK/View/Bike/BCBike.xaml.cs index 99225d0..b3d8cf4 100644 --- a/LastenradBayern/TINK/View/Bike/BCBike.xaml.cs +++ b/LastenradBayern/TINK/View/Bike/BCBike.xaml.cs @@ -9,12 +9,12 @@ using Xamarin.Forms.Xaml; namespace TINK.View.Bike { - [XamlCompilation(XamlCompilationOptions.Compile)] - public partial class BCBike : ViewCell - { - public BCBike() - { - InitializeComponent(); - } - } + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class BCBike : ViewCell + { + public BCBike() + { + InitializeComponent(); + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/Bike/BikeViewCellTemplateSelector.cs b/LastenradBayern/TINK/View/Bike/BikeViewCellTemplateSelector.cs index f77e9f5..215d21d 100644 --- a/LastenradBayern/TINK/View/Bike/BikeViewCellTemplateSelector.cs +++ b/LastenradBayern/TINK/View/Bike/BikeViewCellTemplateSelector.cs @@ -2,24 +2,24 @@ namespace TINK.View.Bike { - /// - /// Selects different templates for different bike types (BordComputer bikes, iLockIt bikes). - /// - public class BikeViewCellTemplateSelector : DataTemplateSelector - { - DataTemplate bCBike; - DataTemplate iLockIBike; + /// + /// Selects different templates for different bike types (BordComputer bikes, iLockIt bikes). + /// + public class BikeViewCellTemplateSelector : DataTemplateSelector + { + DataTemplate bCBike; + DataTemplate iLockIBike; - public BikeViewCellTemplateSelector() - { - bCBike = new DataTemplate(typeof(BCBike)); - iLockIBike = new DataTemplate(typeof(ILockItBike)); - } + public BikeViewCellTemplateSelector() + { + bCBike = new DataTemplate(typeof(BCBike)); + iLockIBike = new DataTemplate(typeof(ILockItBike)); + } - protected override DataTemplate OnSelectTemplate(object item, BindableObject container) - => item is TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel || - item is TINK.ViewModel.Bikes.Bike.CopriLock.BikeViewModel - ? iLockIBike - : bCBike; - } + protected override DataTemplate OnSelectTemplate(object item, BindableObject container) + => item is TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel || + item is TINK.ViewModel.Bikes.Bike.CopriLock.BikeViewModel + ? iLockIBike + : bCBike; + } } diff --git a/LastenradBayern/TINK/View/Bike/ILockItBike.xaml.cs b/LastenradBayern/TINK/View/Bike/ILockItBike.xaml.cs index bdd09dd..ff2a14f 100644 --- a/LastenradBayern/TINK/View/Bike/ILockItBike.xaml.cs +++ b/LastenradBayern/TINK/View/Bike/ILockItBike.xaml.cs @@ -9,36 +9,36 @@ using Xamarin.Forms.Xaml; namespace TINK.View.Bike { - [XamlCompilation(XamlCompilationOptions.Compile)] - public partial class ILockItBike : ViewCell - { - public ILockItBike() - { - InitializeComponent(); - } + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class ILockItBike : ViewCell + { + public ILockItBike() + { + InitializeComponent(); + } - protected override void OnBindingContextChanged() - { - base.OnBindingContextChanged(); + protected override void OnBindingContextChanged() + { + base.OnBindingContextChanged(); - if (Device.RuntimePlatform != Device.iOS) - // Update of size is only required for iOS. - return; + if (Device.RuntimePlatform != Device.iOS) + // Update of size is only required for iOS. + return; - var viewModel = BindingContext as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel; - if (viewModel == null) - return; + var viewModel = BindingContext as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel; + if (viewModel == null) + return; - viewModel.PropertyChanged += (sender, e) => - { - if (e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BC.RequestHandler.Base.IsButtonVisible) - || e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler.Base.IsLockitButtonVisible)) - { - // Force update of view cell on iOS. - // https://hausource.visualstudio.com/TINK/_workitems/edit/132 - ForceUpdateSize(); - } - }; - } - } + viewModel.PropertyChanged += (sender, e) => + { + if (e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BC.RequestHandler.Base.IsButtonVisible) + || e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler.Base.IsLockitButtonVisible)) + { + // Force update of view cell on iOS. + // https://hausource.visualstudio.com/TINK/_workitems/edit/132 + ForceUpdateSize(); + } + }; + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs b/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs index 9312d9f..5cf8817 100644 --- a/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs +++ b/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs @@ -5,38 +5,38 @@ using Xamarin.Forms.Xaml; namespace TINK.View.BikesAtStation { - using System; - using System.Linq; - using System.Threading; - using System.Threading.Tasks; - using TINK.Model.Device; + using System; + using System.Linq; + using System.Threading; + using System.Threading.Tasks; + using TINK.Model.Device; #if USEFLYOUT using TINK.View.MasterDetail; #endif - using TINK.ViewModel; - using TINK.Model; - using TINK.Services.BluetoothLock.Tdo; - using System.Collections.Generic; - using Serilog; - using TINK.Services.BluetoothLock; - using Plugin.BLE; - using TINK.ViewModel.BikesAtStation; - using TINK.ViewModel.Bikes; - using Xamarin.CommunityToolkit.Extensions; - using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS; + using TINK.ViewModel; + using TINK.Model; + using TINK.Services.BluetoothLock.Tdo; + using System.Collections.Generic; + using Serilog; + using TINK.Services.BluetoothLock; + using Plugin.BLE; + using TINK.ViewModel.BikesAtStation; + using TINK.ViewModel.Bikes; + using Xamarin.CommunityToolkit.Extensions; + using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS; - [XamlCompilation(XamlCompilationOptions.Compile)] + [XamlCompilation(XamlCompilationOptions.Compile)] #if USEFLYOUT public partial class BikesAtStationPage : ContentPage, IViewService, IDetailPage #else - public partial class BikesAtStationPage : ContentPage, IViewService + public partial class BikesAtStationPage : ContentPage, IViewService #endif - { + { - private BikesAtStationPageViewModel m_oViewModel; + private BikesAtStationPageViewModel m_oViewModel; - /// Initialization status to ensure initialization logic is not called multiple times. - private bool isInitializationStarted = false; + /// Initialization status to ensure initialization logic is not called multiple times. + private bool isInitializationStarted = false; #if TRYNOTBACKSTYLE public BikesAtStationPage() { @@ -55,140 +55,140 @@ namespace TINK.View.BikesAtStation } #else - public BikesAtStationPage() - { - } + public BikesAtStationPage() + { + } #endif - /// - /// Invoked when page is shown. - /// Starts update process. - /// - protected async override void OnAppearing() - { - // Don't repeat the initialization if it has been completed already. - if (isInitializationStarted) return; - isInitializationStarted = true; + /// + /// Invoked when page is shown. + /// Starts update process. + /// + protected async override void OnAppearing() + { + // Don't repeat the initialization if it has been completed already. + if (isInitializationStarted) return; + isInitializationStarted = true; - if (m_oViewModel != null) - { + if (m_oViewModel != null) + { #if BACKSTYLE // Hide master- detail menu to force user to navigate using back button. m_oNavigation.IsGestureEnabled = false; #endif - // No need to create view model, set binding context an items source if already done. - // If done twice tap events are fired multiple times (when hiding page using home button). - await m_oViewModel.OnAppearing(); - isInitializationStarted = false; - return; - } + // No need to create view model, set binding context an items source if already done. + // If done twice tap events are fired multiple times (when hiding page using home button). + await m_oViewModel.OnAppearing(); + isInitializationStarted = false; + return; + } - try - { - var model = App.ModelRoot; + try + { + var model = App.ModelRoot; - // Backup synchronization context when called from GUI-thread. - var synchronizationContext = SynchronizationContext.Current; + // Backup synchronization context when called from GUI-thread. + var synchronizationContext = SynchronizationContext.Current; - m_oViewModel = new BikesAtStationPageViewModel( - model.ActiveUser, - App.PermissionsService, - App.BluetoothService, - Device.RuntimePlatform, - model.SelectedStation, - () => model.GetIsConnected(), - (isConnected) => model.GetConnector(isConnected), - App.LocationServicesContainer.Active, - model.LocksServices.Active, - model.Polling, - (url) => DependencyService.Get().OpenUrl(url), - (d, obj) => synchronizationContext.Post(d, obj), - model.SmartDevice, - this) - { - IsReportLevelVerbose = model.IsReportLevelVerbose - }; - } - catch (Exception exception) - { - Log.ForContext().Error("Displaying bikes at station page failed. {Exception}", exception); - await DisplayAlert("Fehler", $"Seite Räder an Station kann nicht angezeigt werden. ${exception.Message}", "OK"); - isInitializationStarted = false; - return; - } + m_oViewModel = new BikesAtStationPageViewModel( + model.ActiveUser, + App.PermissionsService, + App.BluetoothService, + Device.RuntimePlatform, + model.SelectedStation, + () => model.GetIsConnected(), + (isConnected) => model.GetConnector(isConnected), + App.LocationServicesContainer.Active, + model.LocksServices.Active, + model.Polling, + (url) => DependencyService.Get().OpenUrl(url), + (d, obj) => synchronizationContext.Post(d, obj), + model.SmartDevice, + this) + { + IsReportLevelVerbose = model.IsReportLevelVerbose + }; + } + catch (Exception exception) + { + Log.ForContext().Error("Displaying bikes at station page failed. {Exception}", exception); + await DisplayAlert("Fehler", $"Seite Räder an Station kann nicht angezeigt werden. ${exception.Message}", "OK"); + isInitializationStarted = false; + return; + } - InitializeComponent(); + InitializeComponent(); #if BACKSTYLE // Hide master- detail menu to force user to navigate using back button. m_oNavigation.IsGestureEnabled = false; #endif - BindingContext = m_oViewModel; - BikesAtStationListView.ItemsSource = m_oViewModel; + BindingContext = m_oViewModel; + BikesAtStationListView.ItemsSource = m_oViewModel; - await m_oViewModel.OnAppearing(); - isInitializationStarted = false; - } + await m_oViewModel.OnAppearing(); + isInitializationStarted = false; + } - /// - /// Invoked when pages is closed/ hidden. - /// Stops update process. - /// - protected async override void OnDisappearing() - { - if (m_oViewModel != null) - { - // View model might be null. - await m_oViewModel?.OnDisappearing(); - } + /// + /// Invoked when pages is closed/ hidden. + /// Stops update process. + /// + protected async override void OnDisappearing() + { + if (m_oViewModel != null) + { + // View model might be null. + await m_oViewModel?.OnDisappearing(); + } #if BACKSTYLE if (m_oNavigation!= null) m_oNavigation.IsGestureEnabled = true; // Enables master- detail menu navigation again when page is unloaded. #endif - } + } - /// Displays alert message. - /// Title of message. - /// Message to display. - /// Type of buttons. - public new async Task DisplayAlert(string title, string message, string cancel) - => await App.Current.MainPage.DisplayAlert(title, message, cancel); + /// Displays alert message. + /// Title of message. + /// Message to display. + /// Type of buttons. + public new async Task DisplayAlert(string title, string message, string cancel) + => await App.Current.MainPage.DisplayAlert(title, message, cancel); - /// Displays alert message. - /// Title of message. - /// Message to display. - /// Detailed error description. - /// Type of buttons. - public async Task DisplayAdvancedAlert( - string title, - string message, - string details, - string cancel) - => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel); + /// Displays alert message. + /// Title of message. + /// Message to display. + /// Detailed error description. + /// Type of buttons. + public async Task DisplayAdvancedAlert( + string title, + string message, + string details, + string cancel) + => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel); - /// - /// Displays alert message. - /// - /// Title of message. - /// Message to display. - /// Text of accept button. - /// Text of button. - /// True if user pressed accept. - public new async Task DisplayAlert(string title, string message, string accept, string cancel) - => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel); + /// + /// Displays alert message. + /// + /// Title of message. + /// Message to display. + /// Text of accept button. + /// Text of button. + /// True if user pressed accept. + public new async Task DisplayAlert(string title, string message, string accept, string cancel) + => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel); - /// Displays detailed alert message. - /// Title of message. - /// Message to display. - /// Detailed error description. - /// Text of accept button. - /// Text of cancel button. - /// True if user pressed accept. - public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel) - => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel); + /// Displays detailed alert message. + /// Title of message. + /// Message to display. + /// Detailed error description. + /// Text of accept button. + /// Text of cancel button. + /// True if user pressed accept. + public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel) + => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel); #if USEFLYOUT @@ -198,27 +198,27 @@ namespace TINK.View.BikesAtStation public void ShowPage(ViewTypes p_oType, string title = null) => m_oNavigation.ShowPage(p_oType.GetViewType(), title); #else - /// Shows a page. - /// Route of the page to show. - public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route); + /// Shows a page. + /// Route of the page to show. + public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route); #endif - /// Pushes a page onto the modal stack. - /// Page to display. - public async Task PushModalAsync(ViewTypes typeOfPage) - => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType())); + /// Pushes a page onto the modal stack. + /// Page to display. + public async Task PushModalAsync(ViewTypes typeOfPage) + => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType())); - /// Pops a page from the modal stack. - public Task PopModalAsync() - { - throw new NotSupportedException(); - } + /// Pops a page from the modal stack. + public Task PopModalAsync() + { + throw new NotSupportedException(); + } - public Task PushAsync(ViewTypes p_oTypeOfPage) - { - throw new NotImplementedException(); - } + public Task PushAsync(ViewTypes p_oTypeOfPage) + { + throw new NotImplementedException(); + } #if USEFLYOUT /// @@ -239,10 +239,10 @@ namespace TINK.View.BikesAtStation #if USCSHARP9 public async Task DisplayUserFeedbackPopup() => await Navigation.ShowPopupAsync(new FeedbackPopup()); #else - /// Displays user feedback popup. - /// Co2 saving information. - /// User feedback. - public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving)); + /// Displays user feedback popup. + /// Co2 saving information. + /// User feedback. + public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving)); #endif - } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/BoolInverterConverter.cs b/LastenradBayern/TINK/View/BoolInverterConverter.cs index bbd7296..9fc95cd 100644 --- a/LastenradBayern/TINK/View/BoolInverterConverter.cs +++ b/LastenradBayern/TINK/View/BoolInverterConverter.cs @@ -4,16 +4,16 @@ using Xamarin.Forms; namespace TINK.View { - /// Inverts a bool. - public class BoolInverterConverter : IValueConverter - { - /// Inverts a bool. - /// Bool to invert. - /// Inverted bool. - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - => value is bool flag && !flag; + /// Inverts a bool. + public class BoolInverterConverter : IValueConverter + { + /// Inverts a bool. + /// Bool to invert. + /// Inverted bool. + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + => value is bool flag && !flag; - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - => value is bool flag && !flag; - } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + => value is bool flag && !flag; + } } diff --git a/LastenradBayern/TINK/View/Contact/ContactPage.xaml b/LastenradBayern/TINK/View/Contact/ContactPage.xaml index 04f6a90..eca477a 100644 --- a/LastenradBayern/TINK/View/Contact/ContactPage.xaml +++ b/LastenradBayern/TINK/View/Contact/ContactPage.xaml @@ -50,7 +50,7 @@ IsVisible="{Binding MailAddressText, Converter={StaticResource StringNotNullOrEmpty_Converter}}" Text="{Binding MailAddressText}" IsEnabled="{Binding IsSendMailAvailable}" - Command="{Binding OnMailRequest}"/> + Command="{Binding OnMailToOperatorRequest}"/> - private ContactPageViewModel ViewModel { get; set; } + { + /// View model to notify view model if page appears. + private ContactPageViewModel ViewModel { get; set; } - public ContactPage() - { - InitializeComponent(); + public ContactPage() + { + InitializeComponent(); - ViewModel = new ContactPageViewModel(App.ModelRoot.Uris.ActiveUri, - AppInfo.Name, - () => App.CreateAttachment(), - () => DependencyService.Get().OpenUrl(DependencyService.Get().StoreUrl), - this); + ViewModel = new ContactPageViewModel( + App.ModelRoot.Flavor.GetDisplayName(), + () => App.CreateAttachment(), + () => DependencyService.Get().OpenUrl(DependencyService.Get().StoreUrl), + this); - ContactPageView.BindingContext = ViewModel; - } + ContactPageView.BindingContext = ViewModel; + } - /// Invoked when page is shown. - protected async override void OnAppearing() - { - try - { - Log.ForContext().Verbose("OnAppearing..."); + /// Invoked when page is shown. + protected async override void OnAppearing() + { + try + { + Log.ForContext().Verbose("OnAppearing..."); - await ViewModel.OnAppearing(App.ModelRoot.SelectedStation); - } - catch (Exception exception) - { - Log.ForContext().Error("Invoking OnAppearing on view model failed. {Exception}", exception); - return; - } - } + await ViewModel.OnAppearing(App.ModelRoot.SelectedStation); + } + catch (Exception exception) + { + Log.ForContext().Error("Invoking OnAppearing on view model failed. {Exception}", exception); + return; + } + } - /// Displays alert message. - /// Title of message. - /// Message to display. - /// Detailed error description. - /// Type of buttons. - public async Task DisplayAdvancedAlert( - string title, - string message, - string details, - string cancel) - => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel); + /// Displays alert message. + /// Title of message. + /// Message to display. + /// Detailed error description. + /// Type of buttons. + public async Task DisplayAdvancedAlert( + string title, + string message, + string details, + string cancel) + => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel); - /// Displays detailed alert message. - /// Title of message. - /// Message to display. - /// Detailed error description. - /// Text of accept button. - /// Text of cancel button. - /// True if user pressed accept. - public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel) - => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel); + /// Displays detailed alert message. + /// Title of message. + /// Message to display. + /// Detailed error description. + /// Text of accept button. + /// Text of cancel button. + /// True if user pressed accept. + public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel) + => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel); #if USEFLYOUT public void ShowPage(ViewTypes p_oType, string title = null) => NavigationMasterDetail.ShowPage(p_oType.GetViewType(), title); #else - /// Shows a page. - /// Route of the page to show. - public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route); + /// Shows a page. + /// Route of the page to show. + public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route); #endif - /// Pushes a page onto the modal stack. - /// Page to display. - public Task PushModalAsync(ViewTypes p_oTypeOfPage) - { - throw new NotSupportedException(); - } + /// Pushes a page onto the modal stack. + /// Page to display. + public Task PushModalAsync(ViewTypes p_oTypeOfPage) + { + throw new NotSupportedException(); + } - /// Pops a page from the modal stack. - public Task PopModalAsync() - { - throw new NotSupportedException(); - } + /// Pops a page from the modal stack. + public Task PopModalAsync() + { + throw new NotSupportedException(); + } - /// Pushes a page onto the stack. - /// Page to display. - public async Task PushAsync(ViewTypes typeOfPage) - { + /// Pushes a page onto the stack. + /// Page to display. + public async Task PushAsync(ViewTypes typeOfPage) + { #if USEFLYOUT var page = Activator.CreateInstance(typeOfPage.GetViewType()) as IDetailPage; #else - var page = Activator.CreateInstance(typeOfPage.GetViewType()); + var page = Activator.CreateInstance(typeOfPage.GetViewType()); #endif - if (page == null) - { - return; - } + if (page == null) + { + return; + } #if USEFLYOUT page.NavigationMasterDetail = NavigationMasterDetail; #endif - await Navigation.PushAsync((Page)page); - } + await Navigation.PushAsync((Page)page); + } #if USCSHARP9 public Task DisplayUserFeedbackPopup() => throw new NotSupportedException(); #else - public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException(); + public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException(); #endif #if USEFLYOUT @@ -129,5 +130,5 @@ namespace TINK.View.Contact /// public INavigationMasterDetail NavigationMasterDetail { set; private get; } #endif - } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml.cs b/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml.cs index 08f0319..c9a7d51 100644 --- a/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml.cs +++ b/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml.cs @@ -8,67 +8,67 @@ using Xamarin.Forms.Xaml; namespace TINK.View.Contact { - using Serilog; - using TINK.Model; - using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS; - using TINK.ViewModel.Contact; + using Serilog; + using TINK.Model; + using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS; + using TINK.ViewModel.Contact; - [XamlCompilation(XamlCompilationOptions.Compile)] + [XamlCompilation(XamlCompilationOptions.Compile)] #if USEFLYOUT public partial class SelectStationPage : ContentPage, IViewService, IDetailPage #else - public partial class SelectStationPage : ContentPage, IViewService + public partial class SelectStationPage : ContentPage, IViewService #endif - { - /// View model to notify about whether page appears or hides. - private SelectStationPageViewModel SelectStationPageViewModel { get; set; } + { + /// View model to notify about whether page appears or hides. + private SelectStationPageViewModel SelectStationPageViewModel { get; set; } - public SelectStationPage() - { - InitializeComponent(); - } + public SelectStationPage() + { + InitializeComponent(); + } - /// - /// Displays alert message. - /// - /// Title of message. - /// Message to display. - /// Type of buttons. - public new async Task DisplayAlert(string title, string message, string cancel) - => await App.Current.MainPage.DisplayAlert(title, message, cancel); + /// + /// Displays alert message. + /// + /// Title of message. + /// Message to display. + /// Type of buttons. + public new async Task DisplayAlert(string title, string message, string cancel) + => await App.Current.MainPage.DisplayAlert(title, message, cancel); - /// Displays alert message. - /// Title of message. - /// Message to display. - /// Detailed error description. - /// Type of buttons. - public async Task DisplayAdvancedAlert( - string title, - string message, - string details, - string cancel) - => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel); + /// Displays alert message. + /// Title of message. + /// Message to display. + /// Detailed error description. + /// Type of buttons. + public async Task DisplayAdvancedAlert( + string title, + string message, + string details, + string cancel) + => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel); - /// Displays detailed alert message. - /// Title of message. - /// Message to display. - /// Detailed error description. - /// Text of accept button. - /// Text of cancel button. - /// True if user pressed accept. - public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel) - => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel); + /// Displays detailed alert message. + /// Title of message. + /// Message to display. + /// Detailed error description. + /// Text of accept button. + /// Text of cancel button. + /// True if user pressed accept. + public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel) + => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel); - /// - /// Displays alert message. - /// - /// Title of message. - /// Message to display. - /// Text of accept button. - /// Text of button. - /// True if user pressed accept. - public new async Task DisplayAlert(string title, string message, string accept, string cancel) - => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel); + /// + /// Displays alert message. + /// + /// Title of message. + /// Message to display. + /// Text of accept button. + /// Text of button. + /// True if user pressed accept. + public new async Task DisplayAlert(string title, string message, string accept, string cancel) + => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel); #if USEFLYOUT /// @@ -78,45 +78,45 @@ namespace TINK.View.Contact public void ShowPage(ViewTypes type, string title = null) => NavigationMasterDetail.ShowPage(type.GetViewType(), title); #else - /// Shows a page. - /// Route of the page to show. - public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route); + /// Shows a page. + /// Route of the page to show. + public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route); #endif - /// Pushes a page onto the modal stack. - /// Type of page to display. - public async Task PushModalAsync(ViewTypes typeOfPage) - => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType())); + /// Pushes a page onto the modal stack. + /// Type of page to display. + public async Task PushModalAsync(ViewTypes typeOfPage) + => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType())); - /// Pops a page from the modal stack. - public async Task PopModalAsync() - => await Navigation.PopModalAsync(); + /// Pops a page from the modal stack. + public async Task PopModalAsync() + => await Navigation.PopModalAsync(); - /// Pushes a page onto the stack. - /// Page to display. - public async Task PushAsync(ViewTypes typeOfPage) - { + /// Pushes a page onto the stack. + /// Page to display. + public async Task PushAsync(ViewTypes typeOfPage) + { #if USEFLYOUT var page = Activator.CreateInstance(typeOfPage.GetViewType()) as IDetailPage; #else - var page = Activator.CreateInstance(typeOfPage.GetViewType()); + var page = Activator.CreateInstance(typeOfPage.GetViewType()); #endif - if (page == null) - { - return; - } + if (page == null) + { + return; + } #if USEFLYOUT page.NavigationMasterDetail = NavigationMasterDetail; #endif - await Navigation.PushAsync((Page)page); - } + await Navigation.PushAsync((Page)page); + } #if USCSHARP9 public Task DisplayUserFeedbackPopup() => throw new NotSupportedException(); #else - public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException(); + public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException(); #endif #if USEFLYOUT @@ -124,86 +124,86 @@ namespace TINK.View.Contact public INavigationMasterDetail NavigationMasterDetail { private get; set; } #endif - /// - /// Invoked when page is shown. - /// Starts update process. - /// - protected async override void OnAppearing() - { - // Pass reference to member Navigation to show bikes at station x dialog. - try - { - Log.ForContext().Verbose("Constructing select station view model."); + /// + /// Invoked when page is shown. + /// Starts update process. + /// + protected async override void OnAppearing() + { + // Pass reference to member Navigation to show bikes at station x dialog. + try + { + Log.ForContext().Verbose("Constructing select station view model."); #if TRYNOTBACKSTYLE SelectStationPageViewModel = new SelectStationPageViewModel(); #else - SelectStationPageViewModel = new SelectStationPageViewModel( - App.ModelRoot, - App.PermissionsService, - App.BluetoothService, - App.LocationServicesContainer.Active, - (mapspan) => MyMap.MoveToRegion(mapspan), - this, - Navigation); + SelectStationPageViewModel = new SelectStationPageViewModel( + App.ModelRoot, + App.PermissionsService, + App.BluetoothService, + App.LocationServicesContainer.Active, + (mapspan) => MyMap.MoveToRegion(mapspan), + this, + Navigation); #endif - } - catch (Exception exception) - { + } + catch (Exception exception) + { - Log.ForContext().Error("Constructing select station view model failed. {Exception}", exception); - return; - } + Log.ForContext().Error("Constructing select station view model failed. {Exception}", exception); + return; + } - try - { - BindingContext = SelectStationPageViewModel; + try + { + BindingContext = SelectStationPageViewModel; #if USEFLYOUT SelectStationPageViewModel.NavigationMasterDetail = NavigationMasterDetail; #endif - } - catch (Exception exception) - { - Log.ForContext().Error("Setting binding/ navigaton on select station failed. {Exception}", exception); - return; - } + } + catch (Exception exception) + { + Log.ForContext().Error("Setting binding/ navigaton on select station failed. {Exception}", exception); + return; + } - try - { - base.OnAppearing(); - } - catch (Exception exception) - { - // Continue because styling is not essential. - Log.ForContext().Error("Invoking OnAppearing of base failed. {Exception}", exception); - return; - } + try + { + base.OnAppearing(); + } + catch (Exception exception) + { + // Continue because styling is not essential. + Log.ForContext().Error("Invoking OnAppearing of base failed. {Exception}", exception); + return; + } - try - { - // Pre move and scanle maps to avoid initial display of map in Rome. - Log.ForContext().Verbose("Moving and scaling map."); - SelectStationPageViewModel.MoveAndScale( - (mapSpan) => MyMap.MoveToRegion(mapSpan), - App.ModelRoot.Uris.ActiveUri); - } - catch (Exception exception) - { - // Continue because a map not beeing moved/ scaled is no reason for aborting startup. - Log.ForContext().Error("Moving and scaling map failed. {Exception}", exception); - } + try + { + // Pre move and scanle maps to avoid initial display of map in Rome. + Log.ForContext().Verbose("Moving and scaling map."); + SelectStationPageViewModel.MoveAndScale( + (mapSpan) => MyMap.MoveToRegion(mapSpan), + App.ModelRoot.Uris.ActiveUri); + } + catch (Exception exception) + { + // Continue because a map not beeing moved/ scaled is no reason for aborting startup. + Log.ForContext().Error("Moving and scaling map failed. {Exception}", exception); + } - try - { - Log.ForContext().Verbose("Invoking OnAppearing on select station view model."); - await SelectStationPageViewModel.OnAppearing(); - } - catch (Exception exception) - { - Log.ForContext().Error("Invoking OnAppearing on select station view model failed. {Exception}", exception); - return; - } - } - } + try + { + Log.ForContext().Verbose("Invoking OnAppearing on select station view model."); + await SelectStationPageViewModel.OnAppearing(); + } + catch (Exception exception) + { + Log.ForContext().Error("Invoking OnAppearing on select station view model failed. {Exception}", exception); + return; + } + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/CopriWebView/ManageAccountPage.xaml.cs b/LastenradBayern/TINK/View/CopriWebView/ManageAccountPage.xaml.cs index 7469312..68feb69 100644 --- a/LastenradBayern/TINK/View/CopriWebView/ManageAccountPage.xaml.cs +++ b/LastenradBayern/TINK/View/CopriWebView/ManageAccountPage.xaml.cs @@ -7,53 +7,53 @@ using Xamarin.Forms.Xaml; namespace TINK.View.CopriWebView { - [XamlCompilation(XamlCompilationOptions.Compile)] - public partial class ManageAccountPage : ContentPage - { - public ManageAccountPage() - { - InitializeComponent(); + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class ManageAccountPage : ContentPage + { + public ManageAccountPage() + { + InitializeComponent(); - ManageAccount.Navigating += (sender, ev) => - { - if (!ev.Url.ToUpper().EndsWith(".PDF")) - { - // Stay inside web view except for downloading pdf- files. - this.IsEnabled = false; - ActivityIndicatorLoading.IsVisible = true; - ActivityIndicatorLoading.IsRunning = true; - return; - } + ManageAccount.Navigating += (sender, ev) => + { + if (!ev.Url.ToUpper().EndsWith(".PDF")) + { + // Stay inside web view except for downloading pdf- files. + this.IsEnabled = false; + ActivityIndicatorLoading.IsVisible = true; + ActivityIndicatorLoading.IsRunning = true; + return; + } - DependencyService.Get().OpenUrl(ev.Url); - }; + DependencyService.Get().OpenUrl(ev.Url); + }; - ManageAccount.Navigated += (sender, ev) => - { - if (ev.Result == WebNavigationResult.Success) - { - this.IsEnabled = true; - ActivityIndicatorLoading.IsVisible = false; - ActivityIndicatorLoading.IsRunning = false; - return; - } + ManageAccount.Navigated += (sender, ev) => + { + if (ev.Result == WebNavigationResult.Success) + { + this.IsEnabled = true; + ActivityIndicatorLoading.IsVisible = false; + ActivityIndicatorLoading.IsRunning = false; + return; + } - Log.ForContext().Error("Navigation did not succeed.{@Event}{@Sender}", ev, sender); - ManageAccount.Source = new HtmlWebViewSource - { - Html = "Kann persönliche Daten nicht anzeigen/ verwalten!
Verbindung mit Internet ok?" - }; + Log.ForContext().Error("Navigation did not succeed.{@Event}{@Sender}", ev, sender); + ManageAccount.Source = new HtmlWebViewSource + { + Html = "Kann persönliche Daten nicht anzeigen/ verwalten!
Verbindung mit Internet ok?" + }; - this.IsEnabled = true; - ActivityIndicatorLoading.IsVisible = false; - ActivityIndicatorLoading.IsRunning = false; - }; + this.IsEnabled = true; + ActivityIndicatorLoading.IsVisible = false; + ActivityIndicatorLoading.IsRunning = false; + }; - ManageAccount.BindingContext = new ManageAccountViewModel( - App.ModelRoot.ActiveUser.SessionCookie, - Model.TinkApp.MerchantId, - CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, - App.ModelRoot.NextActiveUri.Host); - } - } + ManageAccount.BindingContext = new ManageAccountViewModel( + App.ModelRoot.ActiveUser.SessionCookie, + Model.TinkApp.MerchantId, + CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, + App.ModelRoot.NextActiveUri.Host); + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/CopriWebView/PasswordForgottenPage.xaml.cs b/LastenradBayern/TINK/View/CopriWebView/PasswordForgottenPage.xaml.cs index 666b74c..c906c33 100644 --- a/LastenradBayern/TINK/View/CopriWebView/PasswordForgottenPage.xaml.cs +++ b/LastenradBayern/TINK/View/CopriWebView/PasswordForgottenPage.xaml.cs @@ -7,45 +7,45 @@ using Xamarin.Forms.Xaml; namespace TINK.View.CopriWebView { - [XamlCompilation(XamlCompilationOptions.Compile)] - public partial class PasswordForgottenPage : ContentPage - { - public PasswordForgottenPage() - { - InitializeComponent(); + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class PasswordForgottenPage : ContentPage + { + public PasswordForgottenPage() + { + InitializeComponent(); - PasswordForgottenWebView.Navigating += (sender, ev) => - { - this.IsEnabled = false; - ActivityIndicatorLoading.IsVisible = true; - ActivityIndicatorLoading.IsRunning = true; - }; + PasswordForgottenWebView.Navigating += (sender, ev) => + { + this.IsEnabled = false; + ActivityIndicatorLoading.IsVisible = true; + ActivityIndicatorLoading.IsRunning = true; + }; - PasswordForgottenWebView.Navigated += (sender, ev) => - { - if (ev.Result == WebNavigationResult.Success) - { - this.IsEnabled = true; - ActivityIndicatorLoading.IsVisible = false; - ActivityIndicatorLoading.IsRunning = false; - return; - } + PasswordForgottenWebView.Navigated += (sender, ev) => + { + if (ev.Result == WebNavigationResult.Success) + { + this.IsEnabled = true; + ActivityIndicatorLoading.IsVisible = false; + ActivityIndicatorLoading.IsRunning = false; + return; + } - Log.ForContext().Error("Navigation did not succeed. {@Event}", ev); - PasswordForgottenWebView.Source = new HtmlWebViewSource - { - Html = "Kann Passwort vergessen Seite nicht anzeigen!
Verbindung mit Internet ok?" - }; + Log.ForContext().Error("Navigation did not succeed. {@Event}", ev); + PasswordForgottenWebView.Source = new HtmlWebViewSource + { + Html = "Kann Passwort vergessen Seite nicht anzeigen!
Verbindung mit Internet ok?" + }; - this.IsEnabled = true; - ActivityIndicatorLoading.IsVisible = false; - ActivityIndicatorLoading.IsRunning = false; - }; + this.IsEnabled = true; + ActivityIndicatorLoading.IsVisible = false; + ActivityIndicatorLoading.IsRunning = false; + }; - PasswordForgottenWebView.BindingContext = new PasswordForgottonViewModel( - Model.TinkApp.MerchantId, - CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, - App.ModelRoot.NextActiveUri.Host); - } - } + PasswordForgottenWebView.BindingContext = new PasswordForgottonViewModel( + Model.TinkApp.MerchantId, + CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, + App.ModelRoot.NextActiveUri.Host); + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/CopriWebView/RegisterPage.xaml.cs b/LastenradBayern/TINK/View/CopriWebView/RegisterPage.xaml.cs index 6d5fd7b..e69cd6b 100644 --- a/LastenradBayern/TINK/View/CopriWebView/RegisterPage.xaml.cs +++ b/LastenradBayern/TINK/View/CopriWebView/RegisterPage.xaml.cs @@ -8,48 +8,48 @@ using Xamarin.Forms.Xaml; namespace TINK.View.CopriWebView { - [XamlCompilation(XamlCompilationOptions.Compile)] - public partial class RegisterPage : ContentPage - { - public RegisterPage() - { - DependencyService.Get().ClearCookies(); + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class RegisterPage : ContentPage + { + public RegisterPage() + { + DependencyService.Get().ClearCookies(); - InitializeComponent(); + InitializeComponent(); - RegisterView.Navigating += (sender, ev) => - { - this.IsEnabled = false; - ActivityIndicatorLoading.IsVisible = true; - ActivityIndicatorLoading.IsRunning = true; - }; + RegisterView.Navigating += (sender, ev) => + { + this.IsEnabled = false; + ActivityIndicatorLoading.IsVisible = true; + ActivityIndicatorLoading.IsRunning = true; + }; - RegisterView.Navigated += (sender, ev) => - { - if (ev.Result == WebNavigationResult.Success) - { - this.IsEnabled = true; - ActivityIndicatorLoading.IsVisible = false; - ActivityIndicatorLoading.IsRunning = false; - return; - } + RegisterView.Navigated += (sender, ev) => + { + if (ev.Result == WebNavigationResult.Success) + { + this.IsEnabled = true; + ActivityIndicatorLoading.IsVisible = false; + ActivityIndicatorLoading.IsRunning = false; + return; + } - Log.ForContext().Error("Navigation did not succeed. {@Event}", ev); - RegisterView.Source = new HtmlWebViewSource - { - Html = "Kann Anmeldeseite nicht anzeigen!
Verbindung mit Internet ok?" - }; + Log.ForContext().Error("Navigation did not succeed. {@Event}", ev); + RegisterView.Source = new HtmlWebViewSource + { + Html = "Kann Anmeldeseite nicht anzeigen!
Verbindung mit Internet ok?" + }; - this.IsEnabled = true; - ActivityIndicatorLoading.IsVisible = false; - ActivityIndicatorLoading.IsRunning = false; - }; + this.IsEnabled = true; + ActivityIndicatorLoading.IsVisible = false; + ActivityIndicatorLoading.IsRunning = false; + }; - RegisterView.BindingContext = new RegisterPageViewModel( - Model.TinkApp.MerchantId, - CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, - App.ModelRoot.NextActiveUri.Host); + RegisterView.BindingContext = new RegisterPageViewModel( + Model.TinkApp.MerchantId, + CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, + App.ModelRoot.NextActiveUri.Host); - } - } + } + } } \ No newline at end of file diff --git a/LastenradBayern/TINK/View/FeedbackPopup.xaml b/LastenradBayern/TINK/View/FeedbackPopup.xaml index d83d3b7..b1c903b 100644 --- a/LastenradBayern/TINK/View/FeedbackPopup.xaml +++ b/LastenradBayern/TINK/View/FeedbackPopup.xaml @@ -10,105 +10,75 @@ - - - - - - - - - - - - - - + + + - - - - - - - + + + + x:Name="Co2SavingFrame">