Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
0
        /// <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)
            {
                CellBase.PropertyChanged   -= CellPropertyChanged;
                CellParent.PropertyChanged -= ParentPropertyChanged;

                if (CellBase.Section != null)
                {
                    CellBase.Section.PropertyChanged -= SectionPropertyChanged;
                    CellBase.Section = null;
                }

                HintLabel?.Dispose();
                HintLabel = null;
                TitleLabel?.Dispose();
                TitleLabel = null;
                DescriptionLabel?.Dispose();
                DescriptionLabel = null;
                IconView?.SetImageDrawable(null);
                IconView?.SetImageBitmap(null);
                IconView?.Dispose();
                IconView = null;
                ContentStack?.Dispose();
                ContentStack = null;
                AccessoryStack?.Dispose();
                AccessoryStack = null;
                Cell           = null;

                _iconTokenSource?.Dispose();
                _iconTokenSource = null;
                _Context         = null;

                _backgroundColor?.Dispose();
                _backgroundColor = null;
                _selectedColor?.Dispose();
                _selectedColor = null;
                _ripple?.Dispose();
                _ripple = null;

                Background?.Dispose();
                Background = null;
            }
            base.Dispose(disposing);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:AiForms.Renderers.Droid.CommandCellView"/> class.
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="cell">Cell.</param>
        public CustomCellView(Context context, Cell cell) : base(context, cell)
        {
            if (!CustomCell.ShowArrowIndicator)
            {
                return;
            }
            _indicatorView = new ImageView(context);
            _indicatorView.SetImageResource(Resource.Drawable.ic_navigate_next);

            var param = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WrapContent,
                ViewGroup.LayoutParams.WrapContent)
            {
            };

            using (param)
            {
                AccessoryStack.AddView(_indicatorView, param);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:AiForms.Renderers.Droid.SwitchCellView"/> class.
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="cell">Cell.</param>
        public SwitchCellView(Context context, Cell cell) : base(context, cell)
        {
            _switch = new SwitchCompat(context);

            _switch.SetOnCheckedChangeListener(this);
            _switch.Gravity = Android.Views.GravityFlags.Right;

            var switchParam = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WrapContent,
                ViewGroup.LayoutParams.WrapContent)
            {
            };

            using (switchParam) {
                AccessoryStack.AddView(_switch, switchParam);
            }

            _switch.Focusable      = false;
            Focusable              = false;
            DescendantFocusability = Android.Views.DescendantFocusability.AfterDescendants;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:AiForms.Renderers.Droid.PickerCellView"/> class.
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="cell">Cell.</param>
        public PickerCellView(Context context, Cell cell) : base(context, cell)
        {
            _context = context;

            if (!CellParent.ShowArrowIndicatorForAndroid)
            {
                return;
            }
            _indicatorView = new ImageView(context);
            _indicatorView.SetImageResource(global::AiForms.SettingsView.Resource.Drawable.ic_navigate_next);

            var param = new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WrapContent,
                ViewGroup.LayoutParams.WrapContent)
            {
            };

            using (param)
            {
                AccessoryStack.AddView(_indicatorView, param);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:AiForms.Renderers.Droid.CheckboxCellView"/> class.
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="cell">Cell.</param>
        public CheckboxCellView(Context context, Cell cell) : base(context, cell)
        {
            _checkbox = new AppCompatCheckBox(context);
            _checkbox.SetOnCheckedChangeListener(this);
            _checkbox.Gravity = Android.Views.GravityFlags.Right;

            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(_checkbox, lparam);
            }

            _checkbox.Focusable    = false;
            Focusable              = false;
            DescendantFocusability = Android.Views.DescendantFocusability.AfterDescendants;
        }