mirror of
https://github.com/bitwarden/mobile
synced 2025-12-25 12:43:39 +00:00
Support for Disable Send policy (#1271)
* add support for disable send policy * cleanup * show/hide options support for send search results * additional failsafes and copy function consolidation * added missing disabled send icon to android renderer * async fix and string updates
This commit is contained in:
@@ -124,6 +124,7 @@
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Text=""
|
||||
IsVisible="{Binding ShowOptions, Mode=OneWay}"
|
||||
StyleClass="list-row-button, list-row-button-platform, btn-disabled"
|
||||
Clicked="MoreButton_Clicked"
|
||||
VerticalOptions="CenterAndExpand"
|
||||
|
||||
@@ -15,6 +15,9 @@ namespace Bit.App.Controls
|
||||
|
||||
public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create(
|
||||
nameof(ButtonCommand), typeof(Command<SendView>), typeof(SendViewCell));
|
||||
|
||||
public static readonly BindableProperty ShowOptionsProperty = BindableProperty.Create(
|
||||
nameof(ShowOptions), typeof(bool), typeof(SendViewCell));
|
||||
|
||||
private readonly IEnvironmentService _environmentService;
|
||||
|
||||
@@ -47,6 +50,12 @@ namespace Bit.App.Controls
|
||||
set => SetValue(ButtonCommandProperty, value);
|
||||
}
|
||||
|
||||
public bool ShowOptions
|
||||
{
|
||||
get => GetValue(ShowOptionsProperty) is bool && (bool)GetValue(ShowOptionsProperty);
|
||||
set => SetValue(ShowOptionsProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnPropertyChanged(string propertyName = null)
|
||||
{
|
||||
base.OnPropertyChanged(propertyName);
|
||||
@@ -58,6 +67,10 @@ namespace Bit.App.Controls
|
||||
{
|
||||
_viewModel.Send = Send;
|
||||
}
|
||||
else if (propertyName == ShowOptionsProperty.PropertyName)
|
||||
{
|
||||
_viewModel.ShowOptions = ShowOptions;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnBindingContextChanged()
|
||||
|
||||
@@ -6,11 +6,18 @@ namespace Bit.App.Controls
|
||||
public class SendViewCellViewModel : ExtendedViewModel
|
||||
{
|
||||
private SendView _send;
|
||||
private bool _showOptions;
|
||||
|
||||
public SendView Send
|
||||
{
|
||||
get => _send;
|
||||
set => SetProperty(ref _send, value);
|
||||
}
|
||||
|
||||
public bool ShowOptions
|
||||
{
|
||||
get => _showOptions;
|
||||
set => SetProperty(ref _showOptions, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user