Example #1
0
        public virtual async void ShowColorChooser()
        {
            var chooser = ColorChooserDialog.CreateInstance();

            chooser.Initialize(Context);
            chooser.Chooser.Value = Morph.Value;

            var color = await chooser.ShowAsync(Screen);

            color.MatchSome(c =>
            {
                Morph.Value = c;
                UpdateMorph();
            });
        }
Example #2
0
 public void OnColorSelection(ColorChooserDialog dialog, int color)
 {
     if (dialog.IsAccentMode)
     {
         _accentPreselect = color;
         ThemeSingleton.Get().PositiveColor = DialogUtils.GetActionTextStateList(this, color);
         ThemeSingleton.Get().NeutralColor  = DialogUtils.GetActionTextStateList(this, color);
         ThemeSingleton.Get().NegativeColor = DialogUtils.GetActionTextStateList(this, color);
         ThemeSingleton.Get().WidgetColor   = color;
     }
     else
     {
         _primaryPreselect = color;
         SupportActionBar?.SetBackgroundDrawable(new ColorDrawable(new Android.Graphics.Color(color)));
         if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
         {
             Window.SetStatusBarColor(new Android.Graphics.Color(CircleView.ShiftColorDown(color)));
             Window.SetNavigationBarColor(new Android.Graphics.Color(color));
         }
     }
 }
Example #3
0
 public void OnColorChooserDismissed(ColorChooserDialog dialog)
 {
     ShowToast("Color chooser dismissed!");
 }