1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-23 11:45:38 +01:00

settings enabled/disabled text

This commit is contained in:
Kyle Spearrin 2019-06-03 11:26:16 -04:00
parent e8c776fe49
commit a3716bc841
4 changed files with 23 additions and 8 deletions

View File

@ -32,6 +32,7 @@
HorizontalOptions="End" HorizontalOptions="End"
HorizontalTextAlignment="End" HorizontalTextAlignment="End"
VerticalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"
TextColor="{Binding SubLabelColor}"
StyleClass="list-sub" /> StyleClass="list-sub" />
</StackLayout> </StackLayout>
</ViewCell> </ViewCell>

View File

@ -1,9 +1,17 @@
namespace Bit.App.Pages using Bit.App.Resources;
using System.Collections.Generic;
using Xamarin.Forms;
namespace Bit.App.Pages
{ {
public class SettingsPageListItem public class SettingsPageListItem
{ {
public string Icon { get; set; } public string Icon { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string SubLabel { get; set; } public string SubLabel { get; set; }
public bool SubLabelTextEnabled => SubLabel == AppResources.Enabled;
public Color SubLabelColor => SubLabelTextEnabled ?
(Color)Application.Current.Resources["SuccessColor"] :
(Color)Application.Current.Resources["MutedColor"];
} }
} }

View File

@ -281,13 +281,15 @@ namespace Bit.App.Pages
autofillItems.Add(new SettingsPageListItem autofillItems.Add(new SettingsPageListItem
{ {
Name = AppResources.AutofillService, Name = AppResources.AutofillService,
SubLabel = _deviceActionService.AutofillServiceEnabled() ? "✓" : null SubLabel = _deviceActionService.AutofillServiceEnabled() ?
AppResources.Enabled : AppResources.Disabled
}); });
} }
autofillItems.Add(new SettingsPageListItem autofillItems.Add(new SettingsPageListItem
{ {
Name = AppResources.AutofillAccessibilityService, Name = AppResources.AutofillAccessibilityService,
SubLabel = _deviceActionService.AutofillAccessibilityServiceRunning() ? "✓" : null SubLabel = _deviceActionService.AutofillAccessibilityServiceRunning() ?
AppResources.Enabled : AppResources.Disabled
}); });
} }
else else
@ -306,7 +308,11 @@ namespace Bit.App.Pages
var securityItems = new List<SettingsPageListItem> var securityItems = new List<SettingsPageListItem>
{ {
new SettingsPageListItem { Name = AppResources.LockOptions, SubLabel = _lockOptionValue }, new SettingsPageListItem { Name = AppResources.LockOptions, SubLabel = _lockOptionValue },
new SettingsPageListItem { Name = AppResources.UnlockWithPIN, SubLabel = _pin ? "✓" : null }, new SettingsPageListItem
{
Name = AppResources.UnlockWithPIN,
SubLabel = _pin ? AppResources.Enabled : AppResources.Disabled
},
new SettingsPageListItem { Name = AppResources.LockNow }, new SettingsPageListItem { Name = AppResources.LockNow },
new SettingsPageListItem { Name = AppResources.TwoStepLogin } new SettingsPageListItem { Name = AppResources.TwoStepLogin }
}; };
@ -315,7 +321,7 @@ namespace Bit.App.Pages
var item = new SettingsPageListItem var item = new SettingsPageListItem
{ {
Name = string.Format(AppResources.UnlockWith, _fingerprintName), Name = string.Format(AppResources.UnlockWith, _fingerprintName),
SubLabel = _fingerprint ? "✓" : null SubLabel = _fingerprint ? AppResources.Enabled : AppResources.Disabled
}; };
securityItems.Insert(1, item); securityItems.Insert(1, item);
} }

View File

@ -34,7 +34,7 @@ namespace Bit.App.Pages
protected override async void OnAppearing() protected override async void OnAppearing()
{ {
base.OnAppearing(); base.OnAppearing();
_broadcasterService.Subscribe(nameof(ViewPage), async (message) => _broadcasterService.Subscribe(nameof(ViewPage), (message) =>
{ {
if(message.Command == "syncCompleted") if(message.Command == "syncCompleted")
{ {