Example #1
0
        public void ShowCustomWebView(object sender, EventArgs e)
        {
            int accentColor = ThemeSingleton.Get().WidgetColor;

            if (accentColor == 0)
            {
                accentColor = ContextCompat.GetColor(this, Resource.Color.accent);
            }
            ChangelogDialog.Create(false, accentColor)
            .Show(SupportFragmentManager, "changelog");
        }
 public void OnColorSelection(int index, Color color, Color darker)
 {
     selectedColorIndex = index;
     activity.SupportActionBar.SetBackgroundDrawable(new ColorDrawable(color));
     ThemeSingleton.Get().PositiveColor = color;
     ThemeSingleton.Get().NeutralColor  = color;
     ThemeSingleton.Get().NegativeColor = color;
     if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
     {
         activity.Window.SetStatusBarColor(darker);
     }
 }
Example #3
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 #4
0
        public void ShowCustomView(object sender, EventArgs e)
        {
            MaterialDialog dialog = new MaterialDialog.Builder(this)
                                    .Title(Resource.String.googleWifi)
                                    .CustomView(Resource.Layout.dialog_customview, true)
                                    .PositiveText(Resource.String.connect)
                                    .NegativeText(Android.Resource.String.Cancel)
                                    .OnPositive((dialog1, which) => ShowToast("Password: " + _passwordInput.Text))
                                    .Build();

            _positiveAction = dialog.GetActionButton(DialogAction.Positive);

            _passwordInput              = dialog.CustomView.FindViewById <EditText>(Resource.Id.password);
            _passwordInput.TextChanged += (s, ev) =>
            {
                _positiveAction.Enabled = String.Concat(ev.Text.Select(c => c.ToString())).Trim().Length > 0;
            };

            CheckBox checkbox = dialog.CustomView.FindViewById <CheckBox>(Resource.Id.showPassword);

            checkbox.CheckedChange += (s, ev) =>
            {
                _passwordInput.InputType            = (!ev.IsChecked) ? InputTypes.TextVariationPassword : InputTypes.ClassText;
                _passwordInput.TransformationMethod = (!ev.IsChecked) ? PasswordTransformationMethod.Instance : null;
            };

            int widgetColor = ThemeSingleton.Get().WidgetColor;

            MDTintHelper.SetTint(checkbox,
                                 widgetColor == 0 ? ContextCompat.GetColor(this, Resource.Color.accent) : widgetColor);

            MDTintHelper.SetTint(_passwordInput,
                                 widgetColor == 0 ? ContextCompat.GetColor(this, Resource.Color.accent) : widgetColor);

            dialog.Show();
            _positiveAction.Enabled = false;
        }