cleanup options page a bit more

This commit is contained in:
Kyle Spearrin 2019-06-03 10:57:08 -04:00
parent cf4a6bb1a2
commit 59620e6435
2 changed files with 85 additions and 82 deletions

View file

@ -90,8 +90,7 @@
Text="{u:I18n DisableWebsiteIconsDescription}" Text="{u:I18n DisableWebsiteIconsDescription}"
StyleClass="box-footer-label" /> StyleClass="box-footer-label" />
</StackLayout> </StackLayout>
<StackLayout Spacing="0" Padding="0" IsVisible="{Binding AndroidOptions}"> <StackLayout StyleClass="box" IsVisible="{Binding AndroidOptions}">
<StackLayout StyleClass="box">
<StackLayout StyleClass="box-row-header"> <StackLayout StyleClass="box-row-header">
<Label Text="{u:I18n AutofillService}" <Label Text="{u:I18n AutofillService}"
StyleClass="box-header, box-header-platform" /> StyleClass="box-header, box-header-platform" />
@ -110,7 +109,7 @@
Text="{u:I18n DisableSavePromptDescription}" Text="{u:I18n DisableSavePromptDescription}"
StyleClass="box-footer-label" /> StyleClass="box-footer-label" />
</StackLayout> </StackLayout>
<StackLayout StyleClass="box"> <StackLayout StyleClass="box" IsVisible="{Binding AndroidOptions}">
<StackLayout StyleClass="box-row, box-row-input"> <StackLayout StyleClass="box-row, box-row-input">
<Label <Label
Text="{u:I18n BlacklistedUris}" Text="{u:I18n BlacklistedUris}"
@ -122,14 +121,14 @@
AutoSize="TextChanges" AutoSize="TextChanges"
IsSpellCheckEnabled="False" IsSpellCheckEnabled="False"
IsTextPredictionEnabled="False" IsTextPredictionEnabled="False"
Keyboard="Plain" Keyboard="Url"
Unfocused="BlacklistedUrisEditor_Unfocused" /> Unfocused="BlacklistedUrisEditor_Unfocused" />
</StackLayout> </StackLayout>
<Label <Label
Text="{u:I18n BlacklistedUrisDescription}" Text="{u:I18n BlacklistedUrisDescription}"
StyleClass="box-footer-label" /> StyleClass="box-footer-label" />
</StackLayout> </StackLayout>
<StackLayout StyleClass="box"> <StackLayout StyleClass="box" IsVisible="{Binding AndroidOptions}">
<StackLayout StyleClass="box-row-header"> <StackLayout StyleClass="box-row-header">
<Label Text="{u:I18n AutofillAccessibilityService}" <Label Text="{u:I18n AutofillAccessibilityService}"
StyleClass="box-header, box-header-platform" /> StyleClass="box-header, box-header-platform" />
@ -148,7 +147,7 @@
Text="{u:I18n AutofillAlwaysDescription}" Text="{u:I18n AutofillAlwaysDescription}"
StyleClass="box-footer-label" /> StyleClass="box-footer-label" />
</StackLayout> </StackLayout>
<StackLayout StyleClass="box"> <StackLayout StyleClass="box" IsVisible="{Binding AndroidOptions}">
<StackLayout StyleClass="box-row, box-row-switch"> <StackLayout StyleClass="box-row, box-row-switch">
<Label <Label
Text="{u:I18n AutofillPersistNotification}" Text="{u:I18n AutofillPersistNotification}"
@ -163,7 +162,7 @@
Text="{u:I18n AutofillPersistNotificationDescription}" Text="{u:I18n AutofillPersistNotificationDescription}"
StyleClass="box-footer-label" /> StyleClass="box-footer-label" />
</StackLayout> </StackLayout>
<StackLayout StyleClass="box"> <StackLayout StyleClass="box" IsVisible="{Binding AndroidOptions}">
<StackLayout StyleClass="box-row, box-row-switch"> <StackLayout StyleClass="box-row, box-row-switch">
<Label <Label
Text="{u:I18n AutofillPasswordField}" Text="{u:I18n AutofillPasswordField}"
@ -179,7 +178,6 @@
StyleClass="box-footer-label" /> StyleClass="box-footer-label" />
</StackLayout> </StackLayout>
</StackLayout> </StackLayout>
</StackLayout>
</ScrollView> </ScrollView>
</pages:BaseContentPage> </pages:BaseContentPage>

View file

@ -328,12 +328,17 @@ namespace Bit.App.Pages
var urisList = new List<string>(); var urisList = new List<string>();
foreach(var uri in csv.Split(',')) foreach(var uri in csv.Split(','))
{ {
if(!uri.StartsWith("http://") && !uri.StartsWith("https://") && if(string.IsNullOrWhiteSpace(uri))
!uri.StartsWith(Constants.AndroidAppProtocol))
{ {
continue; continue;
} }
urisList.Add(uri.Replace("\\n", string.Empty).Trim()); var cleanedUri = uri.Replace(System.Environment.NewLine, string.Empty).Trim();
if(!cleanedUri.StartsWith("http://") && !cleanedUri.StartsWith("https://") &&
!cleanedUri.StartsWith(Constants.AndroidAppProtocol))
{
continue;
}
urisList.Add(cleanedUri);
} }
await _storageService.SaveAsync(Constants.AutofillBlacklistedUrisKey, urisList); await _storageService.SaveAsync(Constants.AutofillBlacklistedUrisKey, urisList);
AutofillBlacklistedUris = string.Join(", ", urisList); AutofillBlacklistedUris = string.Join(", ", urisList);