protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            _btNoAlpha = FindViewById <Button>(Resource.Id.ButtonColorNoAlpha);
            _btAlpha   = FindViewById <Button>(Resource.Id.ButtonColorAlpha);
            _btRound   = FindViewById <Button>(Resource.Id.ButtonRoundColor);

            _btNoAlpha.Click += BtNoAlphaOnClick;
            _btAlpha.Click   += BtAlphaOnClick;
            _btRound.Click   += BtRoundOnClick;

            _panelNoAlpha       = FindViewById <ColorPickerPanelView>(Resource.Id.PanelColorNoAlpha);
            _panelNoAlpha.Color = Color.Black;
            _panelAlpha         = FindViewById <ColorPickerPanelView>(Resource.Id.PanelColorAlpha);
            _panelAlpha.Color   = Color.Black;
            _panelRound         = FindViewById <ColorPickerPanelView>(Resource.Id.PanelRoundColor);
            _panelRound.Color   = Color.Black;
        }
Esempio n. 2
0
        public ColorSetting(Activity activity, int idPicker, int idDefaultColor, bool useAlpha, string saveKey)
        {
            _activity       = activity;
            _idDefaultColor = idDefaultColor;
            _savekey        = saveKey;
            _colorPicker    = activity.FindViewById <ColorPickerPanelView>(idPicker);

            using (var prefs = PrefsKeys.GetPrefs(activity))
            {
                var defaultColor = new Color(prefs.GetInt(_savekey + PrefsKeys.DefaultValue, activity.GetCompatColor(idDefaultColor)));

                _colorPicker.Color         = defaultColor;
                _colorPicker.PanelClicked += (sender, e) =>
                {
                    var colorPickerDialog = new ColorPickerDialog(activity, _colorPicker.Color);
                    colorPickerDialog.AlphaSliderVisible = useAlpha;
                    colorPickerDialog.ColorChanged      += (o, args) => _colorPicker.Color = args.Color;
                    colorPickerDialog.Show();
                };
            }
        }