mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 23:25:45 +03:00
Change switch binding back to using EnforcedPolicyOptions directly (#744)
This commit is contained in:
parent
cf3d52772d
commit
25aec80e4c
2 changed files with 9 additions and 17 deletions
|
@ -176,7 +176,8 @@
|
||||||
HorizontalOptions="StartAndExpand" />
|
HorizontalOptions="StartAndExpand" />
|
||||||
<Switch
|
<Switch
|
||||||
IsToggled="{Binding Uppercase}"
|
IsToggled="{Binding Uppercase}"
|
||||||
IsEnabled="{Binding IsUppercaseSwitchEnabled}"
|
IsEnabled="{Binding EnforcedPolicyOptions.UseUppercase,
|
||||||
|
Converter={StaticResource inverseBool}}"
|
||||||
StyleClass="box-value"
|
StyleClass="box-value"
|
||||||
HorizontalOptions="End" />
|
HorizontalOptions="End" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
@ -188,7 +189,8 @@
|
||||||
HorizontalOptions="StartAndExpand" />
|
HorizontalOptions="StartAndExpand" />
|
||||||
<Switch
|
<Switch
|
||||||
IsToggled="{Binding Lowercase}"
|
IsToggled="{Binding Lowercase}"
|
||||||
IsEnabled="{Binding IsLowercaseSwitchEnabled}"
|
IsEnabled="{Binding EnforcedPolicyOptions.UseLowercase,
|
||||||
|
Converter={StaticResource inverseBool}}"
|
||||||
StyleClass="box-value"
|
StyleClass="box-value"
|
||||||
HorizontalOptions="End" />
|
HorizontalOptions="End" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
@ -200,7 +202,8 @@
|
||||||
HorizontalOptions="StartAndExpand" />
|
HorizontalOptions="StartAndExpand" />
|
||||||
<Switch
|
<Switch
|
||||||
IsToggled="{Binding Number}"
|
IsToggled="{Binding Number}"
|
||||||
IsEnabled="{Binding IsNumberSwitchEnabled}"
|
IsEnabled="{Binding EnforcedPolicyOptions.UseNumbers,
|
||||||
|
Converter={StaticResource inverseBool}}"
|
||||||
StyleClass="box-value"
|
StyleClass="box-value"
|
||||||
HorizontalOptions="End" />
|
HorizontalOptions="End" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
@ -212,7 +215,8 @@
|
||||||
HorizontalOptions="StartAndExpand" />
|
HorizontalOptions="StartAndExpand" />
|
||||||
<Switch
|
<Switch
|
||||||
IsToggled="{Binding Special}"
|
IsToggled="{Binding Special}"
|
||||||
IsEnabled="{Binding IsSpecialSwitchEnabled}"
|
IsEnabled="{Binding EnforcedPolicyOptions.UseSpecial,
|
||||||
|
Converter={StaticResource inverseBool}}"
|
||||||
StyleClass="box-value"
|
StyleClass="box-value"
|
||||||
HorizontalOptions="End" />
|
HorizontalOptions="End" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
|
|
@ -229,11 +229,7 @@ namespace Bit.App.Pages
|
||||||
set => SetProperty(ref _enforcedPolicyOptions, value,
|
set => SetProperty(ref _enforcedPolicyOptions, value,
|
||||||
additionalPropertyNames: new[]
|
additionalPropertyNames: new[]
|
||||||
{
|
{
|
||||||
nameof(IsPolicyInEffect),
|
nameof(IsPolicyInEffect)
|
||||||
nameof(IsUppercaseSwitchEnabled),
|
|
||||||
nameof(IsLowercaseSwitchEnabled),
|
|
||||||
nameof(IsNumberSwitchEnabled),
|
|
||||||
nameof(IsSpecialSwitchEnabled)
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,14 +238,6 @@ namespace Bit.App.Pages
|
||||||
_enforcedPolicyOptions.NumberCount > 0 || _enforcedPolicyOptions.UseSpecial ||
|
_enforcedPolicyOptions.NumberCount > 0 || _enforcedPolicyOptions.UseSpecial ||
|
||||||
_enforcedPolicyOptions.SpecialCount > 0;
|
_enforcedPolicyOptions.SpecialCount > 0;
|
||||||
|
|
||||||
public bool IsUppercaseSwitchEnabled => !IsPolicyInEffect || !EnforcedPolicyOptions.UseUppercase;
|
|
||||||
|
|
||||||
public bool IsLowercaseSwitchEnabled => !IsPolicyInEffect || !EnforcedPolicyOptions.UseLowercase;
|
|
||||||
|
|
||||||
public bool IsNumberSwitchEnabled => !IsPolicyInEffect || !EnforcedPolicyOptions.UseNumbers;
|
|
||||||
|
|
||||||
public bool IsSpecialSwitchEnabled => !IsPolicyInEffect || !EnforcedPolicyOptions.UseSpecial;
|
|
||||||
|
|
||||||
public int TypeSelectedIndex
|
public int TypeSelectedIndex
|
||||||
{
|
{
|
||||||
get => _typeSelectedIndex;
|
get => _typeSelectedIndex;
|
||||||
|
|
Loading…
Reference in a new issue