public FullScreenVideoView() { TintColor = UIColor.White; Add(videoView = new VideoView { Tapped = Toggle }); Add(topToolbar = new UIToolbar { BackgroundColor = UIColor.Clear, Items = new UIBarButtonItem[] { new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), new UIBarButtonItem(UIBarButtonSystemItem.Done, (s, e) => { Parent.DismissViewControllerAsync(true); }), new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace) { Width = 10 }, } }); topToolbar.SetBackgroundImage(new UIImage(), UIToolbarPosition.Any, UIBarMetrics.Default); topToolbar.SetShadowImage(new UIImage(), UIToolbarPosition.Any); topToolbar.SizeToFit(); Add(playPauseButton = new SimpleButton { BackgroundColor = UIColor.Black.ColorWithAlpha(.5f), Frame = new CoreGraphics.CGRect(0, 0, 50, 50), Layer = { CornerRadius = 25, }, Tapped = (b) => PlaybackManager.Shared.PlayPause(), }); timeLabel = new UILabel { Text = "0000:00" }.StyleAsSubText(); timeLabel.TextColor = UIColor.White; timeLabel.SizeToFit(); timeRemaingLabel = new UILabel { Text = "0000:00", TextAlignment = UITextAlignment.Right }.StyleAsSubText(); timeRemaingLabel.TextColor = UIColor.White; timeRemaingLabel.SizeToFit(); slider = new ProgressView(); slider.EditingStarted = () => timer.Stop(); slider.EditingEnded = () => ResetTimer(); Add(bottomToolbar = new UIToolbar { BackgroundColor = UIColor.Clear, Items = new UIBarButtonItem[] { new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace) { Width = 10 }, new UIBarButtonItem(timeLabel), new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace) { Width = 5 }, new UIBarButtonItem(slider), new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace) { Width = 5 }, new UIBarButtonItem(timeRemaingLabel), new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace) { Width = 10 }, } }); bottomToolbar.SetBackgroundImage(new UIImage(), UIToolbarPosition.Any, UIBarMetrics.Default); bottomToolbar.SetShadowImage(new UIImage(), UIToolbarPosition.Any); bottomToolbar.SizeToFit(); timer = new Timer(5000); timer.Elapsed += Timer_Elapsed; }
public override void TappedAccessory(SimpleButton button) { PopupManager.Shared.Show(BindingContext, button); }