Ejemplo n.º 1
0
 private void ColorPickerAdapterOnItemClick(object sender, ColorPickerAdapterClickEventArgs adapterClickEvents)
 {
     try
     {
         var position = adapterClickEvents.Position;
         if (position >= 0)
         {
             var item = ColorPickerAdapter.GetItem(position);
             if (item != null)
             {
                 if (MToolType == ToolType.Color)
                 {
                     MNiceArtEditorView.GetSource().ClearColorFilter();
                     MNiceArtEditor.ClearAllViews();
                     MNiceArtEditorView.GetSource().SetColorFilter(Color.ParseColor(item.ColorFirst));
                 }
                 else if (MToolType == ToolType.FilterColor)
                 {
                     MNiceArtEditorView.GetSource().ClearColorFilter();
                     MNiceArtEditorView.GetSource().SetColorFilter(Color.ParseColor(item.ColorFirst), PorterDuff.Mode.Multiply);
                 }
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
        //Color Image
        public void ColorPickerAdapterOnItemClick(object sender, ColorPickerAdapterClickEventArgs adapterClickEvents)
        {
            try
            {
                var position = adapterClickEvents.Position;
                if (position >= 0)
                {
                    var item = ColorPickerAdapter.GetItem(position);
                    if (item != null)
                    {
                        if (item.ColorFirst == "#ecf0f1")
                        {
                            MAutoResizeEditText.SetTextColor(Color.Black);
                            MAutoResizeEditText.SetHintTextColor(Color.Black);
                        }
                        else
                        {
                            MAutoResizeEditText.SetTextColor(Color.White);
                            MAutoResizeEditText.SetHintTextColor(Color.White);
                        }

                        if (!string.IsNullOrEmpty(item.ColorSecond))
                        {
                            int[] color = { Color.ParseColor(item.ColorFirst), Color.ParseColor(item.ColorSecond) };
                            var(gradient, bitmap) = ColorUtil.GetGradientDrawable(this, color, Width, Height);

                            NewColorView.GetSource()?.SetImageBitmap(bitmap);
                        }
                        else
                        {
                            int[] color = { Color.ParseColor(item.ColorFirst), Color.ParseColor(item.ColorFirst) };
                            var(gradient, bitmap) = ColorUtil.GetGradientDrawable(this, color, Width, Height);
                            NewColorView.GetSource()?.SetImageBitmap(bitmap);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
 public void ColorPickerAdapterOnItemClick(object sender, ColorPickerAdapterClickEventArgs e)
 {
     try
     {
         var position = e.Position;
         if (position > -1)
         {
             var item = ColorPickerAdapter.GetItem(position);
             if (item != null)
             {
                 MColorCode = item.ColorFirst;
                 MAddTextEditText.SetTextColor(Color.ParseColor(item.ColorFirst));
             }
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
Ejemplo n.º 4
0
 //Select Color Text
 private void PickerAdapterOnItemClick(object sender, ColorPickerAdapterClickEventArgs e)
 {
     try
     {
         var position = e.Position;
         if (position > -1)
         {
             var item = PickerAdapter.GetItem(position);
             if (item != null)
             {
                 ColorActivity.MColorCode = item.ColorFirst;
                 ColorActivity.MAutoResizeEditText.SetTextColor(Color.ParseColor(item.ColorFirst));
             }
         }
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
 public void ColorPickerAdapterOnItemClick(object sender, ColorPickerAdapterClickEventArgs e)
 {
     try
     {
         var position = e.Position;
         if (position > -1)
         {
             var item = ColorPickerAdapter.GetItem(position);
             if (item != null)
             {
                 if (MProperties == null)
                 {
                     return;
                 }
                 Dismiss();
                 MProperties.OnColorChanged(item.ColorFirst);
             }
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }