Exemple #1
0
        public BrowserToolbar(UITableViewController aTableViewController, ConfigController aConfigController, OptionEnum aOptionInsertMode)
        {
            iTableViewController = aTableViewController;
            iConfigController    = aConfigController;

            iButtonConfig           = new UIBarButtonItem(new UIImage("Settings.png"), UIBarButtonItemStyle.Bordered, null);
            iButtonConfig.TintColor = UIColor.White;
            //iButtonConfig.SetBackgroundImage(new UIImage("Button.png"), UIControlState.Normal, UIBarMetrics.Default);
            iButtonConfig.Width = 40.0f;

            iBadgeView                 = new BadgeView(new CGRect(40, 0, 14, 14));
            iBadgeView.Value           = 1;
            iBadgeView.Font            = iBadgeView.Font.WithSize(10);
            iBadgeView.BackgroundColor = UIColor.FromRGBA(0, 0, 0, 0);        // transparent
            iBadgeView.FillColor       = UIColor.FromRGB(15, 151, 179);       // #0F9783
            iBadgeView.StrokeColor     = UIColor.White;
            iBadgeView.TextColor       = UIColor.White;
            iBadgeView.Hidden          = NotificationView.Instance.Current == null || NotificationView.Instance.Current.HasBeenAcknowledged;
            NotificationView.Instance.EventCurrentChanged += (s, e) =>
            {
                iBadgeView.Hidden = NotificationView.Instance.Current == null || NotificationView.Instance.Current.HasBeenAcknowledged;
            };

            iButtonPlay           = new UIBarButtonItemPlay(aOptionInsertMode, UIBarButtonItemStyle.Bordered, null);
            iButtonPlay.TintColor = UIColor.White;
            //iButtonPlay.SetBackgroundImage(new UIImage("Button.png"), UIControlState.Normal, UIBarMetrics.Default);
            iButtonSpacer1        = new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace);
            iButtonSpacer1.Width  = 20.0f;
            iButtonEdit           = new UIBarButtonItem(UIBarButtonSystemItem.Edit);
            iButtonEdit.TintColor = UIColor.White;
            //iButtonEdit.SetBackgroundImage(new UIImage("Button.png"), UIControlState.Normal, UIBarMetrics.Default);
            iButtonDone           = new UIBarButtonItem(UIBarButtonSystemItem.Done);
            iButtonDone.TintColor = UIColor.White;
            //iButtonDone.SetBackgroundImage(new UIImage("Button.png"), UIControlState.Normal, UIBarMetrics.Default);
            iButtonSpacer2 = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
            //iButtonSpacer2.Width = 30.0f;

            iButtonConfig.Clicked    += ConfigClicked;
            iButtonEdit.Clicked      += EditClicked;
            iButtonDone.Clicked      += DoneClicked;
            iBadgeView.TouchUpInside += ConfigClicked;

            iTableViewController.SetToolbarItems(new UIBarButtonItem[] { iButtonConfig, iButtonPlay, iButtonSpacer1, iButtonSpacer2 }, false);
            iTableViewController.NavigationController.Toolbar.AddSubview(iBadgeView);
        }
Exemple #2
0
        public BrowserToolbar(UITableViewController aTableViewController, ConfigController aConfigController, OptionEnum aOptionInsertMode)
        {
            iTableViewController = aTableViewController;
            iConfigController    = aConfigController;

            iButtonConfig        = new UIBarButtonItem(new UIImage("Settings.png"), UIBarButtonItemStyle.Bordered, null);
            iButtonPlay          = new UIBarButtonItemPlay(aOptionInsertMode, UIBarButtonItemStyle.Bordered, null);
            iButtonSpacer1       = new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace);
            iButtonSpacer1.Width = 20.0f;
            iButtonEdit          = new UIBarButtonItem(UIBarButtonSystemItem.Edit);
            iButtonDone          = new UIBarButtonItem(UIBarButtonSystemItem.Done);
            iButtonSpacer2       = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
            //iButtonSpacer2.Width = 30.0f;

            iButtonConfig.Clicked += ConfigClicked;
            iButtonEdit.Clicked   += EditClicked;
            iButtonDone.Clicked   += DoneClicked;

            iTableViewController.SetToolbarItems(new UIBarButtonItem[] { iButtonConfig, iButtonPlay, iButtonSpacer1, iButtonSpacer2 }, false);
        }