mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03:00
SG-396 Fix tappable area after hiding account switching (#1956)
This commit is contained in:
parent
7c311fbb55
commit
b2500557e7
2 changed files with 19 additions and 2 deletions
|
@ -65,6 +65,8 @@ namespace Bit.App.Controls
|
||||||
|
|
||||||
public bool LongPressAccountEnabled { get; set; } = true;
|
public bool LongPressAccountEnabled { get; set; } = true;
|
||||||
|
|
||||||
|
public Action AfterHide { get; set; }
|
||||||
|
|
||||||
public async Task ToggleVisibilityAsync()
|
public async Task ToggleVisibilityAsync()
|
||||||
{
|
{
|
||||||
if (IsVisible)
|
if (IsVisible)
|
||||||
|
@ -137,6 +139,8 @@ namespace Bit.App.Controls
|
||||||
|
|
||||||
// remove overlay
|
// remove overlay
|
||||||
IsVisible = false;
|
IsVisible = false;
|
||||||
|
|
||||||
|
AfterHide?.Invoke();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,14 @@ namespace Bit.iOS.Core.Utilities
|
||||||
{
|
{
|
||||||
var overlay = new AccountSwitchingOverlayView()
|
var overlay = new AccountSwitchingOverlayView()
|
||||||
{
|
{
|
||||||
LongPressAccountEnabled = false
|
LongPressAccountEnabled = false,
|
||||||
|
AfterHide = () =>
|
||||||
|
{
|
||||||
|
if (containerView != null)
|
||||||
|
{
|
||||||
|
containerView.Hidden = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var vm = new AccountSwitchingOverlayViewModel(_stateService, _messagingService, _logger)
|
var vm = new AccountSwitchingOverlayViewModel(_stateService, _messagingService, _logger)
|
||||||
|
@ -40,6 +47,7 @@ namespace Bit.iOS.Core.Utilities
|
||||||
FromIOSExtension = true
|
FromIOSExtension = true
|
||||||
};
|
};
|
||||||
overlay.BindingContext = vm;
|
overlay.BindingContext = vm;
|
||||||
|
overlay.IsVisible = false;
|
||||||
|
|
||||||
var renderer = Platform.CreateRenderer(overlay.Content);
|
var renderer = Platform.CreateRenderer(overlay.Content);
|
||||||
renderer.SetElementSize(new Size(containerView.Frame.Size.Width, containerView.Frame.Size.Height));
|
renderer.SetElementSize(new Size(containerView.Frame.Size.Width, containerView.Frame.Size.Height));
|
||||||
|
@ -63,8 +71,13 @@ namespace Bit.iOS.Core.Utilities
|
||||||
public void OnToolbarItemActivated(AccountSwitchingOverlayView accountSwitchingOverlayView, UIView containerView)
|
public void OnToolbarItemActivated(AccountSwitchingOverlayView accountSwitchingOverlayView, UIView containerView)
|
||||||
{
|
{
|
||||||
var overlayVisible = accountSwitchingOverlayView.IsVisible;
|
var overlayVisible = accountSwitchingOverlayView.IsVisible;
|
||||||
|
if (!overlayVisible)
|
||||||
|
{
|
||||||
|
// So that the animation doesn't break we only care about showing it
|
||||||
|
// and the hiding if done through AccountSwitchingOverlayView -> AfterHide
|
||||||
|
containerView.Hidden = false;
|
||||||
|
}
|
||||||
accountSwitchingOverlayView.ToggleVisibililtyCommand.Execute(null);
|
accountSwitchingOverlayView.ToggleVisibililtyCommand.Execute(null);
|
||||||
containerView.Hidden = false;
|
|
||||||
containerView.UserInteractionEnabled = !overlayVisible;
|
containerView.UserInteractionEnabled = !overlayVisible;
|
||||||
containerView.Subviews[0].UserInteractionEnabled = !overlayVisible;
|
containerView.Subviews[0].UserInteractionEnabled = !overlayVisible;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue