Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NControl.Controls.RippleButton"/> class.
        /// </summary>
        public RippleButton()
        {
            _layout = new RelativeLayout {
                IsClippedToBounds = true
            };

            // Add ripple thing
            _rippler = new RippleControl {
                InputTransparent = true,
            };
            _layout.Children.Add(_rippler, () => _layout.Bounds);

            // Add title and icon
            _labelText = new Label {
                BackgroundColor  = Color.Transparent,
                XAlign           = TextAlignment.Center,
                YAlign           = TextAlignment.Center,
                TextColor        = Color.Black,
                InputTransparent = true,
            };

            _layout.Children.Add(_labelText, () => GetTextRectangleForImagePosition(_layout));

            _iconLabel = new FontAwesomeLabel {
                BackgroundColor  = Color.Transparent,
                FontSize         = 18,
                TextColor        = (Color)IconColorProperty.DefaultValue,
                InputTransparent = true,
            };

            _layout.Children.Add(_iconLabel, () => GetIconRectangleForImagePosition(_layout));

            Content = _layout;
        }
Esempio n. 2
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NControl.Controls.RippleButton"/> class.
		/// </summary>
		public RippleButton()
		{            
            _layout = new RelativeLayout {IsClippedToBounds = true};

			// Add ripple thing
			_rippler = new RippleControl{
				InputTransparent = true,
			};
			_layout.Children.Add (_rippler, () => _layout.Bounds);

			// Add title and icon
            _labelText = new Label{ 
				BackgroundColor = Color.Transparent,
				XAlign = TextAlignment.Center,
				YAlign = TextAlignment.Center,
				TextColor = Color.Black,				
				InputTransparent = true,
			};
			
			_layout.Children.Add (_labelText, ()=> GetTextRectangleForImagePosition(_layout));

            _iconLabel = new FontAwesomeLabel{ 
				BackgroundColor = Color.Transparent,
				FontSize = 18,
				TextColor = (Color)IconColorProperty.DefaultValue,
				InputTransparent = true,
			};
			
			_layout.Children.Add (_iconLabel, () => GetIconRectangleForImagePosition(_layout));

			Content = _layout;
		}