Inheritance: UIElement
    public void LoadView()
    {
        mBox = new UIBox(UIConstants.BoxRect, UIConstants.MainBackground);

        mBackgroundTextureLabel = new UILabel(UIConstants.RectLabelOne, UIConstants.CloudRecognition);

        string [] extendedTrackingStyle = {UIConstants.ExtendedTrackingStyleOff, UIConstants.ExtendedTrackingStyleOn};
        mExtendedTracking = new UICheckButton(UIConstants.RectOptionOne, false, extendedTrackingStyle);

        string[] aboutStyles = { UIConstants.AboutLableStyle, UIConstants.AboutLableStyle };
        mAboutLabel = new UICheckButton(UIConstants.RectLabelAbout, false, aboutStyles);

        string[] cameraFlashStyles = {UIConstants.CameraFlashStyleOff, UIConstants.CameraFlashStyleOn};
        mCameraFlashSettings = new UICheckButton(UIConstants.RectOptionThree, false, cameraFlashStyles);

        string[] autofocusStyles = {UIConstants.AutoFocusStyleOff, UIConstants.AutoFocusStyleOn};
        mAutoFocusSetting = new UICheckButton(UIConstants.RectOptionTwo, false, autofocusStyles);

        mCameraLabel = new UILabel(UIConstants.RectLabelTwo, UIConstants.CameraLabelStyle);

        string[,] cameraFacingStyles = new string[2,2] {{UIConstants.CameraFacingFrontStyleOff, UIConstants.CameraFacingFrontStyleOn},{ UIConstants.CameraFacingRearStyleOff, UIConstants.CameraFacingRearStyleOn}};
        UIRect[] cameraRect = { UIConstants.RectOptionFour, UIConstants.RectOptionFive };
        mCameraFacing = new UIRadioButton(cameraRect, 1, cameraFacingStyles);

        string[] closeButtonStyles = {UIConstants.closeButtonStyleOff, UIConstants.closeButtonStyleOn };
        mCloseButton = new UIButton(UIConstants.CloseButtonRect, closeButtonStyles);
    }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.White;

            var gameNameLabel = new UILabel(new RectangleF(10, 80, View.Frame.Width - 20, 20));
            gameNameLabel.Text = "Spartakiade Quiz";

            View.AddSubview(gameNameLabel);

            var playname = new UITextView(new RectangleF(10, 110, View.Frame.Width - 20, 20));
            playname.BackgroundColor = UIColor.Brown;

            View.AddSubview(playname);

            var btnStartGame = new UIButton(new RectangleF(10, 140, View.Frame.Width - 20, 20));
            btnStartGame.SetTitle("Start game", UIControlState.Normal);
            btnStartGame.BackgroundColor = UIColor.Blue;
            btnStartGame.TouchUpInside += delegate
            {
                NavigationController.PushViewController(new PlayGameController(playname.Text), true);
            };

            View.AddSubview(btnStartGame);
        }
示例#3
1
        public override void ViewDidLoad()
        {
            View = new UIView(){ BackgroundColor = UIColor.White};
            base.ViewDidLoad();

            var label = new UILabel(new RectangleF(10, 10, 300, 40));
            Add(label);
            var textField = new UITextField(new RectangleF(10, 50, 300, 40));
            Add(textField);
            var button = new UIButton(UIButtonType.RoundedRect);
            button.SetTitle("Click Me", UIControlState.Normal);
            button.Frame = new RectangleF(10, 90, 300, 40);
            Add(button);
            var button2 = new UIButton(UIButtonType.RoundedRect);
            button2.SetTitle("Go Second", UIControlState.Normal);
            button2.Frame = new RectangleF(10, 130, 300, 40);
            Add(button2);

            var set = this.CreateBindingSet<FirstView, Core.ViewModels.FirstViewModel>();
            set.Bind(label).To(vm => vm.Hello);
            set.Bind(textField).To(vm => vm.Hello);
            set.Bind(button).To(vm => vm.MyCommand);
            set.Bind(button2).To(vm => vm.GoSecondCommand);
            set.Apply();
        }
        public override void ViewDidLoad()
        {
            View.BackgroundColor = UIColor.White;
            base.ViewDidLoad();

            var title = ViewModel.GetType().Name.Replace("ViewModel", string.Empty);
            Title = title;

            var explain = new UILabel(new RectangleF(10, 40, 300,  60))
                {
                    Text = ExplainText,
                    Lines = 0,
                };
            Add(explain);

            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
                EdgesForExtendedLayout = UIRectEdge.None;

            var nextButton = new UIButton(UIButtonType.RoundedRect);
            nextButton.Frame = new RectangleF(10,10,300,30);
            nextButton.SetTitle("Next test", UIControlState.Normal);
            Add(nextButton);

            var set = this.CreateBindingSet<TestViewController, TestViewModel>();
            set.Bind(nextButton).To(vm => vm.NextCommand);
            set.Apply();
        }
partial         void JoinButton_TouchUpInside(UIButton sender)
        {
            var clientId = this.HandleTextField.Text;
            var alertView = new UIAlertView(this.View.Bounds);
            alertView.Message = clientId;
            alertView.Show();
        }
示例#6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            _loadDataButton = UIButton.FromType(UIButtonType.RoundedRect);
            _loadDataButton.SetTitle("Hent sanntidsdata", UIControlState.Normal);
            _loadDataButton.Frame = new RectangleF(10, 10, View.Bounds.Width - 20, 50);

            _result = new UITextView(new RectangleF(10, 70, View.Bounds.Width - 20, View.Bounds.Height - 80));
            _result.Font = UIFont.FromName("Arial", 14);
            _result.Editable = false;

            _activityIndicator = new UIActivityIndicatorView(new RectangleF(View.Bounds.Width / 2 - 20, View.Bounds.Height / 2 - 20, 40, 40));
            _activityIndicator.AutoresizingMask = UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
            _activityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;

            View.AddSubview(_activityIndicator);
            View.AddSubview(_loadDataButton);
            View.AddSubview(_result);

            View.BackgroundColor = UIColor.DarkGray;

            _loadDataButton.TouchUpInside += delegate(object sender, EventArgs e) {
                if(_location != null)
                {
                    _activityIndicator.StartAnimating();
                    _result.Text = "Jobber..." + Environment.NewLine + Environment.NewLine;
                    var coordinate = new GeographicCoordinate(_location.Latitude, _location.Longtitude);
                    ThreadPool.QueueUserWorkItem(o => _sanntid.GetNearbyStops(coordinate, BusStopsLoaded));
                }
            };

            _gpsService.LocationChanged = location => _location = location;
            _gpsService.Start();
        }
示例#7
0
	/// <summary>
	/// Cache the transform.
	/// </summary>

	protected virtual void Start ()
	{
		mTrans = transform;
		mCollider = GetComponent<Collider>();
		mButton = GetComponent<UIButton>();
		mDragScrollView = GetComponent<UIDragScrollView>();
	}
示例#8
0
 partial void CheckButton_TouchUpInside(UIButton sender)
 {
     string title = MyClass.iOSInfo();
     int ii = MyClass.iOSInt();
     CheckButton.SetTitle(title, UIControlState.Normal);
     CheckButton.Enabled = true;
 }
 void ReleaseDesignerOutlets()
 {
     if (ProductGroupPickerButton != null) {
         ProductGroupPickerButton.Dispose ();
         ProductGroupPickerButton = null;
     }
 }
示例#10
0
		public void AddSiteUrl(RectangleF frame)
		{
			url = UIButton.FromType(UIButtonType.Custom);
			url.LineBreakMode = UILineBreakMode.TailTruncation;
			url.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
			url.TitleShadowOffset = new SizeF(0, 1);
			url.SetTitleColor(UIColor.FromRGB (0x32, 0x4f, 0x85), UIControlState.Normal);
			url.SetTitleColor(UIColor.Red, UIControlState.Highlighted);
			url.SetTitleShadowColor(UIColor.White, UIControlState.Normal);
			url.AddTarget(delegate { if (UrlTapped != null) UrlTapped (); }, UIControlEvent.TouchUpInside);
			
			// Autosize the bio URL to fit available space
			var size = _urlSize;
			var urlFont = UIFont.BoldSystemFontOfSize(size);
			var urlSize = new NSString(_bio.Url).StringSize(urlFont);
			var available = Util.IsPad() ? 400 : 185; // Util.IsRetina() ? 185 : 250;		
			while(urlSize.Width > available)
			{
				urlFont = UIFont.BoldSystemFontOfSize(size--);
				urlSize = new NSString(_bio.Url).StringSize(urlFont);
			}
			
			url.Font = urlFont;			
			url.Frame = new RectangleF ((float)_left, (float)70, (float)(frame.Width - _left), (float)size);
			url.SetTitle(_bio.Url, UIControlState.Normal);
			url.SetTitle(_bio.Url, UIControlState.Highlighted);			
			AddSubview(url);
		}
		protected async override void OnElementChanged (ElementChangedEventArgs<Button> e)
		{
			base.OnElementChanged (e);

			if (byPassButton == null) {
				byPassButton = new UIButton (UIButtonType.Custom);
				byPassButton.Frame = this.Frame;
				SetNativeControl (byPassButton);
				base.Control.TouchUpInside += byPassButton_TouchUpInside;

				SetField (this, "buttonTextColorDefaultNormal", base.Control.TitleColor (UIControlState.Normal));
				SetField (this, "buttonTextColorDefaultHighlighted", base.Control.TitleColor (UIControlState.Highlighted));
				SetField (this, "buttonTextColorDefaultDisabled", base.Control.TitleColor (UIControlState.Disabled));

				InvokeMethod (this, "UpdateText", null);
				InvokeMethod (this, "UpdateFont", null);
				InvokeMethod (this, "UpdateBorder", null);
				InvokeMethod (this, "UpdateImage", null);
				InvokeMethod (this, "UpdateTextColor", null);
			}

			if (e.NewElement != null) {
				Control.ShowsTouchWhenHighlighted = false;
				Control.AdjustsImageWhenHighlighted = false;
				await SetNormalImageResource ();
				await SetDisableImageResource ();
				await SetPressImageResource ();
			}
		}
示例#12
0
		const int buttonSpace = 45; //24;
		
		public SessionCell (UITableViewCellStyle style, NSString ident, Session showSession, string big, string small) : base (style, ident)
		{
			SelectionStyle = UITableViewCellSelectionStyle.Blue;
			
			titleLabel = new UILabel () {
				TextAlignment = UITextAlignment.Left,
				BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f)
			};
			speakerLabel = new UILabel () {
				TextAlignment = UITextAlignment.Left,
				Font = smallFont,
				TextColor = UIColor.DarkGray,
				BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f)
			};
			locationImageView = new UIImageView();
			locationImageView.Image = building;

			button = UIButton.FromType (UIButtonType.Custom);
			button.TouchDown += delegate {
				UpdateImage (ToggleFavorite ());
				if (AppDelegate.IsPad) {
					NSObject o = new NSObject();
					NSDictionary progInfo = NSDictionary.FromObjectAndKey(o, new NSString("FavUpdate"));

					NSNotificationCenter.DefaultCenter.PostNotificationName(
						"NotificationFavoriteUpdated", o, progInfo);
				}
			};
			UpdateCell (showSession, big, small);
			
			ContentView.Add (titleLabel);
			ContentView.Add (speakerLabel);
			ContentView.Add (button);
			ContentView.Add (locationImageView);
		}
示例#13
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();
            var cameraFound = false;

            if (UIImagePickerController.IsSourceTypeAvailable(UIImagePickerControllerSourceType.Camera))
            {
                cameraFound = true;

                var button = new UIButton(UIButtonType.Custom);
                button.Frame = new CoreGraphics.CGRect(Frame.Width - 44, 9, 28, 21);
                button.SetBackgroundImage(UIImage.FromFile("Barcode.png"), UIControlState.Normal);
                button.TouchUpInside += (sender, e) =>
                {
                    button.PulseToSize(0.7f, 0.3, false);
                    Clicked();
                };
                Subviews[0].AddSubview(button);
            }                      

            foreach(var view in Subviews[0].Subviews)
            {
                if (cameraFound && view.GetType() == typeof(UITextField))
                    view.Frame = new CoreGraphics.CGRect(6, 5, view.Frame.Width - 44, 30);

                var textfield = Subviews[0].Subviews[1] as UITextField;
                if (textfield != null)
                    textfield.Font = UIFont.FromName("Avenir-Book", 14);
            };

        }
		void ReleaseDesignerOutlets ()
		{
			if (Button != null) {
				Button.Dispose ();
				Button = null;
			}
		}
        public override void ViewDidLoad()
        {
            var mapView = new MKMapView();
            mapView.Delegate = new MyDelegate();
            View = mapView;

            base.ViewDidLoad();

            // ios7 layout
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
                EdgesForExtendedLayout = UIRectEdge.None;

            var secondViewModel = (SecondViewModel)ViewModel;
            var hanAnnotation = new ZombieAnnotation(secondViewModel.Han);

            mapView.AddAnnotation(hanAnnotation);

            mapView.SetRegion(MKCoordinateRegion.FromDistance(
                new CLLocationCoordinate2D(secondViewModel.Han.Location.Lat, secondViewModel.Han.Location.Lng),
                20000,
                20000), true);

            var button = new UIButton(UIButtonType.RoundedRect);
            button.Frame = new RectangleF(10, 10, 300, 40);
            button.SetTitle("move", UIControlState.Normal);
            Add(button);

            var set = this.CreateBindingSet<SecondView, Core.ViewModels.SecondViewModel>();
            set.Bind(hanAnnotation).For(a => a.Location).To(vm => vm.Han.Location);
            set.Bind(button).For("Title").To(vm => vm.Han.Location);
            set.Apply();
        }
		void ReleaseDesignerOutlets ()
		{
			if (CloseButton != null) {
				CloseButton.Dispose ();
				CloseButton = null;
			}
		}
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.Frame = UIScreen.MainScreen.Bounds;
            View.BackgroundColor = UIColor.White;
            View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;

            button = UIButton.FromType(UIButtonType.RoundedRect);

            button.Frame = new RectangleF(
                View.Frame.Width / 2 - buttonWidth / 2,
                View.Frame.Height / 2 - buttonHeight / 2,
                buttonWidth,
                buttonHeight);

            button.SetTitle("Click me", UIControlState.Normal);

            button.TouchUpInside += (object sender, EventArgs e) =>
            {
                button.SetTitle(String.Format("clicked {0} times", numClicks++), UIControlState.Normal);
            };

            button.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin |
                UIViewAutoresizing.FlexibleBottomMargin;

            View.AddSubview(button);
        }
示例#18
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            button1 = UIButton.FromType(UIButtonType.RoundedRect);
            button1.Frame = new RectangleF(50, 20, 200, 40);
            button1.SetTitle("#myButton1 .allButtons", UIControlState.Normal);
            PXEngine.SetStyleId(button1, "myButton1");
            PXEngine.SetStyleClass(button1, "allButtons");

            button2 = UIButton.FromType(UIButtonType.RoundedRect);
            button2.Frame = new RectangleF(50, 70, 200, 40);
            button2.SetTitle("#myButton2 .allButtons", UIControlState.Normal);
            PXEngine.SetStyleId(button2, "myButton2");
            PXEngine.SetStyleClass(button2, "allButtons");

            button3 = UIButton.FromType(UIButtonType.RoundedRect);
            button3.Frame = new RectangleF(50, 120, 200, 40);
            button3.SetTitle("#myButton3 .allButtons", UIControlState.Normal);
            PXEngine.SetStyleId(button3, "myButton3");
            PXEngine.SetStyleClass(button1, "allButtons");

            PXEngine.SetStyleCSS(button3, "background-color: green; border-radius: 5;");

            this.View.AddSubview(button1);
            this.View.AddSubview(button2);
            this.View.AddSubview(button3);
        }
		partial void StartAccelerometerClick (UIButton sender)
		{
			if (client != null && client.IsDeviceConnected) {
				// create the sensor once
				if (accelerometer == null) {
					accelerometer = client.SensorManager.CreateAccelerometerSensor ();
					accelerometer.ReadingChanged += (_, e) => {
						var data = e.SensorReading;
						AccelerometerDataText.Text = string.Format ("Accel Data: X={0:+0.00} Y={0:+0.00} Z={0:+0.00}", data.X, data.Y, data.Z);
					};
				}
				if (sensorStarted) {
					Output ("Stopping Accelerometer updates...");
					try {
						accelerometer.StopReadings ();
						sensorStarted = false;
					} catch (BandException ex) {
						Output ("Error: " + ex.Message);
					}
				} else {
					Output ("Starting Accelerometer updates...");
					try {
						accelerometer.StartReadings ();
						sensorStarted = true;
					} catch (BandException ex) {
						Output ("Error: " + ex.Message);
					}
				}
			} else {
				Output ("Band is not connected. Please wait....");
			}
		}
示例#20
0
        protected override StandardContentCell CreateCell(UITableView tableView)
        {
            var cell = new StandardContentCell(UITableViewCellStyle.Default, Type);
            cell.SelectionStyle = UITableViewCellSelectionStyle.None;

            button = UIButton.FromType (UIButtonType.Custom);

            button.SetTitle (Text, UIControlState.Normal);
            button.Font = UIFont.BoldSystemFontOfSize (16);
            button.BackgroundColor = BackgroundColor;
            button.TitleEdgeInsets = new UIEdgeInsets(0, 6, 0, 6);
            button.Layer.CornerRadius = 7.0f;
            button.SetTitleColor(TextColor, UIControlState.Normal);
            button.SizeToFit ();
            button.TouchUpInside += delegate {
                RowSelectedImpl (tableView);
            };

            if (Disable) {
                button.UserInteractionEnabled = false;
                button.Enabled = false;
                button.TitleLabel.Enabled = false;
            }

            float left = (tableView.Frame.Width - button.Frame.Width ) / 2 - 12;
            button.Frame = new RectangleF(left, 4, button.Frame.Width + 12, 36);

            cell.ContentView.Add (button);

            return cell;
        }
		protected override void OnElementChanged (ElementChangedEventArgs<View> e)
		{
			base.OnElementChanged (e);

			//Get the video
			//bubble up to the AVPlayerLayer
			var url = new NSUrl ("http://www.androidbegin.com/tutorial/AndroidCommercial.3gp");
			_asset = AVAsset.FromUrl (url);

			_playerItem = new AVPlayerItem (_asset);

			_player = new AVPlayer (_playerItem);

			_playerLayer = AVPlayerLayer.FromPlayer (_player);

			//Create the play button
			playButton = new UIButton ();
			playButton.SetTitle ("Play Video", UIControlState.Normal);
			playButton.BackgroundColor = UIColor.Gray;

			//Set the trigger on the play button to play the video
			playButton.TouchUpInside += (object sender, EventArgs arg) => {
				_player.Play();
			};
		}
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
                EdgesForExtendedLayout = UIRectEdge.None;

            var source = new MvxStandardTableViewSource(TableView, UITableViewCellStyle.Subtitle, new NSString("sub"), "TitleText PriceText;ImageUrl ImageUri;DetailText DetailsText", UITableViewCellAccessory.DisclosureIndicator);
            TableView.Source = source;

            var set = this.CreateBindingSet<SearchResultsView, SearchResultsViewModel>();
            set.Bind(source).To(vm => vm.Properties);
            set.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.PropertiesSelectedCommand);
            set.Bind(this).For(s => s.Title).To(vm => vm.Title);
            var myFooter = new UIView(new RectangleF(0, 0, 320, 40));

            UIButton loadMoreButton = new UIButton(new RectangleF(0, 0, 320, 40));
            loadMoreButton.SetTitle("Load More", UIControlState.Normal);
            loadMoreButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            set.Bind(loadMoreButton).To(vm => vm.LoadMoreCommand);
            set.Bind(loadMoreButton).For("Title").To(vm => vm.Title);

            myFooter.Add(loadMoreButton);

            TableView.TableFooterView = myFooter;

            set.Apply();

            TableView.ReloadData();
            ViewModel.WeakSubscribe(PropertyChanged);

            NavigationItem.BackBarButtonItem = new UIBarButtonItem("Results",
                         UIBarButtonItemStyle.Bordered, BackButtonEventHandler);
        }
		async partial void ConnectToBandClick (UIButton sender)
		{
			if (client == null) {
				// get the client
				client = manager.AttachedClients.FirstOrDefault ();

				if (client == null) {
					Output ("Failed! No Bands attached.");
				} else {

					// attach event handlers
					client.ButtonPressed += (_, e) => {
						Output (string.Format ("Button {0} Pressed: {1}", e.TileButtonEvent.ElementId, e.TileButtonEvent.TileName));
					};
					client.TileOpened += (_, e) => {
						Output (string.Format ("Tile Opened: {0}", e.TileEvent.TileName));
					};
					client.TileClosed += (_, e) => {
						Output (string.Format ("Tile Closed: {0}", e.TileEvent.TileName));
					};

					try {
						Output ("Please wait. Connecting to Band...");
						await manager.ConnectTaskAsync (client);
					} catch (BandException ex) {
						Output ("Failed to connect to Band:");
						Output (ex.Message);
					}
				}
			} else {
				Output ("Please wait. Disconnecting from Band...");
				await manager.DisconnectTaskAsync (client);
				client = null;
			}
		}
示例#24
0
        public override void ViewDidLoad()
        {
            View.BackgroundColor = UIColor.White;
            base.ViewDidLoad();

            var button = new UIButton(UIButtonType.RoundedRect);
            button.SetTitle("Search", UIControlState.Normal);
            Add(button);

            var text = new UITextField() { BorderStyle = UITextBorderStyle.RoundedRect };
            Add(text);

            View.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            var set = this.CreateBindingSet<SearchView, SearchViewModel>();
            set.Bind(button).To("Search");
            set.Bind(text).To(vm => vm.SearchText);
            set.Apply();

            var hPadding = 10;
            var vPadding = 10;
            var ButtonWidth = 100;

            View.AddConstraints(

                    button.AtTopOf(View).Plus(vPadding),
                    button.AtRightOf(View).Minus(hPadding),
                    button.Width().EqualTo(ButtonWidth),

                    text.AtLeftOf(View, hPadding),
                    text.ToLeftOf(button, hPadding),
                    text.WithSameTop(button)

                );
        }
示例#25
0
        public TabControlItem(CGRect frame, string title)
        {
            this.Frame = frame;
            var parentFrame = frame;
            var labelFont = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? UIFont.BoldSystemFontOfSize(15) : UIFont.BoldSystemFontOfSize(10);

            this.labelTitle = new UILabel(new CGRect(0, 0, parentFrame.Width / 2, parentFrame.Height))
            {
                Text = title,
                TextAlignment = UITextAlignment.Center,
                AdjustsFontSizeToFitWidth = true,
                LineBreakMode = UILineBreakMode.TailTruncation,
                Lines = 2,
                Font = labelFont
            };

            this.button = new UIButton(new CGRect(0, 0, parentFrame.Width, parentFrame.Height));
            this.viewColor = new UIView(new CGRect(0, parentFrame.Height - 1, parentFrame.Width, 1));

            this.Add(this.labelTitle);
            this.Add(this.button);
            this.Add(this.viewColor);

            this.button.TouchUpInside += (s, e) =>
            {
                if (tabEnabled)
                {
                    SelectTab();
                }
            };
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            normalButton = GetButton (new CGRect (10, 120, 295, 48),
                                      FoodyTheme.SharedTheme.ButtonImage,
                                      "Standard Button");
            View.AddSubview (normalButton);

            pressedButton = GetButton (new CGRect (10, 190, 295, 48),
                                       FoodyTheme.SharedTheme.PressedButtonImage,
                                       "Button Pressed");
            View.AddSubview (pressedButton);

            label = new UILabel (new CGRect (15, 40, 400, 30));
            FoodyTheme.Apply (label);
            label.Text = "Label";
            View.AddSubview (label);

            var paddingView = new UIView (new CGRect (0, 0, 5, 20));
            TextField.LeftView = paddingView;
            TextField.LeftViewMode = UITextFieldViewMode.Always;
            TextField.ShouldReturn = TextFieldShouldReturn;
            TextField.Background = FoodyTheme.SharedTheme.TextFieldBackground;

            progress = new UIProgressView (new CGRect (13, 300, 292, 10));
            progress.Progress = 0.5f;
            View.AddSubview (progress);

            slider = new UISlider (new CGRect (10, 330, 298, 10));
            slider.Value = 0.5f;
            slider.ValueChanged += HandleValueChanged;
            View.AddSubview (slider);

            FoodyTheme.Apply (View);
        }
 void ReleaseDesignerOutlets()
 {
     if (ChannelButton != null) {
         ChannelButton.Dispose ();
         ChannelButton = null;
     }
 }
        public Task SaveAndLaunchFile(Stream stream, string fileType)
        {
            if (OriginView == null) return Task.FromResult(true);

            var data = NSData.FromStream(stream);
            var width = 824;
            var height = 668;

            var popoverView = new UIView(new RectangleF(0, 0, width, height));
            popoverView.BackgroundColor = UIColor.White;
            var webView = new UIWebView();
            webView.Frame = new RectangleF(0, 45, width, height - 45);

            var b = new UIButton(UIButtonType.RoundedRect);
            b.SetTitle("Done", UIControlState.Normal);
            b.Frame = new RectangleF(10,10, 60, 25);
            b.TouchUpInside += (o, e) => _popoverController.Dismiss(true);

            popoverView.AddSubview(b);
            popoverView.AddSubview(webView);

            var bundlePath = NSBundle.MainBundle.BundlePath;
            System.Diagnostics.Debug.WriteLine(bundlePath);
            webView.LoadData(data, "application/pdf", "utf-8", NSUrl.FromString("http://google.com"));

            var popoverContent = new UIViewController();
            popoverContent.View = popoverView;

            _popoverController = new UIPopoverController(popoverContent);
            _popoverController.PopoverContentSize = new SizeF(width, height);
            _popoverController.PresentFromRect(new RectangleF(OriginView.Frame.Width/2, 50, 1, 1), OriginView, UIPopoverArrowDirection.Any, true);
            _popoverController.DidDismiss += (o, e) => _popoverController = null;

            return Task.FromResult(true);
        }
 void ReleaseDesignerOutlets()
 {
     if (shakeButton != null) {
         shakeButton.Dispose ();
         shakeButton = null;
     }
 }
		void ReleaseDesignerOutlets ()
		{
			if (nameField != null) {
				nameField.Dispose ();
				nameField = null;
			}

			if (pathField != null) {
				pathField.Dispose ();
				pathField = null;
			}

			if (textField != null) {
				textField.Dispose ();
				textField = null;
			}

			if (titleField != null) {
				titleField.Dispose ();
				titleField = null;
			}

			if (createButton != null) {
				createButton.Dispose ();
				createButton = null;
			}

			if (updateButton != null) {
				updateButton.Dispose ();
				updateButton = null;
			}
		}
示例#31
0
        public override void Start()
        {
            // Activates the dragging of the window
            AddUIComponent(typeof(UIDragHandle));

            backgroundSprite = "GenericPanel";
            name             = "MPJoinGamePanel";
            color            = new Color32(110, 110, 110, 255);

            // Grab the view for calculating width and height of game
            UIView view = UIView.GetAView();

            // Center this window in the game
            relativePosition = new Vector3(view.fixedWidth / 2.0f - 180.0f, view.fixedHeight / 2.0f - 250.0f);

            width  = 360;
            height = 560;

            // Title Label
            this.CreateTitleLabel("Connect to Server", new Vector2(80, -20));

            // IP Address Label
            this.CreateLabel("IP Address:", new Vector2(10, -70));

            // IP Address field
            _ipAddressField = this.CreateTextField("localhost", new Vector2(10, -100));

            // Port Label
            this.CreateLabel("Port:", new Vector2(10, -150));

            // Port field
            _portField = this.CreateTextField("4230", new Vector2(10, -180));
            _portField.numericalOnly = true;

            // Username label
            this.CreateLabel("Username:"******"", new Vector2(10, -260));
            _usernameField.width -= 40;
            if (PlatformService.active && PlatformService.personaName != null)
            {
                _usernameField.text = PlatformService.personaName;
            }

            // Add color picker to username field
            // TODO: Figure out why this is null on main menu
            _playerColorField = this.CreateColorField("Player Color", new Vector2(_usernameField.width + 15, -260));
            if (_playerColorField != null)
            {
                _playerColorField.eventSelectedColorChanged += (UIComponent component, Color value) =>
                {
                    this._usernameField.textColor = value;
                    playerColor = value;
                };
                _playerColorField.eventColorPickerOpen += (UIColorField colorField, UIColorPicker colorPicker, ref bool overridden) =>
                {
                    colorPicker.component.height += 30f;
                };
            }

            // Password label
            this.CreateLabel("Password:"******"Show Password", new Vector2(120, -310));

            // Password field
            _passwordField = this.CreateTextField("", new Vector2(10, -340));
            _passwordField.isPasswordField = true;

            // Connect to Server Button
            _connectButton             = this.CreateButton("Connect to Server", new Vector2(10, -420));
            _connectButton.eventClick += OnConnectButtonClick;

            // Close this dialog
            _closeButton             = this.CreateButton("Cancel", new Vector2(10, -490));
            _closeButton.eventClick += (component, param) =>
            {
                isVisible = false;
                RemoveUIComponent(this);
                MultiplayerManager.Instance.CurrentClient.StopMainMenuEventProcessor();
            };

            _connectionStatus = this.CreateLabel("Not Connected", new Vector2(10, -395));
            _connectionStatus.textAlignment = UIHorizontalAlignment.Center;
            _connectionStatus.textColor     = new Color32(255, 0, 0, 255);

            _passwordBox.eventClicked += (component, param) =>
            {
                _passwordField.isPasswordField = !_passwordBox.isChecked;
            };
        }
        // Overridden from UIViewController
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BringSubviewToFront(tableContent);
            View.BackgroundColor = UIColor.FromPatternImage(UIImage.FromBundle("CarbonBackground"));
            InitNavigationBar("ic_nav_workbench", false);
            backAction = () => {
                root.navigation.ToggleMenu();
            };
            AutomaticallyAdjustsScrollViewInsets = false;

            Title = Strings.Workbench.SELF.FromResources();

            ion = AppState.context;



            if (remoteMode)
            {
                workbench = new Workbench(ion);
                //workbench.storedWorkbench = ion.currentWorkbench;
                //ion.currentWorkbench = workbench;
            }
            else
            {
                var button = new UIButton(new CGRect(0, 0, 31, 30));
                button.TouchUpInside += (obj, args) => {
                    TakeScreenshot();
                };
                button.SetImage(UIImage.FromBundle("ic_camera"), UIControlState.Normal);

                recordButton = new UIButton(new CGRect(0, 0, 35, 35));
                recordButton.TouchUpInside += (sender, e) => {
                    RecordDevices();
                };
                recordButton.SetImage(UIImage.FromBundle("ic_record"), UIControlState.Normal);

                var barButton  = new UIBarButtonItem(button);
                var barButton2 = new UIBarButtonItem(recordButton);

                NavigationItem.RightBarButtonItems = new UIBarButtonItem[] { barButton, barButton2 };
                workbench = ion.currentWorkbench;
            }

            tableContent.AllowsSelection = true;
            tableContent.ContentInset    = new UIEdgeInsets(0, 0, 0, 0);

            //source = new RemoteWorkbenchTableSource(this, ion, tableContent);
            //source.SetWorkbench(workbench);
            //source.onAddClicked = OnRequestViewer;

            //tableContent.Source = source;

            //AppState.context.onWorkbenchChanged += this.OnWorkbenchChanged;
            //if(ion.currentWorkbench == null){
            //	Console.WriteLine("workbench for ion isn't created for some reason");
            //}
            //ion.currentWorkbench.onWorkbenchEvent += OnWorkbenchEvent;
            AppState.context.onWorkbenchChanged += this.OnWorkbenchChanged;
            if (workbench == null)
            {
                Console.WriteLine("workbench for ion isn't created for some reason");
            }
            workbench.onWorkbenchEvent += OnWorkbenchEvent;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.BackgroundColor = UIColor.Black;

            UILabel title = new UILabel(new CGRect(
                                            (View.Frame.Width / 2) - 160,
                                            25,
                                            320,
                                            30)
                                        );

            title.TextAlignment = UITextAlignment.Center;
            title.TextColor     = UIColor.FromRGB(191, 222, 227);
            title.Text          = "Instructions";
            title.Font          = UIFont.FromName("Orange Kid", 40f);

            UITextView body = new UITextView(new CGRect(
                                                 50,
                                                 120,
                                                 View.Frame.Width - 100,
                                                 View.Frame.Height - 240)
                                             );

            body.BackgroundColor   = UIColor.Black;
            body.TextColor         = UIColor.FromRGB(191, 222, 227);
            body.Font              = UIFont.SystemFontOfSize(24.0f);
            body.TextAlignment     = UITextAlignment.Center;
            body.Editable          = false;
            body.Layer.BorderWidth = 5f;
            body.Layer.BorderColor = new CGColor(191, 222, 227);
            body.Font              = UIFont.FromName("Orange Kid", 28f);
            body.Text              = " \n" +
                                     "- Start off by selecting a function block from your left" +
                                     " then to keep adding blocks just select the place to" +
                                     " add the new block and then what type of block you want to add" +
                                     " \n\n\n - If you want to remove a block just press on the" +
                                     " cross of which block you want to delete \n\n\n - " +
                                     " Once you're satisfied with your code your compile and run it," +
                                     " to do that, just click on the play button\n\n\n - The space" +
                                     " below your canvas is the Console, the place where you" +
                                     " see the output or errors, if any, of your program \n\n\n" +
                                     " - There are specific places to declare your variables," +
                                     " it can be either at the very top of the entire canvas, or" +
                                     " at the top of every function you create \n\n\n - To" +
                                     " get information and an explanation of each block, just " +
                                     " pressed for a couple of seconds the block you're " +
                                     " interested in, then the option of more info will " +
                                     " appear, click on it and you'll get more information about that" +
                                     " block and it's functionality \n\n\n" +
                                     " - The last function you create has to be the Main";

            UIButton menuButton = ViewConstructorHelper.LoadMenuButton();

            menuButton.TouchUpInside += (sender, e) => {
                SidebarController.ToggleMenu();
            };

            View.Add(title);
            View.Add(body);
            View.Add(menuButton);
        }
示例#34
0
        public void RenderMenu()
        {
            for (int i = 0; i < m_PieButtons.Count; i++) //remove previous buttons
            {
                this.Remove(m_PieButtons[i]);
            }
            m_PieButtons.Clear();

            var elems = m_CurrentItem.Children;
            int dirConfig;

            if (elems.Count > 4)
            {
                dirConfig = 8;
            }
            else if (elems.Count > 2)
            {
                dirConfig = 4;
            }
            else
            {
                dirConfig = 2;
            }

            for (int i = 0; i < dirConfig; i++)
            {
                if (i >= elems.Count)
                {
                    break;
                }
                var elem = elems.ElementAt(i);
                var but  = new UIButton()
                {
                    Caption      = elem.Value.Name + ((elem.Value.Category)?"...":""),
                    CaptionStyle = ButtonStyle,
                    ImageStates  = 1,
                    Texture      = TextureGenerator.GetPieButtonImg(GameFacade.GraphicsDevice)
                };

                double dir = (((double)i) / dirConfig) * Math.PI * 2;
                but.AutoMargins = 4;

                if (i == 0)   //top
                {
                    but.X = (float)(Math.Sin(dir) * 60 - but.Width / 2);
                    but.Y = (float)((Math.Cos(dir) * -60) - but.Size.Y);
                }
                else if (i == dirConfig / 2)   //bottom
                {
                    but.X = (float)(Math.Sin(dir) * 60 - but.Width / 2);
                    but.Y = (float)((Math.Cos(dir) * -60));
                }
                else if (i < dirConfig / 2) //on right side
                {
                    but.X = (float)(Math.Sin(dir) * 60);
                    but.Y = (float)((Math.Cos(dir) * -60) - but.Size.Y / 2);
                }
                else //on left side
                {
                    but.X = (float)(Math.Sin(dir) * 60 - but.Width);
                    but.Y = (float)((Math.Cos(dir) * -60) - but.Size.Y / 2);
                }

                this.Add(but);
                m_PieButtons.Add(but);
                but.OnButtonClick += new ButtonClickDelegate(PieButtonClick);
                but.OnButtonHover += new ButtonClickDelegate(PieButtonHover);
            }

            bool top = true;

            for (int i = 8; i < elems.Count; i++)
            {
                var elem = elems.ElementAt(i);
                var but  = new UIButton()
                {
                    Caption      = elem.Value.Name + ((elem.Value.Category)?"...":""),
                    CaptionStyle = ButtonStyle,
                    ImageStates  = 1,
                    Texture      = TextureGenerator.GetPieButtonImg(GameFacade.GraphicsDevice)
                };
                but.AutoMargins = 4;

                but.X = (float)(-but.Width / 2);
                if (top)
                { //top
                    but.Y = (float)(-60 - but.Size.Y * ((i - 8) / 2 + 2));
                }
                else
                {
                    but.Y = (float)(60 + but.Size.Y * ((i - 8) / 2 + 1));
                }

                this.Add(but);
                m_PieButtons.Add(but);
                but.OnButtonClick += new ButtonClickDelegate(PieButtonClick);

                top = !top;
            }

            if (m_CurrentItem.Parent != null)
            {
                var but = new UIButton()
                {
                    Caption      = m_CurrentItem.Name,
                    CaptionStyle = ButtonStyle.Clone(),
                    ImageStates  = 1,
                    Texture      = TextureGenerator.GetPieButtonImg(GameFacade.GraphicsDevice)
                };

                but.CaptionStyle.Color = but.CaptionStyle.SelectedColor;
                but.AutoMargins        = 4;
                but.X = (float)(-but.Width / 2);
                but.Y = (float)(-but.Size.Y / 2);
                this.Add(but);
                m_PieButtons.Add(but);
                but.OnButtonClick += new ButtonClickDelegate(BackButtonPress);
            }
        }
示例#35
0
 partial void btnC(UIButton sender)
 {
     EventosComentariosDelegate.ComentarPost(PostLocal);
 }
示例#36
0
 public HelloWorld()
 {
     label  = new UILabel();
     button = new UIButton(UIButtonType.System);
     button.TouchUpInside += OnButtonClicked;
 }
示例#37
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            updateProfilePictureObserver = NSNotificationCenter.DefaultCenter.AddObserver(new NSString("UpdateProfilePicture"), UpdateProfilePicture);
            updateUserNameObserver       = NSNotificationCenter.DefaultCenter.AddObserver(new NSString("UpdateUserName"), UpdateUserName);

            View.BackgroundColor = UIColor.FromRGB(33, 33, 33);

            var scrollView = new UIScrollView(new RectangleF(0, 0, (float)View.Frame.Width, (float)View.Frame.Height));

            profileImageView                     = new UIImageView(new RectangleF(85, 20, 90, 90));
            profileImageView.ContentMode         = UIViewContentMode.ScaleAspectFill;
            profileImageView.Image               = UIImage.FromBundle("Profile");
            profileImageView.Layer.CornerRadius  = (profileImageView.Frame.Width / 2);
            profileImageView.Layer.MasksToBounds = true;

            var tapGestureRecognizer = new UITapGestureRecognizer(this, new ObjCRuntime.Selector("TapProfilePictureSelector:"));

            profileImageView.AddGestureRecognizer(tapGestureRecognizer);
            profileImageView.UserInteractionEnabled = true;

            if (LoginController.userModel.profilePicturePath != null)
            {
                Utils.SetImageFromNSUrlSession(LoginController.userModel.profilePicturePath, profileImageView, this, PictureType.Profile);
            }

            var editProfileButtonImageView = new UIImageView(new RectangleF(220, 20, 24, 24));

            editProfileButtonImageView.ContentMode         = UIViewContentMode.ScaleAspectFill;
            editProfileButtonImageView.Image               = UIImage.FromBundle("EditMenu");
            editProfileButtonImageView.Layer.MasksToBounds = true;
            var tapGestureRecognizerEdit = new UITapGestureRecognizer(this, new ObjCRuntime.Selector("TapProfilePictureSelector:"));

            editProfileButtonImageView.AddGestureRecognizer(tapGestureRecognizerEdit);
            editProfileButtonImageView.UserInteractionEnabled = true;

            userName               = new UILabel(new RectangleF(20, 120, 220, 20));
            userName.Font          = UIFont.SystemFontOfSize(14.0f);
            userName.TextAlignment = UITextAlignment.Center;
            userName.TextColor     = UIColor.White;
            userName.Text          = LoginController.userModel.name;

            var dividerLineView = new UIView(new RectangleF(20, 145, 220, 0.5f));

            dividerLineView.BackgroundColor = UIColor.FromRGB(80, 80, 80);

            var pagesItems     = new MenuPagesModel().MenuItems;
            var pagesTableView = new UITableView(new RectangleF(20, 150, 220, (pagesItems.Count * 40) - 10));

            pagesTableView.ContentInset    = new UIEdgeInsets(0, 20, 0, 0);
            pagesTableView.BackgroundColor = UIColor.Clear;
            pagesTableView.ScrollEnabled   = false;
            new MenuTableViewController(pagesTableView, pagesItems, menuViewController);

            var dividerLineView2 = new UIView(new RectangleF(20, (float)pagesTableView.Frame.Y + (float)pagesTableView.Frame.Height + 15, 220, 0.5f));

            dividerLineView2.BackgroundColor = UIColor.FromRGB(80, 80, 80);

            var filterLabel = new UILabel(new RectangleF(20, (float)dividerLineView2.Frame.Y + 5, 220, 20));

            filterLabel.Font          = UIFont.BoldSystemFontOfSize(12.0f);
            filterLabel.TextAlignment = UITextAlignment.Left;
            filterLabel.TextColor     = UIColor.FromRGB(80, 80, 80);
            filterLabel.Text          = "Filter";

            var filterTipLabel = new UILabel(new RectangleF(20, (float)dividerLineView2.Frame.Y + 5, 220, 20));

            filterTipLabel.Font          = UIFont.BoldSystemFontOfSize(9.0f);
            filterTipLabel.TextAlignment = UITextAlignment.Right;
            filterTipLabel.TextColor     = UIColor.FromRGB(196, 155, 9);
            filterTipLabel.Text          = "You may select more than one";

            var filterItems     = new MenuFilterModel().MenuItems;
            var filterTableView = new UITableView(new RectangleF(26, (float)filterLabel.Frame.Y + 15, 214, filterItems.Count * 40));

            filterTableView.ContentInset    = new UIEdgeInsets(0, 14, 0, 0);
            filterTableView.SeparatorColor  = UIColor.FromRGB(80, 80, 80);
            filterTableView.BackgroundColor = UIColor.Clear;
            filterTableView.ScrollEnabled   = false;
            new MenuTableViewController(filterTableView, filterItems, menuViewController);

            var dividerLineView3 = new UIView(new RectangleF(20, (float)filterTableView.Frame.Y + (float)filterTableView.Frame.Height + 15, 220, 0.5f));

            dividerLineView3.BackgroundColor = UIColor.FromRGB(80, 80, 80);

            #region Hashtag Menu
            //var dividerLineView3 = new UIView(new RectangleF(20, (float)filterTableView.Frame.Y + (float)filterTableView.Frame.Height + 25, 220, 0.5f));
            //dividerLineView3.BackgroundColor = UIColor.Black;

            //var hashtagLabel = new UILabel(new RectangleF(20, (float)dividerLineView3.Frame.Y + 5, 220, 20));
            //hashtagLabel.Font = UIFont.BoldSystemFontOfSize(12.0f);
            //hashtagLabel.TextAlignment = UITextAlignment.Left;
            //hashtagLabel.TextColor = UIColor.Black;
            //hashtagLabel.Text = "Hashtag";

            //var hashtagText = new UITextField(new RectangleF(20, (float)hashtagLabel.Frame.Y + 30, 220, 40));
            //hashtagText.BorderStyle = UITextBorderStyle.Bezel;
            //hashtagText.Placeholder = "inserts tags to filter here";
            #endregion

            #region Logout Button
            var logoutModel = new MenuLogoutModel();

            var logoutButton = new UIButton(new RectangleF(0, (float)dividerLineView3.Frame.Y + 5, (float)View.Frame.Width, 40));
            //logoutButton.BackgroundColor = UIColor.FromRGB(50, 50, 50);
            logoutButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                CredentialsService.DeleteCredentials();
                LoginController.tokenModel = null;
                LoginController.userModel  = null;

                var loginController = menuViewController.Storyboard.InstantiateViewController("LoginNavController");
                if (loginController != null)
                {
                    menuViewController.PresentViewController(loginController, true, null);
                }
            };


            var logoutIcoImageView = new UIImageView();
            logoutIcoImageView.ContentMode         = UIViewContentMode.ScaleAspectFit;
            logoutIcoImageView.Layer.MasksToBounds = true;
            logoutIcoImageView.TranslatesAutoresizingMaskIntoConstraints = false;
            logoutIcoImageView.Image = UIImage.FromBundle(logoutModel.ImageName);

            var logoutTitleLabel = new UILabel();
            logoutTitleLabel.Font      = UIFont.SystemFontOfSize(14);
            logoutTitleLabel.Text      = logoutModel.Title;
            logoutTitleLabel.TextColor = UIColor.White;
            logoutTitleLabel.TranslatesAutoresizingMaskIntoConstraints = false;

            logoutButton.Add(logoutIcoImageView);
            logoutButton.Add(logoutTitleLabel);

            logoutButton.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:|-48-[v0(24)]-20-[v1]-8-|", new NSLayoutFormatOptions(), "v0", logoutIcoImageView, "v1", logoutTitleLabel));
            logoutButton.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|-8-[v0(24)]", new NSLayoutFormatOptions(), "v0", logoutIcoImageView));
            logoutButton.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|-10-[v0(24)]", new NSLayoutFormatOptions(), "v0", logoutTitleLabel));
            #endregion

            scrollView.AddSubview(profileImageView);
            scrollView.AddSubview(userName);
            scrollView.AddSubview(editProfileButtonImageView);
            scrollView.AddSubview(dividerLineView);
            scrollView.AddSubview(pagesTableView);
            scrollView.AddSubview(dividerLineView2);
            scrollView.AddSubview(filterLabel);
            scrollView.AddSubview(filterTipLabel);
            scrollView.AddSubview(filterTableView);
            scrollView.AddSubview(dividerLineView3);
            #region Hashtag Menu
            //scrollView.Add(dividerLineView3);
            //scrollView.Add(hashtagLabel);
            //scrollView.Add(hashtagText);
            #endregion
            scrollView.AddSubview(logoutButton);

            var scrollHeight = 20 + profileImageView.Frame.Height + 10 + userName.Frame.Height + 25 + dividerLineView.Frame.Height + 5 + pagesTableView.Frame.Height + 15 +
                               dividerLineView2.Frame.Height + 5 + filterLabel.Frame.Height + 10 + filterTableView.Frame.Height + 5 + dividerLineView3.Frame.Height + 5 +
                               logoutButton.Frame.Height + 40;

            if (scrollHeight > View.Frame.Height)
            {
                scrollView.ContentSize = new CGSize(View.Frame.Width, scrollHeight);
            }
            else
            {
                scrollView.ContentSize = new CGSize(View.Frame.Width, View.Frame.Height);
            }

            View.AddSubview(scrollView);
        }
 void SetButtons(UIButton button)
 {
     btnAthletes.SetTitleColor(UIColor.FromRGB(144, 144, 144), UIControlState.Normal);
     btnLinks.SetTitleColor(UIColor.FromRGB(144, 144, 144), UIControlState.Normal);
     button.SetTitleColor(UIColor.FromRGB(21, 21, 21), UIControlState.Normal);
 }
示例#39
0
        public UIButton ButtonForItemIndex(int index)
        {
            SIAlertItem item   = this._Items[index];
            UIButton    button = UIButton.FromType(UIButtonType.Custom);

            button.Tag = index;
            button.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
            button.TitleLabel.Font  = (item.Font != null && item.Font != this.ButtonFont) ? item.Font : this.ButtonFont;
            button.SetTitle(item.Title, UIControlState.Normal);
            UIImage normalImage      = null;
            UIImage highlightedImage = null;

            // both custom background images images must be present, otherwise we use the defaults
            if (item.BackgroundImageNormal == null || item.BackgroundImageHighlighted == null)
            {
                switch (item.Type)
                {
                case SIAlertViewButtonType.Cancel:
                    normalImage      = UIImage.FromBundle(@"Images/SIAlertView.bundle/button-cancel");
                    highlightedImage = UIImage.FromBundle(@"Images/SIAlertView.bundle/button-cancel-d");
                    button.SetTitleColor(UIColor.FromWhiteAlpha(0.3f, 1f), UIControlState.Normal);
                    button.SetTitleColor(UIColor.FromWhiteAlpha(0.3f, 1f), UIControlState.Highlighted);
                    break;

                case SIAlertViewButtonType.Destructive:
                    normalImage      = UIImage.FromBundle(@"Images/SIAlertView.bundle/button-destructive");
                    highlightedImage = UIImage.FromBundle(@"Images/SIAlertView.bundle/button-destructive-d");
                    button.SetTitleColor(UIColor.White, UIControlState.Normal);
                    button.SetTitleColor(UIColor.FromWhiteAlpha(1f, 0.8f), UIControlState.Highlighted);
                    break;

                case SIAlertViewButtonType.Default:
                default:
                    normalImage      = UIImage.FromBundle(@"Images/SIAlertView.bundle/button-default");
                    highlightedImage = UIImage.FromBundle(@"Images/SIAlertView.bundle/button-default-d");
                    button.SetTitleColor(UIColor.FromWhiteAlpha(0.4f, 1f), UIControlState.Normal);
                    button.SetTitleColor(UIColor.FromWhiteAlpha(0.4f, 0.8f), UIControlState.Highlighted);
                    break;
                }
            }
            else
            {
                normalImage      = item.BackgroundImageNormal;
                highlightedImage = item.BackgroundImageHighlighted;
            }

            // both images must be present, othrwise we'll fall back to the specified background color
            if (normalImage != null && highlightedImage != null)
            {
                float        hInset = (float)Math.Floor(normalImage.Size.Width / 2);
                float        vInset = (float)Math.Floor(normalImage.Size.Height / 2);
                UIEdgeInsets insets = new UIEdgeInsets(vInset, hInset, vInset, hInset);
                if (normalImage != null)
                {
                    normalImage = normalImage.CreateResizableImage(insets);
                    button.SetBackgroundImage(normalImage, UIControlState.Normal);
                }
                if (highlightedImage != null)
                {
                    highlightedImage = highlightedImage.CreateResizableImage(insets);
                    button.SetBackgroundImage(highlightedImage, UIControlState.Highlighted);
                }
            }
            else if (item.BackgroundColor != null)
            {
                button.BackgroundColor = item.BackgroundColor;
            }

            if (item.TextColorNormal != null)
            {
                button.SetTitleColor(item.TextColorNormal, UIControlState.Normal);
            }
            if (item.TextColorHIghlighted != null)
            {
                button.SetTitleColor(item.TextColorHIghlighted, UIControlState.Highlighted);
            }

            button.TouchUpInside += (o, s) => { ButtonAction(button); };

            return(button);
        }
示例#40
0
 partial void ReadMoreButton_TouchUpInside(UIButton sender) => ViewModel.OpenWebCommand.Execute(null);
示例#41
0
 //初始化控件变量
 protected override void InitControls()
 {
     fastComponent = GetComponent <FastComponent>();
     fastComponent.BuildFastComponents();
     m_btn_close = fastComponent.FastGetComponent <UIButton>("close");
     if (null == m_btn_close)
     {
         Engine.Utility.Log.Error("m_btn_close 为空,请检查prefab是否缺乏组件");
     }
     m_trans_left = fastComponent.FastGetComponent <Transform>("left");
     if (null == m_trans_left)
     {
         Engine.Utility.Log.Error("m_trans_left 为空,请检查prefab是否缺乏组件");
     }
     m_widget_BaseContent = fastComponent.FastGetComponent <UIWidget>("BaseContent");
     if (null == m_widget_BaseContent)
     {
         Engine.Utility.Log.Error("m_widget_BaseContent 为空,请检查prefab是否缺乏组件");
     }
     m_input_Level_Input = fastComponent.FastGetComponent <UIInput>("Level_Input");
     if (null == m_input_Level_Input)
     {
         Engine.Utility.Log.Error("m_input_Level_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Level_queding = fastComponent.FastGetComponent <UIButton>("Level_queding");
     if (null == m_btn_Level_queding)
     {
         Engine.Utility.Log.Error("m_btn_Level_queding 为空,请检查prefab是否缺乏组件");
     }
     m_input_Exp_Input = fastComponent.FastGetComponent <UIInput>("Exp_Input");
     if (null == m_input_Exp_Input)
     {
         Engine.Utility.Log.Error("m_input_Exp_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Exp_queding = fastComponent.FastGetComponent <UIButton>("Exp_queding");
     if (null == m_btn_Exp_queding)
     {
         Engine.Utility.Log.Error("m_btn_Exp_queding 为空,请检查prefab是否缺乏组件");
     }
     m_input_ItemID_Input = fastComponent.FastGetComponent <UIInput>("ItemID_Input");
     if (null == m_input_ItemID_Input)
     {
         Engine.Utility.Log.Error("m_input_ItemID_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_ItemNum_Input = fastComponent.FastGetComponent <UIInput>("ItemNum_Input");
     if (null == m_input_ItemNum_Input)
     {
         Engine.Utility.Log.Error("m_input_ItemNum_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Item_queding = fastComponent.FastGetComponent <UIButton>("Item_queding");
     if (null == m_btn_Item_queding)
     {
         Engine.Utility.Log.Error("m_btn_Item_queding 为空,请检查prefab是否缺乏组件");
     }
     m_sprite_MoneyType = fastComponent.FastGetComponent <UISprite>("MoneyType");
     if (null == m_sprite_MoneyType)
     {
         Engine.Utility.Log.Error("m_sprite_MoneyType 为空,请检查prefab是否缺乏组件");
     }
     m_input_GoldNum_Input = fastComponent.FastGetComponent <UIInput>("GoldNum_Input");
     if (null == m_input_GoldNum_Input)
     {
         Engine.Utility.Log.Error("m_input_GoldNum_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Gold_queidng = fastComponent.FastGetComponent <UIButton>("Gold_queidng");
     if (null == m_btn_Gold_queidng)
     {
         Engine.Utility.Log.Error("m_btn_Gold_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_input_SkillID_Input = fastComponent.FastGetComponent <UIInput>("SkillID_Input");
     if (null == m_input_SkillID_Input)
     {
         Engine.Utility.Log.Error("m_input_SkillID_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_SkillNum_Input = fastComponent.FastGetComponent <UIInput>("SkillNum_Input");
     if (null == m_input_SkillNum_Input)
     {
         Engine.Utility.Log.Error("m_input_SkillNum_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Skill_queidng = fastComponent.FastGetComponent <UIButton>("Skill_queidng");
     if (null == m_btn_Skill_queidng)
     {
         Engine.Utility.Log.Error("m_btn_Skill_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_input_ProID_Input = fastComponent.FastGetComponent <UIInput>("ProID_Input");
     if (null == m_input_ProID_Input)
     {
         Engine.Utility.Log.Error("m_input_ProID_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_ProNum_Input = fastComponent.FastGetComponent <UIInput>("ProNum_Input");
     if (null == m_input_ProNum_Input)
     {
         Engine.Utility.Log.Error("m_input_ProNum_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Pro_queidng = fastComponent.FastGetComponent <UIButton>("Pro_queidng");
     if (null == m_btn_Pro_queidng)
     {
         Engine.Utility.Log.Error("m_btn_Pro_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_btn_btn_ClearBag = fastComponent.FastGetComponent <UIButton>("btn_ClearBag");
     if (null == m_btn_btn_ClearBag)
     {
         Engine.Utility.Log.Error("m_btn_btn_ClearBag 为空,请检查prefab是否缺乏组件");
     }
     m_input_PKNum_Input = fastComponent.FastGetComponent <UIInput>("PKNum_Input");
     if (null == m_input_PKNum_Input)
     {
         Engine.Utility.Log.Error("m_input_PKNum_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_PKNum_queding = fastComponent.FastGetComponent <UIButton>("PKNum_queding");
     if (null == m_btn_PKNum_queding)
     {
         Engine.Utility.Log.Error("m_btn_PKNum_queding 为空,请检查prefab是否缺乏组件");
     }
     m_btn_JuQing = fastComponent.FastGetComponent <UIButton>("JuQing");
     if (null == m_btn_JuQing)
     {
         Engine.Utility.Log.Error("m_btn_JuQing 为空,请检查prefab是否缺乏组件");
     }
     m_btn_sanshiji = fastComponent.FastGetComponent <UIButton>("sanshiji");
     if (null == m_btn_sanshiji)
     {
         Engine.Utility.Log.Error("m_btn_sanshiji 为空,请检查prefab是否缺乏组件");
     }
     m_btn_yibaiji = fastComponent.FastGetComponent <UIButton>("yibaiji");
     if (null == m_btn_yibaiji)
     {
         Engine.Utility.Log.Error("m_btn_yibaiji 为空,请检查prefab是否缺乏组件");
     }
     m_btn_dafuweng = fastComponent.FastGetComponent <UIButton>("dafuweng");
     if (null == m_btn_dafuweng)
     {
         Engine.Utility.Log.Error("m_btn_dafuweng 为空,请检查prefab是否缺乏组件");
     }
     m_btn_LowMemory = fastComponent.FastGetComponent <UIButton>("LowMemory");
     if (null == m_btn_LowMemory)
     {
         Engine.Utility.Log.Error("m_btn_LowMemory 为空,请检查prefab是否缺乏组件");
     }
     m_widget_MissionContent = fastComponent.FastGetComponent <UIWidget>("MissionContent");
     if (null == m_widget_MissionContent)
     {
         Engine.Utility.Log.Error("m_widget_MissionContent 为空,请检查prefab是否缺乏组件");
     }
     m_input_AcessMission_Input = fastComponent.FastGetComponent <UIInput>("AcessMission_Input");
     if (null == m_input_AcessMission_Input)
     {
         Engine.Utility.Log.Error("m_input_AcessMission_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_AcessMission_queidng = fastComponent.FastGetComponent <UIButton>("AcessMission_queidng");
     if (null == m_btn_AcessMission_queidng)
     {
         Engine.Utility.Log.Error("m_btn_AcessMission_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_input_CompleteMission_Input = fastComponent.FastGetComponent <UIInput>("CompleteMission_Input");
     if (null == m_input_CompleteMission_Input)
     {
         Engine.Utility.Log.Error("m_input_CompleteMission_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_CompleteMission_queidng = fastComponent.FastGetComponent <UIButton>("CompleteMission_queidng");
     if (null == m_btn_CompleteMission_queidng)
     {
         Engine.Utility.Log.Error("m_btn_CompleteMission_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_input_Deliver_Input = fastComponent.FastGetComponent <UIInput>("Deliver_Input");
     if (null == m_input_Deliver_Input)
     {
         Engine.Utility.Log.Error("m_input_Deliver_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Deliver_X_Input = fastComponent.FastGetComponent <UIInput>("Deliver_X_Input");
     if (null == m_input_Deliver_X_Input)
     {
         Engine.Utility.Log.Error("m_input_Deliver_X_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Deliver_Y_Input = fastComponent.FastGetComponent <UIInput>("Deliver_Y_Input");
     if (null == m_input_Deliver_Y_Input)
     {
         Engine.Utility.Log.Error("m_input_Deliver_Y_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Deliver_queidng = fastComponent.FastGetComponent <UIButton>("Deliver_queidng");
     if (null == m_btn_Deliver_queidng)
     {
         Engine.Utility.Log.Error("m_btn_Deliver_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_input_MissionAnimation_Input = fastComponent.FastGetComponent <UIInput>("MissionAnimation_Input");
     if (null == m_input_MissionAnimation_Input)
     {
         Engine.Utility.Log.Error("m_input_MissionAnimation_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_MissionAnimation_queidng = fastComponent.FastGetComponent <UIButton>("MissionAnimation_queidng");
     if (null == m_btn_MissionAnimation_queidng)
     {
         Engine.Utility.Log.Error("m_btn_MissionAnimation_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_widget_MonsterContent = fastComponent.FastGetComponent <UIWidget>("MonsterContent");
     if (null == m_widget_MonsterContent)
     {
         Engine.Utility.Log.Error("m_widget_MonsterContent 为空,请检查prefab是否缺乏组件");
     }
     m_input_MonID_Input = fastComponent.FastGetComponent <UIInput>("MonID_Input");
     if (null == m_input_MonID_Input)
     {
         Engine.Utility.Log.Error("m_input_MonID_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_MonNum_Input = fastComponent.FastGetComponent <UIInput>("MonNum_Input");
     if (null == m_input_MonNum_Input)
     {
         Engine.Utility.Log.Error("m_input_MonNum_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Monster_queding = fastComponent.FastGetComponent <UIButton>("Monster_queding");
     if (null == m_btn_Monster_queding)
     {
         Engine.Utility.Log.Error("m_btn_Monster_queding 为空,请检查prefab是否缺乏组件");
     }
     m_btn_KillMonster_queidng = fastComponent.FastGetComponent <UIButton>("KillMonster_queidng");
     if (null == m_btn_KillMonster_queidng)
     {
         Engine.Utility.Log.Error("m_btn_KillMonster_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_btn_KillAllMonster_queidng = fastComponent.FastGetComponent <UIButton>("KillAllMonster_queidng");
     if (null == m_btn_KillAllMonster_queidng)
     {
         Engine.Utility.Log.Error("m_btn_KillAllMonster_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_widget_EquipmentContent = fastComponent.FastGetComponent <UIWidget>("EquipmentContent");
     if (null == m_widget_EquipmentContent)
     {
         Engine.Utility.Log.Error("m_widget_EquipmentContent 为空,请检查prefab是否缺乏组件");
     }
     m_input_Equip_Input = fastComponent.FastGetComponent <UIInput>("Equip_Input");
     if (null == m_input_Equip_Input)
     {
         Engine.Utility.Log.Error("m_input_Equip_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_HoleNum_Input = fastComponent.FastGetComponent <UIInput>("HoleNum_Input");
     if (null == m_input_HoleNum_Input)
     {
         Engine.Utility.Log.Error("m_input_HoleNum_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Strengthen_Input = fastComponent.FastGetComponent <UIInput>("Strengthen_Input");
     if (null == m_input_Strengthen_Input)
     {
         Engine.Utility.Log.Error("m_input_Strengthen_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Num_Input = fastComponent.FastGetComponent <UIInput>("Num_Input");
     if (null == m_input_Num_Input)
     {
         Engine.Utility.Log.Error("m_input_Num_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_EquipPro_1_Input = fastComponent.FastGetComponent <UIInput>("EquipPro_1_Input");
     if (null == m_input_EquipPro_1_Input)
     {
         Engine.Utility.Log.Error("m_input_EquipPro_1_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_EquipPro_2_Input = fastComponent.FastGetComponent <UIInput>("EquipPro_2_Input");
     if (null == m_input_EquipPro_2_Input)
     {
         Engine.Utility.Log.Error("m_input_EquipPro_2_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_EquipPro_3_Input = fastComponent.FastGetComponent <UIInput>("EquipPro_3_Input");
     if (null == m_input_EquipPro_3_Input)
     {
         Engine.Utility.Log.Error("m_input_EquipPro_3_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_EquipPro_4_Input = fastComponent.FastGetComponent <UIInput>("EquipPro_4_Input");
     if (null == m_input_EquipPro_4_Input)
     {
         Engine.Utility.Log.Error("m_input_EquipPro_4_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_EquipPro_5_Input = fastComponent.FastGetComponent <UIInput>("EquipPro_5_Input");
     if (null == m_input_EquipPro_5_Input)
     {
         Engine.Utility.Log.Error("m_input_EquipPro_5_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Equipment_queidng = fastComponent.FastGetComponent <UIButton>("Equipment_queidng");
     if (null == m_btn_Equipment_queidng)
     {
         Engine.Utility.Log.Error("m_btn_Equipment_queidng 为空,请检查prefab是否缺乏组件");
     }
     m__Grade = fastComponent.FastGetComponent <UIPopupList>("Grade");
     if (null == m__Grade)
     {
         Engine.Utility.Log.Error("m__Grade 为空,请检查prefab是否缺乏组件");
     }
     m__Job = fastComponent.FastGetComponent <UIPopupList>("Job");
     if (null == m__Job)
     {
         Engine.Utility.Log.Error("m__Job 为空,请检查prefab是否缺乏组件");
     }
     m_btn_BtnOneKeyAdd = fastComponent.FastGetComponent <UIButton>("BtnOneKeyAdd");
     if (null == m_btn_BtnOneKeyAdd)
     {
         Engine.Utility.Log.Error("m_btn_BtnOneKeyAdd 为空,请检查prefab是否缺乏组件");
     }
     m_widget_MuhonContent = fastComponent.FastGetComponent <UIWidget>("MuhonContent");
     if (null == m_widget_MuhonContent)
     {
         Engine.Utility.Log.Error("m_widget_MuhonContent 为空,请检查prefab是否缺乏组件");
     }
     m_input_Muhon_Input = fastComponent.FastGetComponent <UIInput>("Muhon_Input");
     if (null == m_input_Muhon_Input)
     {
         Engine.Utility.Log.Error("m_input_Muhon_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Muhon_Num_Input = fastComponent.FastGetComponent <UIInput>("Muhon_Num_Input");
     if (null == m_input_Muhon_Num_Input)
     {
         Engine.Utility.Log.Error("m_input_Muhon_Num_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Muhon_Level_Input = fastComponent.FastGetComponent <UIInput>("Muhon_Level_Input");
     if (null == m_input_Muhon_Level_Input)
     {
         Engine.Utility.Log.Error("m_input_Muhon_Level_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_MuhonPro_1_Input = fastComponent.FastGetComponent <UIInput>("MuhonPro_1_Input");
     if (null == m_input_MuhonPro_1_Input)
     {
         Engine.Utility.Log.Error("m_input_MuhonPro_1_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_MuhonPro_2_Input = fastComponent.FastGetComponent <UIInput>("MuhonPro_2_Input");
     if (null == m_input_MuhonPro_2_Input)
     {
         Engine.Utility.Log.Error("m_input_MuhonPro_2_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_MuhonPro_3_Input = fastComponent.FastGetComponent <UIInput>("MuhonPro_3_Input");
     if (null == m_input_MuhonPro_3_Input)
     {
         Engine.Utility.Log.Error("m_input_MuhonPro_3_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_MuhonPro_4_Input = fastComponent.FastGetComponent <UIInput>("MuhonPro_4_Input");
     if (null == m_input_MuhonPro_4_Input)
     {
         Engine.Utility.Log.Error("m_input_MuhonPro_4_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_MuhonPro_5_Input = fastComponent.FastGetComponent <UIInput>("MuhonPro_5_Input");
     if (null == m_input_MuhonPro_5_Input)
     {
         Engine.Utility.Log.Error("m_input_MuhonPro_5_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Muhon_queidng = fastComponent.FastGetComponent <UIButton>("Muhon_queidng");
     if (null == m_btn_Muhon_queidng)
     {
         Engine.Utility.Log.Error("m_btn_Muhon_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_widget_PetContent = fastComponent.FastGetComponent <UIWidget>("PetContent");
     if (null == m_widget_PetContent)
     {
         Engine.Utility.Log.Error("m_widget_PetContent 为空,请检查prefab是否缺乏组件");
     }
     m_input_Pet_Input = fastComponent.FastGetComponent <UIInput>("Pet_Input");
     if (null == m_input_Pet_Input)
     {
         Engine.Utility.Log.Error("m_input_Pet_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Pet_Level_Input = fastComponent.FastGetComponent <UIInput>("Pet_Level_Input");
     if (null == m_input_Pet_Level_Input)
     {
         Engine.Utility.Log.Error("m_input_Pet_Level_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Xiuwei_Level_Input = fastComponent.FastGetComponent <UIInput>("Xiuwei_Level_Input");
     if (null == m_input_Xiuwei_Level_Input)
     {
         Engine.Utility.Log.Error("m_input_Xiuwei_Level_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Pet_Character_Input = fastComponent.FastGetComponent <UIInput>("Pet_Character_Input");
     if (null == m_input_Pet_Character_Input)
     {
         Engine.Utility.Log.Error("m_input_Pet_Character_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_GrowStatus_Input = fastComponent.FastGetComponent <UIInput>("GrowStatus_Input");
     if (null == m_input_GrowStatus_Input)
     {
         Engine.Utility.Log.Error("m_input_GrowStatus_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Pet_queidng = fastComponent.FastGetComponent <UIButton>("Pet_queidng");
     if (null == m_btn_Pet_queidng)
     {
         Engine.Utility.Log.Error("m_btn_Pet_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_input_liliangtianfu_Input = fastComponent.FastGetComponent <UIInput>("liliangtianfu_Input");
     if (null == m_input_liliangtianfu_Input)
     {
         Engine.Utility.Log.Error("m_input_liliangtianfu_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_zhilitianfu_Input = fastComponent.FastGetComponent <UIInput>("zhilitianfu_Input");
     if (null == m_input_zhilitianfu_Input)
     {
         Engine.Utility.Log.Error("m_input_zhilitianfu_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_minjietianfu_Input = fastComponent.FastGetComponent <UIInput>("minjietianfu_Input");
     if (null == m_input_minjietianfu_Input)
     {
         Engine.Utility.Log.Error("m_input_minjietianfu_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_tilitianfu_Input = fastComponent.FastGetComponent <UIInput>("tilitianfu_Input");
     if (null == m_input_tilitianfu_Input)
     {
         Engine.Utility.Log.Error("m_input_tilitianfu_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_jingshentianfu_Input = fastComponent.FastGetComponent <UIInput>("jingshentianfu_Input");
     if (null == m_input_jingshentianfu_Input)
     {
         Engine.Utility.Log.Error("m_input_jingshentianfu_Input 为空,请检查prefab是否缺乏组件");
     }
     m_widget_RideContent = fastComponent.FastGetComponent <UIWidget>("RideContent");
     if (null == m_widget_RideContent)
     {
         Engine.Utility.Log.Error("m_widget_RideContent 为空,请检查prefab是否缺乏组件");
     }
     m_input_Ride_Input = fastComponent.FastGetComponent <UIInput>("Ride_Input");
     if (null == m_input_Ride_Input)
     {
         Engine.Utility.Log.Error("m_input_Ride_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Ride_Level_Input = fastComponent.FastGetComponent <UIInput>("Ride_Level_Input");
     if (null == m_input_Ride_Level_Input)
     {
         Engine.Utility.Log.Error("m_input_Ride_Level_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_Ride_Quality_Input = fastComponent.FastGetComponent <UIInput>("Ride_Quality_Input");
     if (null == m_input_Ride_Quality_Input)
     {
         Engine.Utility.Log.Error("m_input_Ride_Quality_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Ride_queidng = fastComponent.FastGetComponent <UIButton>("Ride_queidng");
     if (null == m_btn_Ride_queidng)
     {
         Engine.Utility.Log.Error("m_btn_Ride_queidng 为空,请检查prefab是否缺乏组件");
     }
     m_widget_MailContent = fastComponent.FastGetComponent <UIWidget>("MailContent");
     if (null == m_widget_MailContent)
     {
         Engine.Utility.Log.Error("m_widget_MailContent 为空,请检查prefab是否缺乏组件");
     }
     m_input_MailName_Input = fastComponent.FastGetComponent <UIInput>("MailName_Input");
     if (null == m_input_MailName_Input)
     {
         Engine.Utility.Log.Error("m_input_MailName_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_MailNum_Input = fastComponent.FastGetComponent <UIInput>("MailNum_Input");
     if (null == m_input_MailNum_Input)
     {
         Engine.Utility.Log.Error("m_input_MailNum_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_MailText_Input = fastComponent.FastGetComponent <UIInput>("MailText_Input");
     if (null == m_input_MailText_Input)
     {
         Engine.Utility.Log.Error("m_input_MailText_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_item_1ID_Input = fastComponent.FastGetComponent <UIInput>("item_1ID_Input");
     if (null == m_input_item_1ID_Input)
     {
         Engine.Utility.Log.Error("m_input_item_1ID_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_item_1Num_Input = fastComponent.FastGetComponent <UIInput>("item_1Num_Input");
     if (null == m_input_item_1Num_Input)
     {
         Engine.Utility.Log.Error("m_input_item_1Num_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_item_2ID_Input = fastComponent.FastGetComponent <UIInput>("item_2ID_Input");
     if (null == m_input_item_2ID_Input)
     {
         Engine.Utility.Log.Error("m_input_item_2ID_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_item_2Num_Input = fastComponent.FastGetComponent <UIInput>("item_2Num_Input");
     if (null == m_input_item_2Num_Input)
     {
         Engine.Utility.Log.Error("m_input_item_2Num_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_item_3ID_Input = fastComponent.FastGetComponent <UIInput>("item_3ID_Input");
     if (null == m_input_item_3ID_Input)
     {
         Engine.Utility.Log.Error("m_input_item_3ID_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_item_3Num_Input = fastComponent.FastGetComponent <UIInput>("item_3Num_Input");
     if (null == m_input_item_3Num_Input)
     {
         Engine.Utility.Log.Error("m_input_item_3Num_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_gold_1ID_Input = fastComponent.FastGetComponent <UIInput>("gold_1ID_Input");
     if (null == m_input_gold_1ID_Input)
     {
         Engine.Utility.Log.Error("m_input_gold_1ID_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_gold_1Num_Input = fastComponent.FastGetComponent <UIInput>("gold_1Num_Input");
     if (null == m_input_gold_1Num_Input)
     {
         Engine.Utility.Log.Error("m_input_gold_1Num_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_gold_2ID_Input = fastComponent.FastGetComponent <UIInput>("gold_2ID_Input");
     if (null == m_input_gold_2ID_Input)
     {
         Engine.Utility.Log.Error("m_input_gold_2ID_Input 为空,请检查prefab是否缺乏组件");
     }
     m_input_gold_2Num_Input = fastComponent.FastGetComponent <UIInput>("gold_2Num_Input");
     if (null == m_input_gold_2Num_Input)
     {
         Engine.Utility.Log.Error("m_input_gold_2Num_Input 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Mail_queding = fastComponent.FastGetComponent <UIButton>("Mail_queding");
     if (null == m_btn_Mail_queding)
     {
         Engine.Utility.Log.Error("m_btn_Mail_queding 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Base = fastComponent.FastGetComponent <UIButton>("Base");
     if (null == m_btn_Base)
     {
         Engine.Utility.Log.Error("m_btn_Base 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Mission = fastComponent.FastGetComponent <UIButton>("Mission");
     if (null == m_btn_Mission)
     {
         Engine.Utility.Log.Error("m_btn_Mission 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Monster = fastComponent.FastGetComponent <UIButton>("Monster");
     if (null == m_btn_Monster)
     {
         Engine.Utility.Log.Error("m_btn_Monster 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Equipment = fastComponent.FastGetComponent <UIButton>("Equipment");
     if (null == m_btn_Equipment)
     {
         Engine.Utility.Log.Error("m_btn_Equipment 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Muhon = fastComponent.FastGetComponent <UIButton>("Muhon");
     if (null == m_btn_Muhon)
     {
         Engine.Utility.Log.Error("m_btn_Muhon 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Pet = fastComponent.FastGetComponent <UIButton>("Pet");
     if (null == m_btn_Pet)
     {
         Engine.Utility.Log.Error("m_btn_Pet 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Ride = fastComponent.FastGetComponent <UIButton>("Ride");
     if (null == m_btn_Ride)
     {
         Engine.Utility.Log.Error("m_btn_Ride 为空,请检查prefab是否缺乏组件");
     }
     m_btn_Mail = fastComponent.FastGetComponent <UIButton>("Mail");
     if (null == m_btn_Mail)
     {
         Engine.Utility.Log.Error("m_btn_Mail 为空,请检查prefab是否缺乏组件");
     }
     if (null != fastComponent)
     {
         GameObject.Destroy(fastComponent);
     }
 }
示例#42
0
        public void ValidateLayout()
        {
            if (!this._IsLayoutDirty)
            {
                return;
            }

            this._IsLayoutDirty = false;

            float height = this.PreferredHeight;
            float left   = (this.Bounds.Size.Width - ContainerWidth) * 0.5f;
            float top    = (this.Bounds.Size.Height - height) * 0.5f;

            this._ContainerView.Transform        = CGAffineTransform.MakeIdentity();
            this._ContainerView.Frame            = new RectangleF(left, top, ContainerWidth, height);
            this._ContainerView.Layer.ShadowPath = UIBezierPath.FromRoundedRect(this._ContainerView.Bounds, this._ContainerView.Layer.CornerRadius).CGPath;

            float y = ContentMarginTop;

            if (this._TitleLabel != null)
            {
                this._TitleLabel.Text = this.Title;
                float h = this.HeightForTitleLabel;
                this._TitleLabel.Frame = new RectangleF(ContentMarginLeft, y, this._ContainerView.Bounds.Size.Width - ContentMarginLeft * 2f, h);
                y += h;
            }

            if (this._MessageLabel != null)
            {
                if (y > ContentMarginTop)
                {
                    y += ButtonMargin;
                }
                this._MessageLabel.Text = this._Message;
                float h = this.HeightForMessageLabel;
                this._MessageLabel.Frame = new RectangleF(ContentMarginLeft, y, this._ContainerView.Bounds.Size.Width - ContentMarginLeft * 2f, h);
                y += h;
            }

            if (this._Items.Count > 0)
            {
                if (y > ContentMarginTop)
                {
                    y += ButtonMargin;
                }
                if (this._Items.Count == 2 && !_AlwaysStackButtons)
                {
                    float    width  = (this._ContainerView.Bounds.Size.Width - ContentMarginLeft * 2f - ButtonMargin) * 0.5f;
                    UIButton button = this._Buttons[0];
                    button.Frame = new RectangleF(ContentMarginLeft, y, width, ButtonHeight);
                    button       = this._Buttons[1];
                    button.Frame = new RectangleF(ContentMarginLeft + width + ButtonMargin, y, width, ButtonHeight);
                }
                else
                {
                    int i = 0;
                    foreach (var button in this._Buttons)
                    {
                        button.Frame = new RectangleF(ContentMarginLeft, y, this._ContainerView.Bounds.Size.Width - ContentMarginLeft * 2f, ButtonHeight);
                        if (this._Buttons.Count > 1)
                        {
                            if (i == this._Buttons.Count - 1 && this._Items[i].Type == SIAlertViewButtonType.Cancel)
                            {
                                RectangleF rect      = button.Frame;
                                var        locationY = rect.Location.Y;
                                locationY   += CancelButtonMarginTop;
                                button.Frame = new RectangleF(rect.Location.X, locationY, rect.Size.Width, rect.Size.Height);
                            }
                            y += ButtonHeight + ButtonMargin;
                        }
                        i++;
                    }
                }
            }
        }
示例#43
0
        public override void Start()
        {
            // Activates the dragging of the window
            AddUIComponent(typeof(UIDragHandle));

            backgroundSprite = "GenericPanel";
            name             = "MPConnectionPanel";
            color            = new Color32(110, 110, 110, 250);

            // Grab the view for calculating width and height of game
            UIView view = UIView.GetAView();

            // Center this window in the game
            relativePosition = new Vector3(view.fixedWidth / 2.0f - 180.0f, view.fixedHeight / 2.0f - 100.0f);

            width  = 360;
            height = 240;

            // Handle visible change events
            eventVisibilityChanged += (component, visible) =>
            {
                if (!visible)
                {
                    return;
                }

                RefreshState();
            };

            this.CreateTitleLabel("Multiplayer Menu", new Vector3(80, -20, 0));

            // Manage server button
            _serverManageButton           = this.CreateButton("Manage Server", new Vector2(10, -60));
            _serverManageButton.isEnabled = false;
            _serverManageButton.isVisible = false;

            // Host game button
            _serverConnectButton = this.CreateButton("Host Game", new Vector2(10, -60));

            // Close server button
            _disconnectButton           = this.CreateButton("Stop Server", new Vector2(10, -130));
            _disconnectButton.isEnabled = false;
            _disconnectButton.isVisible = false;

            // Show Player Pointers
            _playerPointers               = this.CreateCheckBox("Show Player Pointers", new Vector2(10, -210));
            _playerPointers.isVisible     = false;
            _playerPointers.isEnabled     = false;
            _playerPointers.eventClicked += (component, param) =>
            {
                showPlayerPointers = _playerPointers.isChecked;
            };

            // Host a game panel
            _serverConnectButton.eventClick += (component, param) =>
            {
                HostGamePanel panel = view.FindUIComponent <HostGamePanel>("MPHostGamePanel");

                if (panel != null)
                {
                    panel.isVisible = true;
                    panel.Focus();
                }
                else
                {
                    HostGamePanel hostGamePanel = (HostGamePanel)view.AddUIComponent(typeof(HostGamePanel));
                    hostGamePanel.Focus();
                }

                isVisible = false;
            };

            _disconnectButton.eventClick += (component, param) =>
            {
                isVisible = false;
                MultiplayerManager.Instance.StopEverything();
            };

            _serverManageButton.eventClick += (component, param) =>
            {
                ManageGamePanel panel = view.FindUIComponent <ManageGamePanel>("MPManageGamePanel");

                if (panel != null)
                {
                    panel.isVisible = true;
                }
                else
                {
                    panel = (ManageGamePanel)view.AddUIComponent(typeof(ManageGamePanel));
                }

                panel.Focus();

                isVisible = false;
            };

            base.Start();

            RefreshState();
        }
 public void Include(UIButton uiButton)
 {
     uiButton.TouchUpInside += (s, e) => uiButton.SetTitle(uiButton.Title(UIControlState.Normal), UIControlState.Normal);
 }
 partial void StartPomodoroButton_TouchUpInside(UIButton sender)
 {
     _vm.StartButtonTouched.Execute(null);
 }
示例#46
0
 private void SetEnableButton(UIButton button, bool isEnabled)
 {
     button.Hidden = !isEnabled;
 }
示例#47
0
 private void Show(UIButton button)
 {
     button.isVisible = true;
     button.isEnabled = true;
 }
示例#48
0
 private void Hide(UIButton button)
 {
     button.isVisible = false;
     button.isEnabled = false;
 }
示例#49
0
        public void Start2()
        {
            Debug.Log("Show main menu.");

            var atlas = GameObject.Find("main_menu_atlas").GetComponent <UIToolkit>();

            const float padding      = 0.12f;
            const float bannerHeight = 0.1f;

            banner = UIButton.create(atlas, "banner.png", "banner.png", 0, 0);
            banner.positionFromCenter(0, 0);
            banner.positionFromTop(0, 0);
            banner.highlightedTouchOffsets = new UIEdgeOffsets(30);
            banner.scaleFromTo(1.0f, Vector3.zero, new Vector3(0.3f, 0.3f, 0), Easing.Quintic.easeOut);

            queue1vs1Btn = UIButton.create(atlas, "button.png", "button.png", 0, 0);
            queue1vs1Btn.highlightedTouchOffsets = new UIEdgeOffsets(30);
            queue1vs1Btn.positionFromCenter(0, 0);
            queue1vs1Btn.positionFromTop(bannerHeight + padding, 0);
            queue1vs1Btn.scaleFromTo(1.0f, Vector3.zero, new Vector3(0.3f, 0.3f, 0), Easing.Quintic.easeOut);
            queue1vs1Btn.onTouchUpInside += OnQueue1vs1Clicked;

            queue2vs2Btn = UIButton.create(atlas, "button.png", "button.png", 0, 0);
            queue2vs2Btn.highlightedTouchOffsets = new UIEdgeOffsets(30);
            queue2vs2Btn.positionFromCenter(0, 0);
            queue2vs2Btn.positionFromTop(bannerHeight + padding * 2, 0);
            queue2vs2Btn.scaleFromTo(1.0f, Vector3.zero, new Vector3(0.3f, 0.3f, 0), Easing.Quintic.easeOut);
            queue2vs2Btn.onTouchUpInside += OnQueue2vs2Clicked;

            customGameBtn = UIButton.create(atlas, "button.png", "button.png", 0, 0);
            customGameBtn.highlightedTouchOffsets = new UIEdgeOffsets(30);
            customGameBtn.positionFromCenter(0, 0);
            customGameBtn.positionFromTop(bannerHeight + padding * 3, 0);
            customGameBtn.scaleFromTo(1.0f, Vector3.zero, new Vector3(0.3f, 0.3f, 0), Easing.Quintic.easeOut);
            customGameBtn.onTouchUpInside += OnCustomGameClicked;

            settingsBtn = UIButton.create(atlas, "button.png", "button.png", 0, 0);
            settingsBtn.highlightedTouchOffsets = new UIEdgeOffsets(30);
            settingsBtn.positionFromCenter(0, 0);
            settingsBtn.positionFromTop(bannerHeight + padding * 4, 0);
            settingsBtn.scaleFromTo(1.0f, Vector3.zero, new Vector3(0.3f, 0.3f, 0), Easing.Quintic.easeOut);
            settingsBtn.onTouchUpInside += OnSettingsClicked;

            profileBtn = UIButton.create(atlas, "button.png", "button.png", 0, 0);
            profileBtn.highlightedTouchOffsets = new UIEdgeOffsets(30);
            profileBtn.positionFromCenter(0, 0);
            profileBtn.positionFromTop(bannerHeight + padding * 5, 0);
            profileBtn.scaleFromTo(1.0f, Vector3.zero, new Vector3(0.3f, 0.3f, 0), Easing.Quintic.easeOut);

            shopBtn = UIButton.create(atlas, "shop.png", "shop.png", 0, 0);
            shopBtn.highlightedTouchOffsets = new UIEdgeOffsets(30);
            shopBtn.positionFromCenter(0, 0);
            shopBtn.positionFromTop(bannerHeight + padding * 6, 0);
            shopBtn.scaleFromTo(1.0f, Vector3.zero, new Vector3(0.3f, 0.3f, 0), Easing.Quintic.easeOut);
            shopBtn.onTouchUpInside += OnShopClicked;

            /*var layout = new UIVerticalLayout(45);
             * layout.beginUpdates();
             * layout.verticalAlignMode = UIAbsoluteLayout.UIContainerVerticalAlignMode.Top;
             * layout.addChild(queue1vs1Btn, queue2vs2Btn, customGameBtn, settings, shopBtn);
             * layout.positionFromTop(0.2f, 0);
             * layout.positionFromCenter(0, 0);
             * layout.endUpdates();
             * layout.matchSizeToContentSize();*/
        }
示例#50
0
 public void OnQueue2vs2Clicked(UIButton button)
 {
 }
示例#51
0
 public void OnSettingsClicked(UIButton button)
 {
 }
示例#52
0
        public void OnShopClicked(UIButton button)
        {
//            GameObject.Find("Menu").GetComponent<Menu>().ShowShop();
        }
示例#53
0
 private void SetButtonOutline(UIButton btn)
 {
     btn.Layer.CornerRadius = 3;
     btn.Layer.BorderColor  = UIColor.LightGray.CGColor; // what's CGColor?
     btn.Layer.BorderWidth  = 1;
 }
示例#54
0
 public void OnCustomGameClicked(UIButton button)
 {
 }
        public override UITableViewCell GetCell(Cell item, UITableView tv)
        {
            var extendedCell = (ExtendedTextCell)item;

            TextCell             textCell = (TextCell)item;
            UITableViewCellStyle style    = UITableViewCellStyle.Subtitle;

            if (extendedCell.DetailLocation == Xamarin.Forms.Labs.Enums.TextCellDetailLocation.Right)
            {
                style = UITableViewCellStyle.Value1;
            }

            string            fullName = item.GetType().FullName;
            CellTableViewCell cell     = tv.DequeueReusableCell(fullName) as CellTableViewCell;

            if (cell == null)
            {
                cell = new CellTableViewCell(style, fullName);
            }
            else
            {
                cell.Cell.PropertyChanged -= new PropertyChangedEventHandler(cell.HandlePropertyChanged);
            }
            cell.Cell = textCell;
            textCell.PropertyChanged      += new PropertyChangedEventHandler(cell.HandlePropertyChanged);
            cell.PropertyChanged           = new Action <object, PropertyChangedEventArgs> (this.HandlePropertyChanged);
            cell.TextLabel.Text            = textCell.Text;
            cell.DetailTextLabel.Text      = textCell.Detail;
            cell.TextLabel.TextColor       = textCell.TextColor.ToUIColor(ExtendedTextCellRenderer.DefaultTextColor);
            cell.DetailTextLabel.TextColor = textCell.DetailColor.ToUIColor(ExtendedTextCellRenderer.DefaultDetailColor);

            base.UpdateBackground(cell, item);

            if (cell != null)
            {
                cell.BackgroundColor = extendedCell.BackgroundColor.ToUIColor();
                cell.SeparatorInset  = new UIEdgeInsets((float)extendedCell.SeparatorPadding.Top, (float)extendedCell.SeparatorPadding.Left,
                                                        (float)extendedCell.SeparatorPadding.Bottom, (float)extendedCell.SeparatorPadding.Right);

                if (extendedCell.ShowDisclousure)
                {
                    cell.Accessory = MonoTouch.UIKit.UITableViewCellAccessory.DisclosureIndicator;
                    if (!string.IsNullOrEmpty(extendedCell.DisclousureImage))
                    {
                        var detailDisclosureButton = UIButton.FromType(UIButtonType.Custom);
                        detailDisclosureButton.SetImage(UIImage.FromBundle(extendedCell.DisclousureImage), UIControlState.Normal);
                        detailDisclosureButton.SetImage(UIImage.FromBundle(extendedCell.DisclousureImage), UIControlState.Selected);

                        detailDisclosureButton.Frame          = new RectangleF(0f, 0f, 30f, 30f);
                        detailDisclosureButton.TouchUpInside += (object sender, EventArgs e) => {
                            var index = tv.IndexPathForCell(cell);
                            tv.SelectRow(index, true, UITableViewScrollPosition.None);
                            tv.Source.AccessoryButtonTapped(tv, index);
                        };
                        cell.AccessoryView = detailDisclosureButton;
                    }
                }
            }

            if (!extendedCell.ShowSeparator)
            {
                tv.SeparatorStyle = UITableViewCellSeparatorStyle.None;
            }

            tv.SeparatorColor = extendedCell.SeparatorColor.ToUIColor();

            return(cell);
        }
示例#56
0
 public NestedMailMerge()
 {
     label = new UILabel();
     button = new UIButton(UIButtonType.System);
     button.TouchUpInside += OnButtonClicked;
 }
示例#57
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            if (!Resolver.IsSet)
            {
                SetIoc();
            }

            _lockService = Resolver.Resolve <ILockService>();
            var appIdService         = Resolver.Resolve <IAppIdService>();
            var crashManagerDelegate = new HockeyAppCrashManagerDelegate(
                appIdService, Resolver.Resolve <IAuthService>());
            var manager = BITHockeyManager.SharedHockeyManager;

            manager.Configure("51f96ae568ba45f699a18ad9f63046c3", crashManagerDelegate);
            manager.CrashManager.CrashManagerStatus = BITCrashManagerStatus.AutoSend;
            manager.UserId = appIdService.AppId;
            manager.StartManager();
            manager.Authenticator.AuthenticateInstallation();
            manager.DisableMetricsManager = manager.DisableFeedbackManager = manager.DisableUpdateManager = true;

            LoadApplication(new App.App(
                                null,
                                Resolver.Resolve <IAuthService>(),
                                Resolver.Resolve <IConnectivity>(),
                                Resolver.Resolve <IUserDialogs>(),
                                Resolver.Resolve <IDatabaseService>(),
                                Resolver.Resolve <ISyncService>(),
                                Resolver.Resolve <ISettings>(),
                                _lockService,
                                Resolver.Resolve <IGoogleAnalyticsService>(),
                                Resolver.Resolve <ILocalizeService>(),
                                Resolver.Resolve <IAppInfoService>(),
                                Resolver.Resolve <IAppSettingsService>(),
                                Resolver.Resolve <IDeviceActionService>()));

            // Appearance stuff

            var primaryColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
            var grayLight    = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);

            UINavigationBar.Appearance.ShadowImage = new UIImage();
            UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
            UIBarButtonItem.AppearanceWhenContainedIn(new Type[] { typeof(UISearchBar) }).TintColor = primaryColor;
            UIButton.AppearanceWhenContainedIn(new Type[] { typeof(UISearchBar) }).SetTitleColor(primaryColor, UIControlState.Normal);
            UIButton.AppearanceWhenContainedIn(new Type[] { typeof(UISearchBar) }).TintColor = primaryColor;
            UIStepper.Appearance.TintColor = grayLight;
            UISlider.Appearance.TintColor  = primaryColor;

            MessagingCenter.Subscribe <Xamarin.Forms.Application, ToolsExtensionPage>(Xamarin.Forms.Application.Current, "ShowAppExtension", (sender, page) =>
            {
                var itemProvider           = new NSItemProvider(new NSDictionary(), iOS.Core.Constants.UTTypeAppExtensionSetup);
                var extensionItem          = new NSExtensionItem();
                extensionItem.Attachments  = new NSItemProvider[] { itemProvider };
                var activityViewController = new UIActivityViewController(new NSExtensionItem[] { extensionItem }, null);
                activityViewController.CompletionHandler = (activityType, completed) =>
                {
                    page.EnabledExtension(completed && activityType == "com.8bit.bitwarden.find-login-action-extension");
                };

                var modal = UIApplication.SharedApplication.KeyWindow.RootViewController.ModalViewController;
                if (activityViewController.PopoverPresentationController != null)
                {
                    activityViewController.PopoverPresentationController.SourceView = modal.View;
                    var frame     = UIScreen.MainScreen.Bounds;
                    frame.Height /= 2;
                    activityViewController.PopoverPresentationController.SourceRect = frame;
                }

                modal.PresentViewController(activityViewController, true, null);
            });

            UIApplication.SharedApplication.StatusBarHidden = false;
            UIApplication.SharedApplication.StatusBarStyle  = UIStatusBarStyle.LightContent;

            MessagingCenter.Subscribe <Xamarin.Forms.Application, bool>(Xamarin.Forms.Application.Current, "ShowStatusBar", (sender, show) =>
            {
                UIApplication.SharedApplication.SetStatusBarHidden(!show, false);
            });

            ZXing.Net.Mobile.Forms.iOS.Platform.Init();
            return(base.FinishedLaunching(app, options));
        }
示例#58
0
        private static bool GetUIObjects(string infoPanelName, UIPanel itemsPanel, out UIPanel targetPanel, out UILabel targetLabel, out UIButton targetButton)
        {
            targetPanel  = null;
            targetLabel  = null;
            targetButton = null;

            targetButton = itemsPanel.Find <UIButton>(TargetButtonName);
            if (targetButton == null)
            {
                Debug.LogWarning($"The 'Snooper' mod failed to customize the info panel '{infoPanelName}'. Target button instance is null.");
                return(false);
            }

            targetPanel = targetButton.parent as UIPanel;
            if (targetPanel == null)
            {
                Debug.LogWarning($"The 'Snooper' mod failed to customize the info panel '{infoPanelName}'. The target button's parent is null.");
                return(false);
            }

            targetLabel = targetPanel.components.OfType <UILabel>().FirstOrDefault();
            if (targetLabel == null)
            {
                Debug.LogWarning($"The 'Snooper' mod failed to customize the info panel '{infoPanelName}'. No target label found.");
                return(false);
            }

            return(true);
        }
 partial void BtnConnectWithFacebook_TouchUpInside(UIButton sender);
        private void SetTabColor(UIButton tabButton, Color inactiveTabColor, Color hoverTabColor, Color pressedTabColor, Color activeTabColor)
        {
            if (tabButton == null)
            {
                return;
            }
            UISprite sprite = tabButton.GetComponent <UISprite>();
            UILabel  label  = tabButton.GetComponentInChildren <UILabel>();

            if (label != null)
            {
                Undo.RecordObjects(new Object[] { tabButton.gameObject, label.gameObject }, "TabColor");
            }
            else
            {
                Undo.RecordObject(tabButton.gameObject, "TabColor");
            }


            if (sprite != null)
            {
                tabButton.normalSprite   = "tab_normal";
                tabButton.hoverSprite    = null;
                tabButton.pressedSprite  = null;
                tabButton.disabledSprite = "tab_selected";
                sprite.color             = Color.white;
            }
            if (label != null)
            {
                UIButtonColor[] colors = tabButton.GetComponents <UIButtonColor>();
                UIButtonColor   c      = null;
                foreach (var textCol in colors)
                {
                    if (textCol.tweenTarget == label.gameObject)
                    {
                        c = textCol;
                        break;
                    }
                }
                if (c == null)
                {
                    c = tabButton.gameObject.AddComponent <UIButtonColor>();
                }
                // add ButtonColor for Label
                label.effectStyle = UILabel.Effect.Outline;
                label.effectColor = Color.black;
                c.tweenTarget     = label.gameObject;
                EditorUtil.SetDirty(label.gameObject);
            }
            foreach (UIButtonColor c in tabButton.GetComponents <UIButtonColor>())
            {
                if (c.tweenTarget == tabButton.gameObject)
                {
                    c.tweenTarget.GetComponent <UIWidget>().color = inactiveTabColor;
                    c.hover         = hoverTabColor;
                    c.pressed       = pressedTabColor;
                    c.disabledColor = activeTabColor;
                }
            }
            EditorUtil.SetDirty(tabButton.gameObject);
        }