Exemplo n.º 1
0
 /// <summary>
 /// Dispose the specified disposing.
 /// </summary>
 /// <param name="disposing">If set to <c>true</c> disposing.</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         _simpleCheck.RemoveFromParent();
         _simpleCheck.Dispose();
         _simpleCheck = null;
     }
     base.Dispose(disposing);
 }
 /// <summary>
 /// Dispose the specified disposing.
 /// </summary>
 /// <returns>The dispose.</returns>
 /// <param name="disposing">If set to <c>true</c> disposing.</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         _textLabel?.Dispose();
         _textLabel = null;
         _checkBox?.Dispose();
         _checkBox = null;
     }
     base.Dispose(disposing);
 }
Exemplo n.º 3
0
        internal PickerInnerView(Android.Content.Context context, PickerAdapter adapter) : base(context)
        {
            this.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            var padding = (int)context.ToPixels(8);

            SetPadding(padding, padding, padding, padding);

            SetBackgroundColor(adapter._background);

            _textLabel    = new TextView(context);
            _textLabel.Id = AView.GenerateViewId();

            _detailLabel    = new TextView(context);
            _detailLabel.Id = AView.GenerateViewId();

            _textContainr             = new LinearLayout(context);
            _textContainr.Orientation = Orientation.Vertical;

            using (var param = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent)){
                _textContainr.AddView(_textLabel, param);
                _textContainr.AddView(_detailLabel, param);
            }

            _checkBox           = new SimpleCheck(context);
            _checkBox.Focusable = false;

            _textLabel.SetTextColor(adapter._titleColor);
            _textLabel.SetTextSize(Android.Util.ComplexUnitType.Sp, (float)adapter._fontSize);
            _detailLabel.SetTextColor(adapter._detailColor);
            _detailLabel.SetTextSize(Android.Util.ComplexUnitType.Sp, (float)adapter._detailFontSize);
            _checkBox.Color = adapter._accentColor;
            SetBackgroundColor(adapter._background);

            using (var param = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent)) {
                param.AddRule(LayoutRules.AlignParentStart);
                param.AddRule(LayoutRules.CenterVertical);
                AddView(_textContainr, param);
            }

            using (var param = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent)
            {
                Width = (int)context.ToPixels(30),
                Height = (int)context.ToPixels(30)
            }) {
                param.AddRule(LayoutRules.AlignParentEnd);
                param.AddRule(LayoutRules.CenterVertical);
                AddView(_checkBox, param);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:AiForms.Renderers.Droid.RadioCellView"/> class.
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="cell">Cell.</param>
        public RadioCellView(Context context, XF.Cell cell) : base(context, cell)
        {
            _simpleCheck           = new SimpleCheck(context);
            _simpleCheck.Focusable = false;

            var lparam = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WrapContent,
                ViewGroup.LayoutParams.WrapContent)
            {
                Width  = (int)context.ToPixels(30),
                Height = (int)context.ToPixels(30)
            };

            using (lparam) {
                AccessoryStack.AddView(_simpleCheck, lparam);
            }
        }