partial void ChooseVideoTapped(UIBarButtonItem sender) { var videoPicker = new UIImagePickerController { ModalPresentationStyle = UIModalPresentationStyle.CurrentContext, SourceType = UIImagePickerControllerSourceType.SavedPhotosAlbum, MediaTypes = new string[] { UTType.Movie } }; videoPicker.FinishedPickingMedia += (object s, UIImagePickerMediaPickedEventArgs e) => { displayLink.Paused = true; playButton.Title = "Play"; popover.Dismiss(true); outputFrames.Clear(); presentationTimes.Clear(); lastCallbackTime = 0.0; var asset = AVAsset.FromUrl(e.MediaUrl); if (assetReader != null && assetReader.Status == AVAssetReaderStatus.Reading) { bufferSemaphore.Release(); assetReader.CancelReading(); } backgroundQueue.DispatchAsync(() => ReadSampleBuffers(asset)); }; videoPicker.Canceled += (object s, EventArgs e) => DismissViewController(true, null); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { popover = new UIPopoverController(videoPicker); popover.PresentFromBarButtonItem(sender, UIPopoverArrowDirection.Down, true); } }
private void HidePopover(String panel = "") { if (this.PopoverController != null) { this.PopoverController.Dismiss(true); } if (pageModeViewController != null) { pageModeViewController.Dismiss(true); pageModeViewController = null; } if (collectionViewController != null) { collectionViewController.Dismiss(true); collectionViewController = null; } if (contentSyncViewController != null) { contentSyncViewController.Dismiss(true); } if (penViewController != null) { penViewController.Dismiss(true); penViewController = null; } if (penViewController != null) { penViewController.Dismiss(true); penViewController = null; } if (collectionView != null) { HideCollectionViewWithAnimation(); } if (String.IsNullOrEmpty(panel)) { HidePrintPanel(); HideNotePanel(); } else { if (panel == StringRef.Note) { HidePrintPanel(); } else if (panel == StringRef.print) { HideNotePanel(); } } }
public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); if (popover != null && popover.PopoverVisible) { popover.Dismiss(false); } }
private void DismissOptionController() { if (Global.UserInterfaceIdiomIsPhone) { optionsController.DismissViewController(true, null); } else { optionsPopover.Dismiss(true); } }
// Flipside View Controller public void FlipsideViewControllerDidFinish(FlipsideViewController flipsideViewController) { if (UserInterfaceIdiomIsPhone) { DismissViewController(true, null); } else { FlipsidePopoverController.Dismiss(true); FlipsidePopoverController = null; } }
public override void WillAnimateRotation(UIInterfaceOrientation toInterfaceOrientation, double duration) { _masterViewController.WillAnimateRotation(toInterfaceOrientation, duration); _detailViewController.WillAnimateRotation(toInterfaceOrientation, duration); // Hide popover. if (_hiddenPopoverController != null && _hiddenPopoverController.PopoverVisible) { _hiddenPopoverController.Dismiss(false); } // Re-tile views. _reconfigurePopup = true; LayoutSubviews(toInterfaceOrientation, true); }
void HandleImagePickerControllerCanceled(object sender, EventArgs e) { UIApplication.SharedApplication.InvokeOnMainThread(delegate { SystemLogger.Log(SystemLogger.Module.PLATFORM, "Canceled picking image "); if (popover != null && popover.PopoverVisible) { popover.Dismiss(true); popover.Dispose(); } else { IPhoneServiceLocator.CurrentDelegate.MainUIViewController().DismissModalViewControllerAnimated(true); } }); }
partial void showInfo (NSObject sender) { if (UserInterfaceIdiomIsPhone) { var controller = new FlipsideViewController () { ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal, }; controller.Done += delegate { this.DismissModalViewControllerAnimated (true); }; this.PresentModalViewController (controller, true); } else { if (flipsidePopoverController == null) { var controller = new FlipsideViewController (); flipsidePopoverController = new UIPopoverController (controller); controller.Done += delegate { flipsidePopoverController.Dismiss (true); }; } if (flipsidePopoverController.PopoverVisible) { flipsidePopoverController.Dismiss (true); } else { flipsidePopoverController.PresentFromBarButtonItem ((UIBarButtonItem)sender, UIPopoverArrowDirection.Any, true); } } }
public void Update(int speakerID) //, UIViewController view) { speakerId = speakerID; speakerView.Update(speakerID); if (speakerId > 1) { var speaker = BL.Managers.SpeakerManager.GetSpeaker(speakerId); var sessions = BL.Managers.SessionManager.GetSessions(); if (sessions != null) { session = (from s in sessions where s.SpeakerNames.IndexOf(speaker.Name) >= 0 select s).FirstOrDefault(); } sessionView.Update(session); } speakerView.SetNeedsDisplay(); if (Popover != null) { Popover.Dismiss(true); } }
void DisplayMusicOptions() { if (UserInterfaceIdiomIsPhone) { flipsideViewController = new FlipsideViewController(this); flipsideViewController.Done += (button, even) => { DismissViewController(true, null); }; PresentViewController(flipsideViewController, true, null); } else { if (flipsidePopoverController == null) { var controller = new FlipsideViewController(this); flipsidePopoverController = new UIPopoverController(controller); flipsidePopoverController.PopoverContentSize = new SizeF(320f, 460f); controller.Done += delegate { flipsidePopoverController.Dismiss(true); }; } if (flipsidePopoverController.PopoverVisible) { flipsidePopoverController.Dismiss(true); } else { flipsidePopoverController.PresentFromRect(musicButton.Frame, View, UIPopoverArrowDirection.Any, true); } } }
void DisplaySettingsOptions() { if (UserInterfaceIdiomIsPhone) { aboutViewController = new AboutViewController(this); aboutViewController.Done += (button, even) => { DismissViewController(true, null); }; PresentViewController(aboutViewController, true, null); } else { if (aboutViewController == null) { var controller = new AboutViewController(this); aboutPopoverController = new UIPopoverController(controller); aboutPopoverController.PopoverContentSize = new SizeF(320f, 420f); controller.Done += delegate { aboutPopoverController.Dismiss(true); }; } if (aboutPopoverController.PopoverVisible) { aboutPopoverController.Dismiss(true); } else { aboutPopoverController.PresentFromRect(settingsButton.Frame, View, UIPopoverArrowDirection.Any, true); } } }
public void DismissMasterPopoverController() { if (masterPopoverController != null) { masterPopoverController.Dismiss(true); } }
public void ShowPopover(ListItemValue item, CGRect rect, UITableView tv) { if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { // UIViewController popoverViewController = new UIViewController(); // popoverViewController.View = new UITextView(new RectangleF(0, 0, 100, 50)) { // Text = item.Name // }; LabelledSections.PopoverPage popoverPage = new LabelledSections.PopoverPage(); popoverPage.PopLabel.Text = item.Name; popoverPage.PopButton.Text = item.Name + "Button"; UIViewController popoverViewController = popoverPage.CreateViewController(); popover = new UIPopoverController(popoverViewController); // popover.PopoverContentSize = new SizeF(100, 50); popover.DidDismiss += (object pSender, EventArgs e) => { popover.Dismiss(true); popover = null; }; popover.PresentFromRect(rect, tv, UIPopoverArrowDirection.Any, true); } }
void HandleImagePickerControllerCanceled(object sender, EventArgs e) { UIApplication.SharedApplication.InvokeOnMainThread(delegate { SystemLogger.Log(SystemLogger.Module.PLATFORM, "Canceled picking image "); IPhoneUtils.GetInstance().FireUnityJavascriptEvent("Appverse.Media.onFinishedPickingImage", null); if (popover != null && popover.PopoverVisible) { popover.Dismiss(true); popover.Dispose(); } else { IPhoneServiceLocator.CurrentDelegate.MainUIViewController().DismissModalViewController(true); } }); }
partial void showInfo(NSObject sender) { if (UserInterfaceIdiomIsPhone) { var controller = new FlipsideViewController() { ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal, }; controller.Done += delegate { this.DismissModalViewControllerAnimated(true); }; this.PresentModalViewController(controller, true); } else { if (flipsidePopoverController == null) { var controller = new FlipsideViewController(); flipsidePopoverController = new UIPopoverController(controller); controller.Done += delegate { flipsidePopoverController.Dismiss(true); }; } if (flipsidePopoverController.PopoverVisible) { flipsidePopoverController.Dismiss(true); } else { flipsidePopoverController.PresentFromBarButtonItem((UIBarButtonItem)sender, UIPopoverArrowDirection.Any, true); } } }
private void HidePopovers() { if (contentSyncViewController != null) { contentSyncViewController.Dismiss(true); } }
public void SelectSpeaker(int speakerID) { speakerId = speakerID; if (speakerId > 1) { sessionView.Update(speakerId, true); var session = BL.Managers.SessionManager.GetSession(speakerId); speakersInSession = session.Speakers; if (speakersInSession != null && speakersInSession.Count > 0) { speakerView.Update(speakersInSession[0].ID); } else // no speaker (!?) { speakerView.Clear(); } } else { sessionView.Clear(); speakerView.Clear(); } if (Popover != null) { Popover.Dismiss(true); } }
private void HideMenuPopover() { if (menuViewController != null) { menuViewController.Dismiss(true); menuViewController = null; } }
private void AddColorPickerControl() { _colorPickerViewController = new PopColorPickerViewController(); _colorPickerViewController.CancelButton.Clicked += (object sender, EventArgs e) => { if (!IsIpad()) { _colorPickerViewController.NavigationController.PopViewController(true); } else { _popoverController.Dismiss(true); } }; _colorPickerViewController.DoneButton.Clicked += (object sender, EventArgs e) => { if (!IsIpad()) { _colorPickerViewController.NavigationController.PopViewController(true); } else { _popoverController.Dismiss(true); } nfloat r, g, b, a; _colorPickerViewController.SelectedColor.GetRGBA(out r, out g, out b, out a); _richTextEditor.SetTextColor((int)(r * 255), (int)(g * 255), (int)(b * 255)); }; _richTextEditor.LaunchColorPicker = () => { if (!IsIpad()) { NavigationController.PushViewController(_colorPickerViewController, true); } else { var navController = new UINavigationController(_colorPickerViewController); _popoverController = new UIPopoverController(navController); _popoverController.PresentFromRect(_toolbarHolder.Frame, View, UIPopoverArrowDirection.Down, true); } }; }
void UpdatePickerFromModel(PickerSource s) { if (Element != null) { ((IElementController)Element).SetValueFromRenderer(Picker.SelectedIndexProperty, s.SelectedIndex); _popOver.Dismiss(true); } }
partial void TogglePopover(NSObject sender) { if (popoverController == null) { return; } popoverController.Dismiss(true); popoverController = null; }
public void Dismiss() { if (_device != UIUserInterfaceIdiom.Pad) { Assert.Inconclusive("Not running on iPad!"); return; } var popover = new UIPopoverController(_controller); popover.Dismiss(true); }
public void togglePopover(NSObject sender) { if (flipsidePopoverController != null) { flipsidePopoverController.Dismiss(true); flipsidePopoverController = null; } else { // TODO: iOS5 Segue support missing ? } }
public void Edit(Aircraft aircraft, bool exists) { if (masterPopoverController != null) { masterPopoverController.Dismiss(true); } editor = new EditAircraftDetailsViewController(aircraft, exists); editor.EditorClosed += OnEditorClosed; NavigationController.PushViewController(editor, true); }
public InvoiceLineCell() : base(Key) { AutoAddSubview(Description = new UILabel { Text = "Description", }, 4 ); AutoAddSubview(Price = new UILabel { Text = "Price", TextAlignment = UITextAlignment.Center }, 2); AutoAddSubview(Discount = new UIBorderedButton() { Title = "0", Tapped = (b) => { if (popup != null) { popup.Dispose(); } var d = new DiscountViewController(line.Price) { DollarChanged = (dollar) => { popup.Dismiss(true); Line.Discount = dollar; } }; popup = new UIPopoverController(d); popup.DidDismiss += (object sender, EventArgs e) => { line.Discount = 0; d.Dispose(); popup.Dispose(); popup = null; }; popup.PresentFromRect(Discount.Bounds, Discount, UIPopoverArrowDirection.Any, true); } }, 2); AutoAddSubview(TransTypeButton = new UIBorderedButton { Title = "S", TintColor = Color.LightBlue }); TransTypeButton.TouchUpInside += (sender, e) => { var sheet = new SimpleActionSheet(); var types = Database.Main.Table <TransactionType>().ToList(); types.ForEach(x => sheet.Add(x.Description, Color.LightBlue, () => Line.TransType = x)); sheet.ShowFrom(TransTypeButton.Bounds, TransTypeButton, true); }; AddSubview(Total = new UILabel { Text = "Total", TextAlignment = UITextAlignment.Center }, 9, columnspan: 2); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. _colorPickerViewController = new PopColorPickerViewController(); _colorPickerViewController.CancelButton.Clicked += (object sender, EventArgs e) => { if (UserInterfaceIdiomIsPhone) { DismissViewController(true, null); } else { _popoverController.Dismiss(true); } Console.WriteLine("Cancel Action 1"); }; _colorPickerViewController.DoneButton.Clicked += (object sender, EventArgs e) => { if (UserInterfaceIdiomIsPhone) { DismissViewController(true, null); } else { _popoverController.Dismiss(true); } this.View.BackgroundColor = _colorPickerViewController.SelectedColor; Console.WriteLine("Done Action 1"); }; button1.TouchUpInside += Button1_TouchUpInside; }
public void SetDetailItem(Dictionary <string, object> newDetailItem) { if (_detailItem != newDetailItem) { _detailItem = newDetailItem; ConfigureView(); } if (masterPopoverController != null) { masterPopoverController.Dismiss(true); } }
public class NativePopup : INativePopup { private UIPopoverController popoverController; public void NativeCenterPopup(View view, double width, double height) { var size = new CGRect(0, 0, width, height); var iOSView = ConvertFormsToNative(view, size); var viewController = new UIViewController(); viewController.Add(iOSView); viewController.View.Frame = size; popoverController = new UIPopoverController(viewController); popoverController.ContentViewController.View.BackgroundColor = viewController.View.BackgroundColor; popoverController.PopoverContentSize = size.Size; var frame = UIApplication.SharedApplication.KeyWindow.RootViewController.View; popoverController.PresentFromRect(frame.Frame, frame, 0, true); popoverController.ShouldDismiss += (popoverController) => { return(false); }; AppContext.AppContext.IsAlertOnDisplay = true; PopUpSample.PopupLayouts.DismissPopup = () => { if (popoverController.PopoverVisible) { AppContext.AppContext.IsAlertOnDisplay = false; } popoverController.Dismiss(true); }; }
public void TransitionTypePicked(int transitionType) { this.transitionType = transitionType; synchronizeWithEditor(); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { Popover.Dismiss(true); } else { DismissViewController(true, null); } }
public void SetDetailItem(object newDetailItem) { if (detailItem != newDetailItem) { detailItem = newDetailItem; // Update the view ConfigureView(); } if (masterPopoverController != null) { masterPopoverController.Dismiss(true); } }
internal void SetDetailItem(string newDetailItem) { if (DetailItem != newDetailItem) { DetailItem = newDetailItem; // Update the view. ConfigureView(); } if (popoverController != null) { popoverController.Dismiss(true); } }
void DisplaySettingsOptions() { if (UserInterfaceIdiomIsPhone) { aboutViewController = new AboutViewController (this); aboutViewController.Done += (button, even) => { DismissViewController (true, null); }; PresentViewController (aboutViewController, true, null); } else { if (aboutViewController == null) { var controller = new AboutViewController (this); aboutPopoverController = new UIPopoverController (controller); aboutPopoverController.PopoverContentSize = new SizeF (320f, 420f); controller.Done += delegate { aboutPopoverController.Dismiss (true); }; } if (aboutPopoverController.PopoverVisible) { aboutPopoverController.Dismiss (true); } else { aboutPopoverController.PresentFromRect (settingsButton.Frame, View, UIPopoverArrowDirection.Any, true); } } }
void DisplayMusicOptions() { if (UserInterfaceIdiomIsPhone) { flipsideViewController = new FlipsideViewController (this); flipsideViewController.Done += (button, even) => { DismissViewController (true, null); }; PresentViewController (flipsideViewController, true, null); } else { if (flipsidePopoverController == null) { var controller = new FlipsideViewController (this); flipsidePopoverController = new UIPopoverController (controller); flipsidePopoverController.PopoverContentSize = new SizeF (320f, 460f); controller.Done += delegate { flipsidePopoverController.Dismiss (true); }; } if (flipsidePopoverController.PopoverVisible) { flipsidePopoverController.Dismiss (true); } else { flipsidePopoverController.PresentFromRect (musicButton.Frame, View, UIPopoverArrowDirection.Any, true); } } }
private void ShowImagePickerView() { UIApplication.SharedApplication.InvokeOnMainThread (delegate { UIImagePickerController imagePickerController = new UIImagePickerController(); imagePickerController.FinishedPickingImage += HandleImagePickerControllerFinishedPickingImage; imagePickerController.FinishedPickingMedia += HandleImagePickerControllerFinishedPickingMedia; imagePickerController.Canceled += HandleImagePickerControllerCanceled; if(IPhoneUtils.GetInstance().IsIPad()) { try { // in iPad, the UIImagePickerController should be presented inside a UIPopoverController, otherwise and exception is raised popover = new UIPopoverController(imagePickerController); UIView view = IPhoneServiceLocator.CurrentDelegate.MainUIViewController ().View; //RectangleF frame = new RectangleF(new PointF(0,0),new SizeF(view.Frame.Size.Width, view.Frame.Size.Height)); RectangleF frame = new RectangleF(new PointF(0,0),new SizeF(0,0)); popover.PresentFromRect(frame, view, UIPopoverArrowDirection.Up, true); }catch(Exception ex) { INotification notificationService = (INotification)IPhoneServiceLocator.GetInstance ().GetService ("notify"); if (notificationService != null) { notificationService.StartNotifyAlert ("Media Alert", "Unable to reach Photo Library", "OK"); } if(popover != null && popover.PopoverVisible) { popover.Dismiss(true); popover.Dispose(); } } } else { IPhoneServiceLocator.CurrentDelegate.MainUIViewController ().PresentModalViewController (imagePickerController, true); } }); }
public InvoiceSideBar() { this.Layer.BorderColor = UIColor.Black.ColorWithAlpha (.25f).CGColor; this.Layer.BorderWidth = .5f; BackgroundColor = Theme.Current.SideBarBackGroundColor;//UIColor.DarkGray; AddSubview (tableView = new UITableView (RectangleF.Empty, UITableViewStyle.Grouped) { BackgroundColor = UIColor.Clear, Source = source = new CellTableViewSource { (customer = new CustomerPickerCell { Tapped = async () => { CustomerSearchViewController customerSearch; popover = new UIPopoverController (new UINavigationController (customerSearch = new CustomerSearchViewController { CustomerPicked = (c) => { Invoice.Customer = c; popover.Dismiss (true); popover.Dispose (); if(Invoice.Customer.IsNew) { // NewCustomerInfoViewController newCust; newCustPopover = new UIPopoverController(new UINavigationController(newCust = new NewCustomerInfoViewController())); newCust.Popover = newCustPopover; newCust.HowTheyHeard = (i) => { invoice.AddItem(i); newCustPopover.Dismiss(true); newCustPopover.Dispose(); }; newCustPopover.PresentFromRect (customer.Frame, tableView, UIPopoverArrowDirection.Right, true); // } } }) { NavigationBar = { BarStyle = UIBarStyle.BlackTranslucent, } }); customerSearch.Popover = popover; popover.PresentFromRect (customer.Frame, tableView, UIPopoverArrowDirection.Right, true); } }), (subtotal = new SubTotalCell ()), (discount = new DiscountCell { AddDiscount = () =>{ } }), (total = new TotalCell ()), new PayCell { Frame = new RectangleF(0,0,320,60), Text = "Checkout", TintColor = UIColor.White, Tapped = () => { Checkout (); } }, (lastPostedChange = new LastPostedCell () { }), (printLastInvoice = new PrintLastInvoiceCell{ Text = "Print last invoice", Tapped = ()=>{ WebService.Main.PrintInvoice(Settings.Shared.LastPostedInvoice); } }), }, ScrollEnabled = false, TableHeaderView = new UIView (new RectangleF (0, 0, 0, 64)), }); Binding.Create (() => lastPostedChange.DetailTextLabel.Text == Settings.Shared.LastPostedChangeString); customerInfo = new UITableViewCell[] { (email = new MiniCell { TextLabel = { Text = "Email" }, Tapped = ()=>{ showEditor(email); }, }), (phoneNumber = new MiniCell { TextLabel = { Text = "Phone" }, Tapped = ()=>{ showEditor(phoneNumber); }, }), (onAccount = new MiniCell { TextLabel = { Text = "On Account" }, Tapped = ()=>{ showEditor(onAccount); }, }), }; }
public void showImageAtIndexPath(NSObject sender, HomepwnerItemCell cell) { NSIndexPath indexPath = TableView.IndexPathForCell(cell); Console.WriteLine("Going to show the image for {0}", indexPath); // Get the item for the index path BNRItem i = BNRItemStore.allItems[indexPath.Row]; string imageKey = i.imageKey; // If there is no image, we don't need to do anything if (imageKey == null || imageKey == "") return; UIImage img = BNRImageStore.imageForKey(imageKey); // Create a new ImageViewController and set its image ImageViewController ivc = new ImageViewController(); ivc.Image = img; ivc.PopoverSize = new CGSize(600, 600); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { // Make a rectangle that the frame of the button relative to our table view UIButton btn = sender as UIButton; CGRect rect = View.ConvertRectFromView(btn.Bounds, btn); // Present a 600 x 600 popover from the rect imagePopover = new UIPopoverController(ivc); imagePopover.PopoverContentSize = ivc.PopoverSize; imagePopover.DidDismiss += (object pSender, EventArgs e) => { imagePopover.Dismiss(true); imagePopover = null; }; imagePopover.PresentFromRect(rect, View, UIPopoverArrowDirection.Any, true); } else { this.NavigationController.PushViewController(ivc, true); } }
public override void WillPresentViewController(UISplitViewController svc, UIPopoverController pc, UIViewController aViewController) { if (pc != null) pc.Dismiss(true); }