1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-14 23:33:34 +00:00

Added username/password copy options to extension when no password field is detected on the page details intitiated from.

This commit is contained in:
Kyle Spearrin
2016-07-28 19:12:51 -04:00
parent 9f54296ff0
commit bb4b732b76
3 changed files with 66 additions and 1 deletions

View File

@@ -35,5 +35,21 @@ namespace Bit.iOS.Core.Utilities
alert.AddAction(UIAlertAction.Create(accept, UIAlertActionStyle.Default, acceptHandle));
return alert;
}
public static UIAlertController CreateActionSheet(string title, UIViewController controller)
{
var sheet = UIAlertController.Create(title, null, UIAlertControllerStyle.ActionSheet);
if(UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
{
var x = controller.View.Bounds.Width / 2;
var y = controller.View.Bounds.Bottom;
var rect = new CGRect(x, y, 0, 0);
sheet.PopoverPresentationController.SourceView = controller.View;
sheet.PopoverPresentationController.SourceRect = rect;
sheet.PopoverPresentationController.PermittedArrowDirections = UIPopoverArrowDirection.Unknown;
}
return sheet;
}
}
}