示例#1
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Resource.Id.menu_color_picker_dialog:
                ColorPickerDialog.NewBuilder()
                .SetDialogType(ColorPickerDialog.DialogType.Custom)
                .SetAllowPresets(false)
                .SetDialogId(DIALOG_ID)
                .SetColor(Color.Black)
                .SetShowAlphaSlider(true)
                .Show(this);
                return(true);

            case Resource.Id.menu_github:
                try
                {
                    StartActivity(new Intent(Intent.ActionView,
                                             Android.Net.Uri.Parse("https://github.com/jaredrummler/ColorPicker")));
                }
                catch (ActivityNotFoundException ignored)
                {
                }

                return(true);
            }

            return(base.OnOptionsItemSelected(item));
        }
示例#2
0
 void ColorClick(object sender, EventArgs e)
 {
     if (SystemClock.ElapsedRealtime() - LastClickTime < 1000)
     {
         return;
     }
     LastClickTime = SystemClock.ElapsedRealtime();
     ColorPickerDialog.NewBuilder().SetColor(Color.Red).SetDialogType(ColorPickerDialog.DialogType.Preset).SetAllowCustom(false).SetColorShape(ColorShape.Square).SetShowAlphaSlider(false).SetDialogId(1).Show(this);
 }
示例#3
0
 private void CardViewColorOnClick(object sender, EventArgs e)
 {
     try
     {
         ColorPickerDialog.NewBuilder()
         .SetDialogType(ColorPickerDialog.TypeCustom)
         .SetAllowPresets(false)
         .SetDialogId(0)
         .SetColor(Color.ParseColor(AppSettings.MainColor))
         .SetShowAlphaSlider(true)
         .Show(this);
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
示例#4
0
 private void buttonColorClicked(object sender, EventArgs e)
 {
     ColorPickerDialog.NewBuilder().SetAllowPresets(false).SetShowAlphaSlider(false).SetColor(Color.Blue).Show(this);
 }
示例#5
0
 void OnColorPanelClickListener(object sender, EventArgs e)
 {
     ColorPickerDialog.NewBuilder().SetColor(Color.Aqua).Show(this.Activity);
 }