sharee.bike-App/LastenradBayern/ShareeBike/View/Settings/SettingsPage.xaml

310 lines
15 KiB
Text
Raw Normal View History

2021-05-13 20:16:41 +02:00
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
2024-04-09 12:53:23 +02:00
x:Class="ShareeBike.View.Settings.SettingsPage"
xmlns:conv="clr-namespace:ShareeBike.View.Settings;assembly=SharedBusinessLogic"
xmlns:account="clr-namespace:ShareeBike.Model.User.Account;assembly=SharedBusinessLogic"
xmlns:resources="clr-namespace:ShareeBike.MultilingualResources;assembly=SharedBusinessLogic"
2023-05-11 17:39:28 +02:00
BackgroundColor="{DynamicResource background-color}">
2021-05-13 20:16:41 +02:00
2024-04-09 12:53:23 +02:00
<ContentPage.Resources>
<conv:BackendPermissionsToVisibleConverter x:Key="Frame_Converter"/>
<conv:PermissionToVisibleConverter x:Key="SwitchTheme_Converter" VisibleFlag="{x:Static account:Permissions.SwitchTheme}"/>
<conv:PermissionToVisibleConverter x:Key="PickCopriServer_Converter" VisibleFlag="{x:Static account:Permissions.PickCopriServer}"/>
<conv:PermissionToVisibleConverter x:Key="ManagePolling_Converter" VisibleFlag="{x:Static account:Permissions.ManagePolling}"/>
<conv:PermissionToVisibleConverter x:Key="ManageCopriCacheExpiration_Converter" VisibleFlag="{x:Static account:Permissions.ManageCopriCacheExpiration}"/>
<conv:PermissionToVisibleConverter x:Key="PickLockServiceImplementation_Converter" VisibleFlag="{x:Static account:Permissions.PickLockServiceImplementation}"/>
<conv:PermissionToVisibleConverter x:Key="PickLocationServiceImplementation_Converter" VisibleFlag="{x:Static account:Permissions.PickLocationServiceImplementation}"/>
<conv:PermissionToVisibleConverter x:Key="PickLoggingLevel_Converter" VisibleFlag="{x:Static account:Permissions.PickLoggingLevel}"/>
<conv:PermissionToVisibleConverter x:Key="ReportLevel_Converter" VisibleFlag="{x:Static account:Permissions.ReportLevel}"/>
<conv:PermissionToVisibleConverter x:Key="ShowDiagnostics_Converter" VisibleFlag="{x:Static account:Permissions.ShowDiagnostics}"/>
<conv:PermissionToVisibleConverter x:Key="SwitchSiteCaching_Converter" VisibleFlag="{x:Static account:Permissions.SwitchNoSiteCaching}"/>
</ContentPage.Resources>
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}"
2022-08-30 15:42:25 +02:00
Text="{x:Static resources:AppResources.MarkingSettings}"/>
2024-04-09 12:53:23 +02:00
</Grid>
</Shell.TitleView>
<ContentPage.Content>
2023-05-11 17:39:28 +02:00
<ScrollView>
2023-07-04 11:06:38 +02:00
<StackLayout
Spacing="0">
2023-05-11 17:39:28 +02:00
<Frame
Padding="10"
Margin="0,10,0,5"
HorizontalOptions="FillAndExpand"
2024-04-09 12:53:23 +02:00
BackgroundColor="White"
IsVisible="true">
2023-05-11 17:39:28 +02:00
<Grid ColumnDefinitions="*,Auto">
<Label Text="{x:Static resources:AppResources.MarkingCenterMapToCurrentPos}"/>
<Switch Grid.Column="1" IsToggled="{Binding CenterMapToCurrentLocation}"/>
</Grid>
</Frame>
2024-04-09 12:53:23 +02:00
<!-- Filter on view ShareeBike/ Citybike -->
2023-05-11 17:39:28 +02:00
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
IsVisible="{Binding IsGroupFilterVisible}">
<StackLayout>
<Label Text="{x:Static resources:AppResources.MarkingShowHideBikesOfType}"/>
<ListView
2021-05-13 20:16:41 +02:00
HasUnevenRows="True"
HeightRequest="120"
x:Name="Filters">
2023-05-11 17:39:28 +02:00
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell IsEnabled="{Binding IsEnabled}">
<Grid ColumnDefinitions="*,Auto">
<Label Text="{Binding Text}"/>
<Switch Grid.Column="1" IsToggled="{Binding IsActivated}"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
<!-- Picker to select startup page -->
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
2024-04-09 12:53:23 +02:00
BackgroundColor="White"
IsVisible="{Binding DebugLevel, Converter={StaticResource Frame_Converter}}">
2023-05-11 17:39:28 +02:00
<StackLayout>
<Label Text="{x:Static resources:AppResources.MarkingStartupPage}"/>
<Picker
2022-10-17 18:45:38 +02:00
ItemsSource="{Binding StartupSettings.ServicesTextList}"
SelectedItem="{Binding StartupSettings.ActiveText}"/>
2023-05-11 17:39:28 +02:00
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
<!-- Themes -->
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
2024-04-09 12:53:23 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource Frame_Converter}}">
2023-05-11 17:39:28 +02:00
<StackLayout>
<Label
2024-04-09 12:53:23 +02:00
Text="Theme"
IsVisible="{Binding DebugLevel, Converter={StaticResource SwitchTheme_Converter}}"/>
2023-05-11 17:39:28 +02:00
<Picker
2024-04-09 12:53:23 +02:00
ItemsSource="{Binding Themes.ServicesTextList}"
SelectedItem="{Binding Themes.ActiveText}"
IsVisible="{Binding DebugLevel, Converter={StaticResource SwitchTheme_Converter}}"/>
2023-05-11 17:39:28 +02:00
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
<!-- COPRI server selection -->
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
IsVisible="{Binding DebugLevel, Converter={StaticResource Frame_Converter}}">
<StackLayout>
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickCopriServer_Converter}}"
2023-05-09 08:47:52 +02:00
Text="{Binding CopriServerUriList.CopriServerUriDescription}"/>
2023-05-11 17:39:28 +02:00
<Picker
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickCopriServer_Converter}}"
ItemsSource="{Binding CopriServerUriList.ServerTextList}"
SelectedItem="{Binding CopriServerUriList.NextActiveServerText}"/>
2023-05-11 17:39:28 +02:00
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ManagePolling_Converter}}"
Text="{Binding Polling.PollingText}"/>
2023-05-11 17:39:28 +02:00
<Switch
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ManagePolling_Converter}}"
IsToggled="{Binding Polling.IsActivated}"/>
2023-05-11 17:39:28 +02:00
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ManagePolling_Converter}}"
Text="{Binding Polling.PeriodeTotalSecondsText}"/>
2023-05-11 17:39:28 +02:00
<Stepper
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ManagePolling_Converter}}"
Minimum="5"
Increment="5"
Maximum="600"
IsEnabled="{Binding Polling.IsActivated}"
Value="{Binding Polling.PeriodeTotalSeconds}"/>
2023-05-11 17:39:28 +02:00
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ManageCopriCacheExpiration_Converter}}"
Text="Time after which COPRI-cache expires [s]"/>
2023-05-11 17:39:28 +02:00
<Slider
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ManageCopriCacheExpiration_Converter}}"
x:Name="expiresAfter"
Minimum="0"
Maximum="15"
Value="{Binding ExpiresAfterTotalSeconds}"/>
2023-05-11 17:39:28 +02:00
<Entry
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ManageCopriCacheExpiration_Converter}}"
IsReadOnly="True"
Text="{Binding ExpiresAfterTotalSecondsText}"/>
2023-05-11 17:39:28 +02:00
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
<!-- Lock control -->
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLockServiceImplementation_Converter}}">
<StackLayout>
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLockServiceImplementation_Converter}}"
2022-05-15 19:56:03 +02:00
Text="{x:Static resources:AppResources.MarkingLockControl}" />
2023-05-11 17:39:28 +02:00
<Picker
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLockServiceImplementation_Converter}}"
ItemsSource="{Binding LocksServices.Services.ServicesTextList}"
SelectedItem="{Binding LocksServices.Services.ActiveText}"/>
2023-05-11 17:39:28 +02:00
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLockServiceImplementation_Converter}}"
Text="Bluetooth Connect Timeout [sec]"/>
2023-05-11 17:39:28 +02:00
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLockServiceImplementation_Converter}}"
Text="{Binding LocksServices.ConnectTimeoutSecText}"/>
2023-05-11 17:39:28 +02:00
<Stepper
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLockServiceImplementation_Converter}}"
Minimum="0.1"
Increment="0.25"
Maximum="60"
Value="{Binding LocksServices.ConnectTimeoutSec}"/>
2023-05-11 17:39:28 +02:00
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
<!-- Geolocation -->
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLocationServiceImplementation_Converter}}">
<StackLayout>
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLocationServiceImplementation_Converter}}"
2022-05-15 19:56:03 +02:00
Text="{x:Static resources:AppResources.MarkingGeolocationControl}" />
2023-05-11 17:39:28 +02:00
<Picker
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLocationServiceImplementation_Converter}}"
ItemsSource="{Binding GeolocationServices.ServicesTextList}"
SelectedItem="{Binding GeolocationServices.ActiveText}"/>
2023-05-11 17:39:28 +02:00
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
<!-- Web site caching -->
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
IsVisible="{Binding DebugLevel, Converter={StaticResource SwitchSiteCaching_Converter}}">
<StackLayout>
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource SwitchSiteCaching_Converter}}"
2022-05-15 19:56:03 +02:00
Text="{x:Static resources:AppResources.MarkingWebsiteCaching}"/>
2023-05-11 17:39:28 +02:00
<Switch
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource SwitchSiteCaching_Converter}}"
IsToggled="{Binding IsSiteCachingOnDisplayValue}"/>
2023-05-11 17:39:28 +02:00
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
<!-- Logging -->
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLoggingLevel_Converter}}">
<StackLayout>
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLoggingLevel_Converter}}"
2022-05-15 19:56:03 +02:00
Text="{x:Static resources:AppResources.MarkingLoggingLevel}" />
2023-05-11 17:39:28 +02:00
<Picker
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLoggingLevel_Converter}}"
ItemsSource="{Binding LoggingLevels}"
SelectedItem="{Binding SelectedLoggingLevel}"/>
2023-05-11 17:39:28 +02:00
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLoggingLevel_Converter}}"
Text="Logdatei in externen Pfad schreiben"/>
2023-05-11 17:39:28 +02:00
<Switch
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource PickLoggingLevel_Converter}}"
IsToggled="{Binding LogToExternalFolderDisplayValue}"
IsEnabled="{Binding IsLogToExternalFolderVisible}"/>
2023-05-11 17:39:28 +02:00
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
<!-- Logging -->
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
IsVisible="{Binding DebugLevel, Converter={StaticResource ReportLevel_Converter}}">
<StackLayout>
<Label
2021-06-26 20:57:55 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ReportLevel_Converter}}"
2022-05-15 19:56:03 +02:00
Text="{x:Static resources:AppResources.MarkingVerboseErrorMessage}" />
2023-05-11 17:39:28 +02:00
<Switch
2021-06-26 20:57:55 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ReportLevel_Converter}}"
IsToggled="{Binding IsReportLevelVerbose}"/>
2023-05-11 17:39:28 +02:00
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
<!-- Display of parameters -->
<Frame
Padding="10"
Margin="0,5,0,5"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
IsVisible="{Binding DebugLevel, Converter={StaticResource ShowDiagnostics_Converter}}">
<StackLayout>
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ShowDiagnostics_Converter}}"
Text="Device Identifier" />
2023-05-11 17:39:28 +02:00
<Entry
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ShowDiagnostics_Converter}}"
IsEnabled="false"
Text="{Binding DeviceIdentifier}"/>
2023-05-11 17:39:28 +02:00
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ShowDiagnostics_Converter}}"
Text="Copri Sitzungkeks"/>
2023-05-11 17:39:28 +02:00
<Entry
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ShowDiagnostics_Converter}}"
IsEnabled="false"
Text="{Binding SessionCookie}"/>
2023-05-11 17:39:28 +02:00
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ShowDiagnostics_Converter}}"
Text="Interner Pfad (Einstell./ ggf. Logging)"/>
2023-05-11 17:39:28 +02:00
<Editor
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ShowDiagnostics_Converter}}"
IsEnabled="false"
Text="{Binding InternalPath}"/>
2023-05-11 17:39:28 +02:00
<Label
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ShowDiagnostics_Converter}}"
Text="Externer Pfad (Mock/ ggf. Logging)"/>
2023-05-11 17:39:28 +02:00
<Editor
2021-05-13 20:16:41 +02:00
IsVisible="{Binding DebugLevel, Converter={StaticResource ShowDiagnostics_Converter}}"
IsEnabled="false"
Text="{Binding ExternalPath}"/>
2023-05-11 17:39:28 +02:00
</StackLayout>
</Frame>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
</StackLayout>
2024-04-09 12:53:23 +02:00
2023-05-11 17:39:28 +02:00
</ScrollView>
2024-04-09 12:53:23 +02:00
</ContentPage.Content>
2022-10-17 18:45:38 +02:00
</ContentPage>